BookRags.com Literature Guides Literature
Guides
Criticism & Essays Criticism &
Essays
Questions & Answers Questions &
Answers
Lesson Plans Lesson
Plans
My Bibliography Periodic Table U.S. Presidents Shakespeare Sonnet Shake-Up
Research Anything:        
History | Encyclopedias | Films | News | Create a Bibliography | More... Login | Register | Help
Not What You Meant?  There are 19 definitions for Responsibility.  Also try: SRP.

Single responsibility principle

Print-Friendly
About 1 pages (321 words)

Bookmark and Share Questions on this topic? Just ask!

In computer science, the single responsibility principle was introduced by Tom DeMarco in his book Structured Analysis and Systems Specification, Yourdon Press Computing Series, 1979. It states that every object should have a single responsibility, and that all its services should be narrowly aligned with that responsibility. The principle forms part of cohesion, a concept widely used in software development. Robert Cecil Martin (Uncle Bob) has re-interpreted the concept[1] for OO as part of his Principles of Object Oriented Design[2], made popular by his book Agile Software Development: Principles, Patterns, and Practices. The essence of his interpretation is that a responsibility is a reason to change, and that a class or module should have one, and only one, reason to change. As an example, consider a module that compiles and prints a report. Such a module can be changed for two reasons. First, the content of the report can change. Second, the format of the report can change. These two things change for very different causes; one substantive, and one cosmetic. The SRP says that these two aspects of the problem are really two separate responsibilities, and should therefore be in separate classes or modules. It would be a bad design to couple two things that change for different reasons at different times. The reason it is important to keep a class focused on a single concern is that it makes the class more robust. Continuing with the foregoing example, if there is a change to the report compilation process, there is greater danger that the printing code will break if it is part of the same class. The single responsibility principle is used in responsibility driven design methodologies like the Responsibility Driven Design (RDD) and the Use Case / Responsibility Driven Analysis and Design (URDAD).

See also

View More Summaries on Single responsibility principle
 
Ask any question on Single responsibility principle and get it answered FAST!
Answer questions in BookRags Q&A and earn points toward
discounted or even FREE Study Guides and other BookRags products!
Learn more about BookRags Q&A
Copyrights
Single responsibility principle from Wíkipedia. ©2006 by Wíkipedia. Licensed under the GNU Free Documentation License. View a list of authors or edit this article.

Article Navigation
Join BookRagslearn moreJoin BookRags




About BookRags | Customer Service | Report an Error | Terms of Use | Privacy Policy