Single Responsibility or Changing Growing Responsibilities Principle

Architecture is full of examples of items designed to do more than one thing.  Your smart phone is a flash light.  From my last examples, a chair is also a clothes hanger.  A seat cushion is a flotation device.
Robert Martin said in his book Agile Software Development, Principles, Patterns, and Practice (http://en.wikipedia.org/wiki/Robert_Cecil_Martin),  that every class should have a single responsibility over a part of the function.  The function-part should be encapsulated and the class should do that and only that.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s