What are Design Patterns?
Design Pattern is a used and tested solution for a know problem.In simple words you can say a general reusable solution to a common occurring problem within a given context in software design.
Why Design Patterns?
Because good software design requires considerings issues that may not become visible until later in the implementation.
It prevents issues that can cause major problem in the software and also improves the code readability.
Different types of Design pattern by GOF(Gang of Four)
1)Creational Design Pattern
2)Structural Design Pattern
3)Behavioral Design Pattern
Again they have also categorised in different types such as
Creational Design Pattern
DP=Design Pattern
a)Factory Method DP
b)Abstract Factory DP
c)Builder DP
d)Prototype DP
e)Singleton DP
Structural Design Pattern
a)Adapter DP
b)Bridge DP
c)Composite DP
d)Decorator DP
e)Facade DP
f)Flyweight DP
g)Proxy DP
Behavioral Design Pattern
a)Observer DP
b)State DP
c)Strategy DP
d)Iterator DP
e)Chain of Responsibility DP
f)Command DP
g)Interpreter DP
h)Mediator DP
i)Memento DP
j)Template Method DP
k)Visitor DP
Is it necessary to use design pattern always?
No,because we should not try to force the code into a specific pattern rather notice which patterns start crystallise out of your code.I mean writing a program that does X using pattern Y is not a good idea.
The question is when did you start doing everything using patterns? Not all solution fit neatly into an existing design pattern and adopting a pattern may mean that you muddy the cleanness of your solution.
what is the difference between Design-Pattern and Framework?
1)DP are recurring solution to a problem that can come in life of an Application or Software.
Framework is a group of component that helps each other to provide a reusable architecture for application.
2)DP are logical in nature.
Framework is more physical in nature.
3)DP is independent of language where as framework depends on the language.
4)DP is generic in nature and can be used in any kind of application where as framework is domain specific.
continue.............
No comments:
Post a Comment