Showing posts with label OOA/D. Show all posts
Showing posts with label OOA/D. Show all posts

Wednesday, February 24, 2016

Method’s name change a lot

A few days ago I tried to help you with making a decision when you should use constructor and when setter.
In one of the paragraph I wrote:
I don’t like setters. Why? Because those methods in some way break encapsulation.
After sharing this post there were developers that were arguing that setters can be useful.

What can I say?

Monday, October 26, 2015

Where's the law?

If you would like to describe Law of Demeter in one sentence, it would go like that: “talk only with your (closest) friends”.
In full form it tells that a method of particular object can call only methods that belong to:
  • the same object,
  • any object that is an attribute of this object,
  • any object that was passed as a method’s parameter
  • any object that was locally created.