Single-responsibility principle
Computer programming principle
Computer programming principle
In computer programming, the single-responsibility principle (SRP) is a software design maxim stating that "a module should be responsible to one, and only one, actor." The term "actor" refers to a group (consisting of one or more stakeholders or users) that requires a change in the module. Software engineer Robert C. Martin, the originator of the term, expresses the principle as such: "A class should have only one reason to change". Because of confusion around the word "reason", he later clarified his meaning in a blog post titled "The Single Responsibility Principle", in which he mentioned Separation of Concerns and stated that "Another wording for the Single Responsibility Principle is: Gather together the things that change for the same reasons. Separate those things that change for different reasons." In some of his talks, he also argues that the principle is, in particular, about roles or actors. For example, while they might be the same person, the role of an accountant is different...
Open boosters, collect cards and trade them. Free to play.
Play for free