Posts

Showing posts from November, 2021

Design Patterns

 GOF (Gang Of Four) came up with the concepts of design patterns. We can classify the deign patterns in to thress. Creational Design Pattern Structural Design pattern Behavioural Design pattern

SOLID Principle (Quick Read)

Image
 The famous design principle comprises 5 design strategies that a developer should follow for a successful application development Single Responsibility Principle Open/ Close Principle Liskov Substitution Principle Interface Segregation Principle Dependency Inversion Single Responsibility Principle(SRP) No code unit(function/class/package) should have more than one responsibility.   Bad Ex:   Class Bird  {     String result;;    public fly(Bird bird)    {     if(bird==piegeon)       result="flys 20 meter hight";    else if(bird==hen)       result="flys 5 meter";    else        result="not measured yet";    } } This class should design such a way that it should work well for all the types of birds current design is hectic to maintain for the following reasons  difficult to test. difficult in parallel programming  understanding the code...