Open-closed in Angular heading

SOLID: The First 5 Principles of Object-Oriented Design

In software development, we encounter numerous scenarios where our codebase is not scalable enough. That kind of behaviour could cause problems in future that will be very difficult to maintain. 

The SOLID idea gives you a set of 5 rules that are: 

  • The Single-Responsibility principle (SRP)
  • The Open-closed principle
  • The Liskow Substitution principle (LSP)
  • The Interface Segregation principle (ISP)
  • The Dependency Injection principle (DIP)

Open-closed principle in Angular

This is Part 2 of the Open-closed principle in Angular. If you would first like to read Part 1 click here

Fixing the violation

Fixing OCP violation is to add customer details in order to separate the concerns. We can just simply create UserDetailsComponent to display additional information about the customer.