What are design patterns
What are design patterns ?
Design patterns are recurring solution to recurring problems in software architecture.
(A) Can you list down all patterns and their classification ?
Note :- This is advanced question because anyone who asks to list down all patterns can only be crazy for what he is asking. But it is always a win-win situation for the interviewer. There are three basic classification of patterns Creational, Structural and Behavioral patterns.
ã Abstract Factory:- Creates an instance of several families of classes
ã Builder :- Separates object construction from its representation
ã Factory Method:- Creates an instance of several derived classes
ã Prototype:- A fully initialized instance to be copied or cloned
ã Singleton:- A class in which only a single instance can exist
Note :- The best way to remember Creational pattern is by ABFPS (Abraham Became First President of States).
ã Adapter:-Match interfaces of different classes. ã Bridge:-Separates an objectfs interface from its implementation.
ã Composite:-A tree structure of simple and composite objects.
ã Decorator :-Add responsibilities to objects dynamically.
ã Facade:-A single class that represents an entire subsystem.
ã Flyweight:-A fine-grained instance used for efficient sharing.
ã Proxy:-An object representing another object.
Note : To remember structural pattern best is (ABCDFFP)
ã Mediator:-Defines simplified communication between classes.
ã Memento:-Capture and restore an object's internal state.
ã Interpreter:-A way to include language elements in a program.
ã Iterator:-Sequentially access the elements of a collection.
ã Chain of Resp:-A way of passing a request between a chain of objects.
ã Command:-Encapsulate a command request as an object.
ã State:-Alter an object's behavior when its state changes.
ã Strategy:-Encapsulates an algorithm inside a class.
ã Observer:-A way of notifying change to a number of classes.
ã Template Method:-Defer the exact steps of an algorithm to a subclass.
ã Visitor:-Defines a new operation to a class without change.
Note :- Just remember Music....... 2 MICS On TV (MMIICCSSOTV).
Note:- No source code is provided for architecture section as much of the things can be clear from good UML diagrams.
2007-10-24, 5430👍, 0💬
What is effort variance? Effort Variance = (Actual effort – Estimated Effort) / Estimated Effort.
What is difference between SITP and UTP in testing ? UTP (Unit Test Plan) are done at smallest unit ...
I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, ...
What is the difference between "printf(...)" and "sprintf(...)"? sprintf(...) writes data to the cha...
How To Insert Multiple Rows with a SELECT Statement? - MySQL FAQs - Managing Tables and Running Quer...