the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
Design pattern 1
1. Pattern Study - 1
By,
D. B. Naga Muruga,
Dept of Mechanical Engineering,
Sriram Engineering College
2. What is a Design Pattern
a design pattern is simply a description of a recurring solution to a problem,
given a context.
The context is the environment, surroundings, situation, or interrelated
conditions within which the problem exists.
3. Classification Of Design Patterns
Purpose - what a pattern does
Creational patterns
Structural patterns
Behavioral pattern
J2EE patterns
Scope - what the pattern applies to
Class Patterns
Focus on the relationships between classes and their
subclasses- Involve inheritance reuse
Object Patterns
Focus on the relationships between objects
Involve composition reuse
4. All the creational patterns define the best possible way in which an
object can be instantiated. These describes the best way to CREATE
object instances. Now everyone knows the object instance in Java
can be created using a new operator.
Creational Patterns
5. Structural Patterns
Structural Patterns describe how objects and classes can be combined
to form larger structures. The difference between class patterns and
object patterns is that class patterns describe abstraction with the
help of inheritance and how it can be used to provide more useful
program interface. Object patterns, on other hand, describe how
objects can be associated and composed to form larger, more
complex structures.
6. Behavioral Patterns
Behavioral patterns are those which are concerned with interactions
between the objects. The interactions between the objects should
be such that they are talking to each other and still are loosely
coupled. The loose coupling is the key to n-tier architectures. In
this, the implementation and the client should be loosely coupled in
order to avoid hard-coding and dependencies.
7. Creational patterns
1) Abstract Factory
2) Builder
3) Factory method
4) Prototype
5) Singleton
- Concern the process of object creation
8. Structural patterns
1) Adapter
2) Bridge
3) Composite
4) Decorator
5) Façade
6) Flyweight
7) Proxy
-Deal with the composition of classes and objects
9. Behavioral pattern
1) Chain of Responsibility
2) Command
3) Interpreter
4) Iterator
5) Mediator
6) Memento
7) Observer
8) State
9) Strategy
10) Template Method
11) Visitor
-Deal with the interaction of classes and objects
10. J2EE patterns
1) MVC
2) Business Delegate
3) Composite Entity
4) Data Access Object
5) Front Controller
6) Intercepting Filter
7) Service Locator
8) Transfer Object
11.
12.
13. How many design patterns?
A site says at least 250 existing patterns are used in OO world,
including Spaghetti which refers to poor coding habits. The 23
design patterns by GOF are well known, and more are to be
discovered on the way.
Note that the design patterns are not idioms or algorithms or
components.