Feature Post

Top

Software Best Design Patterns


Quick glance at design patterns, hand



Pattern
Example
Reason
Momento
Redo-undo

Prototype
Deep copy/shallow copy

Fa├žade
Hides everything; one interface for all of the functionality; Complex subsystem
Factory
Create views for different types of documents;(html, pdf, doc, xml, etc)
Centralized creation of objects

create database connection for diff types of databases (sql, oracle, mysql, etc)
Decouple concrete classes from clients
Abstract Factory
Factory of factories





Pattern
Example
Reason
Builder
Report builder, header, footer, type (pdf, html, excel)
Separates construction from representation
Command
Commands from the file menu; New, Open, Print, Exit
Iterator
Iterates through a list of objects

Context help menu, help request goes to all of the controls on the windows forms; and whoever is responsible to provide the help, provides the help
Every objects gets a chance to perform its function. More: http://izlooite.blogspot.ae/2009/04/design-pattern-chain-of-responsibility.html




Pattern
Example
Reason
Unit of work
Manages a business transaction (That may contain list of transactions)
For instance, getting user input into a wizard.
Producer-Consumer Patter
A server getting millions of connections. All pushed into a queue, and processed one by one (or multiple, depending on server architecture).
Repository Pattern
Usually used with an ORM, that takes the responsibility of performing CRUD, by providing business methods

Multi device infrastructure


 Happy designing!



No comments