Browse Definitions :
Definition

Single Responsibility Principle (SRP)

The Single Responsibility Principle (SRP) is the concept that any single object in object-oriented programing (OOP) should be made for one specific function. SRP is part of SOLID programming principles put forth by Robert Martin. Traditionally, code that is in keeping with SRP  has a single function per class.

SRP is intended to help make code modular with fewer difficulties arising from inter-dependencies. Making code more modular and packaged into functions helps make it more reusable and helps avoid time wasted recoding what has already been done. Adoption of SRP is supposed to help when updating code as there are fewer points of concern when a need is found to update a certain function.

Critics of SRP point out that the practice often results in numerous snippets of code tied together with too many microservices. However, it’s been noted that Martin has also recommended related functions need not be strictly isolated to be in keeping with SRP, saying, “Gather together the things that change for the same reasons. Separate those things that change for different reasons.”

This was last updated in February 2019

Continue Reading About Single Responsibility Principle (SRP)

Networking
  • What is asynchronous?

    In general, asynchronous -- from Greek asyn- ('not with/together') and chronos ('time') -- describes objects or events not ...

  • What is a URL (Uniform Resource Locator)?

    A URL (Uniform Resource Locator) is a unique identifier used to locate a resource on the internet.

  • What is FTP?

    File Transfer Protocol (FTP) is a network protocol for transmitting files between computers over TCP/IP connections.

Security
CIO
  • What is a software license?

    A software license is a document that provides legally binding guidelines for the use and distribution of software.

  • What is data storytelling?

    Data storytelling is the process of translating complex data analyses into understandable terms to inform a business decision or ...

  • What is demand shaping?

    Demand shaping is an operational supply chain management (SCM) strategy where a company uses tactics such as price incentives, ...

HRSoftware
Customer Experience
Close