This presentation provide introduction to design pattern in software development and design principles behind it.
Example source code is available at
https://github.com/RiteshAgrawal/design-pattern-101
8. Do Not Repeat Yourself (DRY)
● Aimed at reducing repetition of code
● Use of helper classes and utilities
9. Single Responsibility Principle
● Class, module or function should have single responsibility
● High Cohesiveness
● Single Reason of change
10. Open-Close Principle
● Software entities (classes, modules, functions, etc.) should be open for
extension, but closed for modification.
● Classes allow to subclass and alter the behaviour but not allowed to change
the existing code
11. Program to Interfaces, not Implementations
● Focus on what to be done rather than how
● Interact at more abstract level
● Helps in changing the details without affecting the client or caller
12. Encapsulate What Varies
● Change is the only constant
● Isolate the implementation details which changes frequently
● Can be business logic, library, interface, etc.
● Legacy code handling
14. Strategic Pattern
● This pattern allows usage of different strategies by encapsulating the
algorithm
● Algorithm can vary independent of the client
● Client knows about the interface but not implementation
15. Adapter
● Joins functionality of incompatible interface
● Generalize interface of other functionality which can be helpful to change it in
future
● Using different product, libraries
16. Factory
● Abstracts process of creational of new objects
● Reduces code coupling by abstracting details of concrete classes