Adding content to 103-software-design-principles

content/software-design-and-architecture
syedmouaazfarrukh 2 years ago
parent 8b0a0aa933
commit 1d5026b25c
  1. 11
      src/roadmaps/software-design-architecture/content/103-software-design-principles/100-composition-over-inheritance.md
  2. 11
      src/roadmaps/software-design-architecture/content/103-software-design-principles/101-encapsulate-what-varies.md
  3. 11
      src/roadmaps/software-design-architecture/content/103-software-design-principles/102-program-against-abstractions.md
  4. 10
      src/roadmaps/software-design-architecture/content/103-software-design-principles/103-hollywood-principle.md
  5. 16
      src/roadmaps/software-design-architecture/content/103-software-design-principles/104-solid.md
  6. 11
      src/roadmaps/software-design-architecture/content/103-software-design-principles/105-dry.md
  7. 11
      src/roadmaps/software-design-architecture/content/103-software-design-principles/106-yagni.md
  8. 21
      src/roadmaps/software-design-architecture/content/103-software-design-principles/index.md

@ -1 +1,10 @@
# Composition over inheritance
# Composition over Inheritance
Composition over inheritance is a programming principle that suggests that it is better to use composition, a mechanism for assembling objects, to create complex objects, rather than using inheritance, which is a mechanism for creating new classes based on existing ones.
Inheritance is a powerful mechanism for creating reusable code, but it can also lead to tightly coupled, hard-to-maintain code. This is because inherited classes are tightly bound to their parent classes and any changes made to the parent class will affect all of its child classes. This makes it hard to change or extend the code without affecting the entire class hierarchy.
Learn more from the following links:
- [Tutorial - Composition over Inheritance](https://www.youtube.com/watch?v=wfMtDGfHWpA)
- [Overview of Composition over Inheritance](https://en.wikipedia.org/wiki/Composition_over_inheritance)

@ -1 +1,10 @@
# Encapsulate what varies
# Encapsulate What Varies
Encapsulate what varies is a programming principle that suggests that code should be organized in such a way that the parts that are likely to change in the future are isolated from the parts that are unlikely to change. This is accomplished by creating interfaces and classes that separate the varying parts of the code from the stable parts.
Encapsulating what varies allows for more flexibility in the code. When changes are needed, they can be made to the encapsulated parts without affecting the rest of the code. This makes it easier to understand, test, and maintain the code.
Learn more from the following resources:
- [What does it mean when one says “Encapsulate what varies”?](https://softwareengineering.stackexchange.com/questions/337413/what-does-it-mean-when-one-says-encapsulate-what-varies)
- [Overview of Encapsulate What Varies](https://bootcamp.uxdesign.cc/software-design-principles-every-developers-should-know-23d24735518e)

@ -1 +1,10 @@
# Program against abstractions
# Program Against Abstractions
Programming against abstractions is a programming principle that suggests that code should be written in such a way that it is not tied to specific implementations, but rather to abstractions. This is accomplished by defining interfaces or abstract classes that define the behavior of a group of related classes without specifying their implementation.
Programming against abstractions allows for more flexibility in the code. When changes are needed, they can be made to the implementation of the abstractions without affecting the code that uses them. This makes it easier to understand, test, and maintain the code.
Learn more from the following resources:
- [What is Abstraction in Programming – And Why is it Useful?](https://www.freecodecamp.org/news/what-is-abstraction-in-programming/)
- [Overview of Abstraction principle](https://en.wikipedia.org/wiki/Abstraction_principle_(computer_programming))

@ -1 +1,9 @@
# Hollywood principle
# Hollywood Principle
The Hollywood Principle is a software development principle that states: "Don't call us, we'll call you." It suggests that high-level components should dictate the flow of control in an application, rather than low-level components.
This principle is often used in the context of inversion of control (IoC) and dependency injection. In traditional software development, low-level components are responsible for creating and managing the high-level components that they depend on. With IoC, the high-level components dictate the flow of control, and the low-level components are created and managed by a separate mechanism.
Learn more from the following resources:
- [Tutorial - Hollywood Principle](https://www.youtube.com/watch?v=lRuygpsXE5s)

@ -1 +1,15 @@
# Solid
# SOLID
SOLID is an acronym that stands for five principles of object-oriented software development, which were first introduced by Robert C. Martin in the early 2000s. These principles are:
- Single Responsibility Principle (SRP)
- Open/Closed Principle (OCP)
- Liskov Substitution Principle (LSP)
- Interface Segregation Principle (ISP)
- Dependency Inversion Principle (DIP)
Learn more from the following resources:
- [Get Started with SOLID](https://www.bmc.com/blogs/solid-design-principles/)
- [Introduction to SOLID Principles of Software Architecture](https://www.developer.com/project-management/solid-principles-software-architecture/)
- [Tutorial - What are SOLID principle?](https://www.youtube.com/watch?v=aUCo5cy32kE)

@ -1 +1,10 @@
# Dry
# DRY
DRY (Don't Repeat Yourself) is a software development principle that suggests that code should not have duplicate functionality. The idea is to keep the codebase as simple as possible by eliminating redundancy and duplication. The goal is to reduce complexity and improve maintainability by ensuring that each piece of knowledge is expressed in a single, unambiguous way within the system.
The DRY principle is closely related to the Single Responsibility Principle (SRP) and the Open-Closed Principle (OCP), which are part of the SOLID principles. The DRY principle aims to reduce the amount of duplicate code by creating abstractions that can be reused across the system.
Learn more from the following resources:
- [What is DRY in programming?](https://www.youtube.com/watch?v=Rv3RIc_ziOY)
- [Overview of Don't repeat yourself (DRY)](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)

@ -1 +1,10 @@
# Yagni
# YAGNI
YAGNI (You Ain't Gonna Need It) is a software development principle that suggests that developers should not add functionality to a codebase unless it is immediately necessary. The idea is to avoid creating unnecessary complexity in the codebase by only adding features that are actually needed.
The YAGNI principle is closely related to the Single Responsibility Principle (SRP) and the Open-Closed Principle (OCP), which are part of the SOLID principles. YAGNI aims to keep the codebase as simple as possible by avoiding the creation of unnecessary abstractions and functionality.
Learn more from the following resources:
- [YAGNI (You Aren’t Gonna Need It) Principle Helps in Efficiency](https://builtin.com/software-engineering-perspectives/yagni)
- [What is YAGNI coding rule, and Why it helps?](https://www.youtube.com/watch?v=2vys1q1dKc4)

@ -1 +1,20 @@
# Software design principles
# Software Design Principles
There are many software design principles that aim to guide the development of software in a way that makes it easy to understand, maintain, and extend. Some of the most common design principles include:
- SOLID principles (Single Responsibility Principle, Open/Closed Principle, Liskov Substitution Principle, Interface Segregation Principle, and Dependency Inversion Principle)
- DRY (Don't Repeat Yourself)
- YAGNI (You Ain't Gonna Need It)
- KISS (Keep It Simple, Stupid)
- LoD (Law of Demeter)
- Composition over Inheritance
- Encapsulate What Varies
- Hollywood Principle
- Program Against Abstractions
By following these design principles, software can be developed in a way that is easy to understand, maintain, and extend, and that is less prone to bugs.
Learn more from the following resources:
- [Principles of Software Design](https://www.geeksforgeeks.org/principles-of-software-design/)
- [Software Design Principles For Beginners](https://www.youtube.com/watch?v=60EqoRcanpo)
Loading…
Cancel
Save