R4R provide basic Design-Patterns Tutorials concept with
Design-Patterns Examples .
Through R4R you can develop Design-Patterns programming concept. R4R provide
Design-Patterns Interview Questions with answers.R4R provide
Design-Patterns Languages study materials in easy way.
Introduction of Design
pattern
Design pattern is a proven design solution to a common problem faced
by software developers. Design Patterns are about design and interaction of
objects. Design patterns became popular with the rise of object oriented
analysis and design (OOAD). They provide a communication platform concerning
elegant, reusable solutions to commonly encountered programming
challenges. Design patterns are designed to help developers deliver higher
quality, more easily maintained software products in less time and at lower
cost. Design Patterns can solve problems by providing a framework for building a
cleaner and more efficient application.
classification of design patterns
There are three design pattern:-
1)Behavioral design patterns
2)Creational design patterns
3)Structural design patterns
1)Behavioral design patterns:-Behavioral
Patterns define the behavior of the classes involved. The popular behavioral
patterns include Chain of Responsibilities, Interpreter, Mediator, Iterator,
Observer, etc and it characterize the manner of class and object interaction and
how responsibilities are distributed among them. Observer pattern involves a
one-many dependency between objects where a change in an object(subject) needs
to be notified to all it's dependents(observers).
2)Creational design patterns:-This is a very
popular creational pattern which restricts a class to have only one instance and
it is address the object creation process. Creational design patterns
encapsulate knowledge about how, when, and by whom an instance is created.
3)Structural design patterns:-address the
composition of classes and objects.Structural patterns depend on the structure
of the classes involved. There are many structural patterns like Adapter,
Builder, Decorator, etc.
Design Patterns on the .NET Platform:
There are following of the design patterns used with .NET :
A) Creational Patterns:
* Factory Method
* Abstract Factory
* Builder
* Prototype
* Singleton
B) Structural Patterns:
* Adapter
* Bridge
* Composite
* Proxy
C) Behavioral Patterns:
* Iterator
* Observer
Advantage of Design Pattern
1. enable large scale reuse of S/W
2. Helps in improve developer communication.They consume more memory because of
generalised format
they are written, to store any kind of data
3. capture expert knowledge and design trade-offs and make
expertise widely available
4-Reusing design patterns helps to prevent subtle issues that can cause major
problems, and it also improves code readability for coders and architects who
are familiar with the patterns.
5-a standard solution to a common programming problem enable large scale reuse
of S/W
Disadvantage of Design Pattern
1.Do not lead to direct code reuse
2. Complex in nature and Design patterns may increase or decrease the
understandability of a design or implementation.
3. they are deceptivrly simple
4. they are validated by experince and discussion.
5.They can decrease understandability by adding indirection or
increasing the amount of code.