veffront.blogg.se

Single responsibility principle
Single responsibility principle








single responsibility principle single responsibility principle

Martin described it as being based on the principle of cohesion, as described by Tom DeMarco in his book "Structured Analysis and System Specification" and Meilir Page-Jones in "The Practical Guide to Structured Systems Design" In 2014 Martin wrote a blog post entitled The Single Responsibility Principle with a goal to clarify what was meant by the phrase "reason for change." Example

Single responsibility principle software#

Martin in an article by the same name as part of his "Principles of Object Oriented Design" made popular by his 2003 book "Agile Software Development, Principles, Patterns, and Practices". Hence, each module should be responsible for each role. For example, while they might be the same person, the role of an accountant is different from a database administrator. In some of his talks, he also argues that the principle is, in particular, about roles or actors. Martin, the originator of the term, expresses the principle as, "A class should have only one reason to change," although, because of confusion around the word "reason" he also stated "This principle is about people." All of that module, class or function's services should be narrowly aligned with that responsibility. The single-responsibility principle is a computer-programming principle that states that every module, class or function in a computer program should have responsibility over a single part of that program's functionality, and it should encapsulate that part.










Single responsibility principle