A Beginner’s Guide to Design Patterns

We use design patterns so that we don’t have to write repeated code again and again for same kind of problem. Design pattern is not a class or piece of code. Its a template which should be implemented based on the situation. Design patterns are divided into following categories:- Behavioral, Creational, Structural Behavioral pattern: As the name explain, Behavioral patterns describe how the objects behave … Continue reading A Beginner’s Guide to Design Patterns

Liskov Substitution Principle

Liskov Substitution Principle Explained: Any reference variable attribute of Class that uses pointers to Parent Class must be fully replaceable with other Child objects of that same Parent Class. public class LiskovPrinclple { public static void main(String[] args) { Shape shape = new Square(); } } class Shape { } class Square extends Shape {  } class Circle extends Shape { } class Triangle extends … Continue reading Liskov Substitution Principle

S.O.L.I.D Design Principle.

 SOLID Design Principles Explained: SOLID is one of the most used Design Principle in OOPS world. Its a mnemonic of below described words Single Responsibility Principle Open/Closed Principle Liskov Substitution Principle Interface Segregation Principle Dependency Inversion   Single Responsibility Principle: As the name says, every Class should have only one thing to do i.e. one Class should be responsible to execute or perform only on … Continue reading S.O.L.I.D Design Principle.