Monday, December 12, 2011

Least knowledge

Before :

Let's say we have following Address class:

And we are using it in another class like Person:

And at the end, A client code that is going to use it in this way:


Now Lets' change Person to add new methods to return first and second line of address:

So client can utilize new methods in this way:

What are the pros & cons for each solution (before and after) ?

Wednesday, December 7, 2011

The SOLID Principles, Explained with Motivational Posters


See more posters here