SOLID

Last updated

In software engineering, SOLID is a mnemonic acronym for five design principles intended to make object-oriented designs more understandable, flexible, and maintainable. The principles are a subset of many principles promoted by American software engineer and instructor Robert C. Martin, [1] [2] [3] first introduced in his 2000 paper Design Principles and Design Patterns discussing software rot. [2] [4] :2–3

The SOLID ideas are

The SOLID acronym was introduced later, around 2004, by Michael Feathers. [11]

Although the SOLID principles apply to any object-oriented design, they can also form a core philosophy for methodologies such as agile development or adaptive software development. [3]

See also

Related Research Articles

This is a list of terms found in object-oriented programming.

In knowledge representation and ontology components, including for object-oriented programming and design, is-a is a subsumptive relationship between abstractions, wherein one class A is a subclass of another class B . In other words, type A is a subtype of type B when A's specification implies B's specification. That is, any object that satisfies A's specification also satisfies B's specification, because B's specification is weaker.

<span class="mw-page-title-main">Liskov substitution principle</span> Object-oriented programming principle

The Liskov substitution principle (LSP) is a particular definition of a subtyping relation, called strong behavioral subtyping, that was initially introduced by Barbara Liskov in a 1987 conference keynote address titled Data abstraction and hierarchy. It is based on the concept of "substitutability" – a principle in object-oriented programming stating that an object may be replaced by a sub-object without breaking the program. It is a semantic rather than merely syntactic relation, because it intends to guarantee semantic interoperability of types in a hierarchy, object types in particular. Barbara Liskov and Jeannette Wing described the principle succinctly in a 1994 paper as follows:

Subtype Requirement: Let be a property provable about objects of type T. Then should be true for objects of type S where S is a subtype of T.

Mung or munge is computer jargon for a series of potentially destructive or irrevocable changes to a piece of data or a file. It is sometimes used for vague data transformation steps that are not yet clear to the speaker. Common munging operations include removing punctuation or HTML tags, data parsing, filtering, and transformation.

In computing, an interface is a shared boundary across which two or more separate components of a computer system exchange information. The exchange can be between software, computer hardware, peripheral devices, humans, and combinations of these. Some computer hardware devices, such as a touchscreen, can both send and receive data through the interface, while others such as a mouse or microphone may only provide an interface to send data to a given system.

In software engineering, service-oriented architecture (SOA) is an architectural style that focuses on discrete services instead of a monolithic design. By consequence, it is also applied in the field of software design where services are provided to the other components by application components, through a communication protocol over a network. A service is a discrete unit of functionality that can be accessed remotely and acted upon and updated independently, such as retrieving a credit card statement online. SOA is also intended to be independent of vendors, products and technologies.

In software engineering, inversion of control (IoC) is a design principle in which custom-written portions of a computer program receive the flow of control from a generic framework. The term "inversion" is historical: a software architecture with this design "inverts" control as compared to procedural programming. In procedural programming, a program's custom code calls reusable libraries to take care of generic tasks, but with inversion of control, it is the framework that calls the custom code.

A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources, and web APIs. Web frameworks provide a standard way to build and deploy web applications on the World Wide Web. Web frameworks aim to automate the overhead associated with common activities performed in web development. For example, many web frameworks provide libraries for database access, templating frameworks, and session management, and they often promote code reuse. Although they often target development of dynamic web sites, they are also applicable to static websites.

The single-responsibility principle (SRP) is a computer programming principle that states that "A module should be responsible to one, and only one, actor." The term actor refers to a group that requires a change in the module.

In object-oriented design, the dependency inversion principle is a specific methodology for loosely coupled software modules. When following this principle, the conventional dependency relationships established from high-level, policy-setting modules to low-level, dependency modules are reversed, thus rendering high-level modules independent of the low-level module implementation details. The principle states:

General Responsibility Assignment Software Patterns, abbreviated GRASP, is a set of "nine fundamental principles in object design and responsibility assignment" first published by Craig Larman in his 1997 book Applying UML and Patterns.

The anemic domain model is described as a programming anti-pattern where the domain objects contain little or no business logic like validations, calculations, rules, and so forth. The business logic is thus baked into the architecture of the program itself, making refactoring and maintenance more difficult and time-consuming.

<span class="mw-page-title-main">Open–closed principle</span> Concept in object-oriented programming

In object-oriented programming, the open–closed principle (OCP) states "software entities should be open for extension, but closed for modification"; that is, such an entity can allow its behaviour to be extended without modifying its source code.

In the field of software engineering, the interface segregation principle (ISP) states that no code should be forced to depend on methods it does not use. ISP splits interfaces that are very large into smaller and more specific ones so that clients will only have to know about the methods that are of interest to them. Such shrunken interfaces are also called role interfaces. ISP is intended to keep a system decoupled and thus easier to refactor, change, and redeploy. ISP is one of the five SOLID principles of object-oriented design, similar to the High Cohesion Principle of GRASP. Beyond object-oriented design, ISP is also a key principle in the design of distributed systems in general and microservices in particular. ISP is one of the six IDEALS principles for microservice design.

<span class="mw-page-title-main">Object-oriented programming</span> Programming paradigm based on the concept of objects

Object-oriented programming (OOP) is a programming paradigm based on the concept of objects, which can contain data and code: data in the form of fields, and code in the form of procedures. In OOP, computer programs are designed by making them out of objects that interact with one another.

The virtual world framework (VWF) is a means to connect robust 3D, immersive, entities with other entities, virtual worlds, content and users via web browsers. It provides the ability for client-server programs to be delivered in a lightweight manner via web browsers, and provides synchronization for multiple users to interact with common objects and environments. For example, using VWF, a developer can take video lesson plans, component objects and avatars and successfully insert them into an existing virtual or created landscape, interacting with the native objects and users via a VWF interface.

The acyclic dependencies principle (ADP) is a software design principle defined by Robert C. Martin that states that "the dependency graph of packages or components should have no cycles". This implies that the dependencies form a directed acyclic graph.

<span class="mw-page-title-main">Robert C. Martin</span> American software consultant

Robert Cecil Martin, colloquially called "Uncle Bob", is an American software engineer, instructor, and author. He is most recognized for promoting many software design principles and for being an author and signatory of the influential Agile Manifesto.

The hexagonal architecture, or ports and adapters architecture, is an architectural pattern used in software design. It aims at creating loosely coupled application components that can be easily connected to their software environment by means of ports and adapters. This makes components exchangeable at any level and facilitates test automation.

The entity-control-boundary (ECB), or entity-boundary-control (EBC), or boundary-control-entity (BCE) is an architectural pattern used in use-case driven object-oriented programming that structures the classes composing high-level object-oriented source code according to their responsibilities in the use-case realization.

References

  1. Martin, Robert C. "Principles Of OOD". ButUncleBob.com. Archived from the original on Sep 10, 2014. Retrieved 2014-07-17.. (Note the reference to "the first five principles", although the acronym is not used in this article.) Dates back to at least 2003.
  2. 1 2 Martin, Robert C. (13 Feb 2009). "Getting a SOLID start". Uncle Bob Consulting LLC (Google Sites). Archived from the original on Sep 17, 2013. Retrieved 2013-08-19.
  3. 1 2 Metz, Sandi (May 2009). "SOLID Object-Oriented Design". YouTube . Archived from the original on 2021-12-21. Retrieved 2019-08-13. Talk given at the 2009 Gotham Ruby Conference.
  4. 1 2 3 Martin, Robert C. (2000). "Design Principles and Design Patterns" (PDF). objectmentor.com. Archived from the original on 2015-09-06.{{cite web}}: CS1 maint: unfit URL (link)
  5. "Single Responsibility Principle" (PDF). objectmentor.com. Archived from the original on 2 February 2015.{{cite web}}: CS1 maint: unfit URL (link)
  6. Martin, Robert C. (2003). Agile Software Development, Principles, Patterns, and Practices. Prentice Hall. p. 95. ISBN   978-0135974445.
  7. "Open/Closed Principle" (PDF). objectmentor.com. Archived from the original on 5 September 2015.{{cite web}}: CS1 maint: unfit URL (link)
  8. 1 2 "Liskov Substitution Principle" (PDF). objectmentor.com. Archived from the original on 5 September 2015.{{cite web}}: CS1 maint: unfit URL (link)
  9. "Interface Segregation Principle" (PDF). objectmentor.com. 1996. Archived from the original on 5 September 2015.{{cite web}}: CS1 maint: unfit URL (link)
  10. "Dependency Inversion Principle" (PDF). objectmentor.com. Archived from the original on 5 September 2015.{{cite web}}: CS1 maint: unfit URL (link)
  11. Martin, Robert (2018). Clean Architecture: A Craftsman's Guide to Software Structure and Design. p. 58. ISBN   9780134494166.