This post originated from an RSS feed registered with .NET Buzz
by Udi Dahan.
Original Post: Revisiting Udi's first principle of design
Feed Title: Udi Dahan - The Software Simplist
Feed URL: http://feeds.feedburner.com/UdiDahan-TheSoftwareSimplist
Feed Description: I am a software simplist. I make this beast of architecting, analysing, designing, developing, testing, managing, deploying software systems simple.
This blog is about how I do it.
The interface which separates two concrete classes should be packaged separately from either of those classes.
[aside: take a peek at Marco's post for some great visualizations of this topic.]
Corollary #1:
Separately packaged leads to separately versioned. Managing change and integration is much easier when there are "islands of stability", entire packages which are not affected by changes in implementation.
Basic underlying theory:
CRC cards.
Class, Role, Collaboration.
By dividing a system into a bunch of roles that collaborate, we can vary implementation without affecting overall system structural stability. Therefore, a class that is taking on the responsibility of implementing a given role, will collaborate with other roles in fulfilling its duties. Besides "util" classes which fill no role (and OO shows we can often do without), the "need" to tie the class to another class' implementation often points to a missing role.