Suggested Video Tutorials
C# Tutorial
Design Patterns Tutorial
In this video we will discuss
SOLID Introduction
SOLID Acronym
In the next video we will discuss single responsibility principle in detail with a sample example.
C# Tutorial
Design Patterns Tutorial
In this video we will discuss
- SOLID Acronym and Introduction
- SOLID design principles
- Why SOLID
SOLID Introduction
- SOLID principles are the design principles that enable us manage most of the software design problems
- The term SOLID is an acronym for five design principles intended to make software designs more understandable, flexible and maintainable
- The principles are a subset of many principles promoted by Robert C. Martin
- The SOLID acronym was first introduced by Michael Feathers
SOLID Acronym
- S : Single Responsibility Principle (SRP)
- O : Open closed Principle (OSP)
- L : Liskov substitution Principle (LSP)
- I : Interface Segregation Principle (ISP)
- D : Dependency Inversion Principle (DIP)
- Robert C. Martin expresses the principle as, "A class should have only one reason to change”
- Every module or class should have responsibility over a single part of the functionality provided by the software, and that responsibility should be entirely encapsulated by the class
- Introduced by Barbara Liskov state that “objects in a program should be replaceable with instances of their sub-types without altering the correctness of that program”
- If a program module is using a Base class, then the reference to the Base class can be replaced with a Derived class without affecting the functionality of the program module
- We can also state that Derived types must be substitutable for their base types
- “Software entities should be open for extension, but closed for modification”
- The design and writing of the code should be done in a way that new functionality should be added with minimum changes in the existing code
- The design should be done in a way to allow the adding of new functionality as new classes, keeping as much as possible existing code unchanged
- “Many client-specific interfaces are better than one general-purpose interface”
- We should not enforce clients to implement interfaces that they don't use. Instead of creating one big interface we can break down it to smaller interfaces
- One should “depend upon abstractions, [not] concretions"
- Abstractions should not depend on the details whereas the details should depend on abstractions
- High-level modules should not depend on low level modules
- End up with tight or strong coupling of the code with many other modules/applications
- Tight coupling causes time to implement any new requirement, features or any bug fixes and some times it creates unknown issues
- End up with a code which is not testable
- End up with duplication of code
- End up creating new bugs by fixing another bug
- End up with many unknown issues in the application development cycle
- Achieve reduction in complexity of code
- Increase readability, extensibility and maintenance
- Reduce error and implement Reusability
- Achieve Better testability
- Reduce tight coupling
- Architecture : choosing an architecture is the first step in designing application based on the requirements. Example : MVC, WEBAPI, MVVM..etc
- Design Principles : Application development process need to follow the design principles
- Design Patterns : We need to choose correct design patterns to build the software
In the next video we will discuss single responsibility principle in detail with a sample example.
Excellent. Please explain with example. As SOLID is as important as backbone. Thanks a lot
ReplyDeleteExcellent tutorial
ReplyDelete