Single-responsibility principle

The single-responsibility principle (SRP) is a computer programming principle that states that "A module should be responsible to one, and only one, actor."

Rule of one

Apply the single responsibility principle (SRP)arrow-up-right to all components, services, and other symbols. This helps make the application cleaner, easier to read and maintain, and more testable.

Do define one thing, such as a service or component, per file.

The goal is to make the code more reusable, easier to read, and less mistake-prone. As the application grows, this rule becomes even more important.

Last updated