Design Principle1. SOLID - Principle S ingle Responsibility Principle O pen-Closed Principle L iskov Substitution Principle I nterface Segregation Principle D ependency Inversion Principle 2. DRY - Don't Repeat Your SelfJun 7, 2024 · 1 min readgurupalaniveltech.hashnode.dev
Dependency Inversion PrincipleThe Dependency Inversion Principle (DIP) states that high level modules(Payment ) should not depend on low level modules(UpiPayment ,CryptoPayment); both should depend on abstractions(PaymentGateway). Abstractions should not depend on details. Bad Pr...Jun 7, 2024 · 1 min readgurupalaniveltech.hashnode.dev
Interface Segregation PrincipleThe Interface Segregation Principle (ISP) suggests that a class should not be forced to implement methods it doesn’t need. Bad Practice - Principle not followed +------------------+ | <<interface>> | | IVeh...Jun 7, 2024 · 1 min readgurupalaniveltech.hashnode.dev
Liskov Substitution PrincipleLiskov Substitution Principle enables you to replace objects of a parent class(Bird) with objects of a subclass(Eagle,Penguin) without breaking the application. Liskov Substitution Principle extends the open/closed Principle. public class Bird { ...Jun 7, 2024 · 2 min readgurupalaniveltech.hashnode.dev
Open-Closed PrincipleOpen for Extension and Closed for Modification. We understand this with simple user class @startuml class User { + id: int + age: int + name: string } @enduml now I want to add new feature if the user is privileged capture the phone number to ...Jun 1, 2024 · 1 min readgurupalaniveltech.hashnode.dev