Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
57Activity
0 of .
Results for:
No results containing your search query
P. 1
Design Patterns

Design Patterns

Ratings: (0)|Views: 1,109 |Likes:
Published by Marko Čičak
This book contains all Design Patterns from Computer Science. All content of this book can be found at http://sourcemaking.com/design_patterns
This book contains all Design Patterns from Computer Science. All content of this book can be found at http://sourcemaking.com/design_patterns

More info:

Published by: Marko Čičak on Jun 29, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

11/25/2014

pdf

text

original

 
Design Patterns
 Arranged by Marko Čičak 
Note: all content in this book can be found athttp://sourcemaking.com/design_patternsNovi Sad, 2010.
 
2
of 
205
Table of Contents
Introduction............................................................................................................1
Uses of Design Patterns...............................................................................................................1Criticism......................................................................................................................................3Targets the wrong problem..........................................................................................................3Lacks formal foundations.............................................................................................................3Leads to inefficient solutions.......................................................................................................3Does not differ significantly from other abstractions..................................................................3
Creational patterns.................................................................................................5
Introduction.................................................................................................................................5 Abstract Factory Design Pattern..................................................................................................6Problem........................................................................................................................................6Discussion....................................................................................................................................6Structure......................................................................................................................................6Example.......................................................................................................................................7Check list.....................................................................................................................................8Rules of thumb.............................................................................................................................8Builder Design Pattern...............................................................................................................16Factory Method Design Pattern.................................................................................................28Object Pool Design Pattern........................................................................................................36Prototype Design Pattern...........................................................................................................41Singleton Design Pattern...........................................................................................................51
Structural patterns...............................................................................................58
Introduction...............................................................................................................................58 Adapter Design Pattern..............................................................................................................59Bridge Design Pattern................................................................................................................68Composite Design Pattern.........................................................................................................80Decorator Design Pattern..........................................................................................................91Facade Design Pattern...............................................................................................................94Flyweight Design Pattern.........................................................................................................102Proxy Design Pattern...............................................................................................................112
Behavioral patterns.............................................................................................122
Introduction.............................................................................................................................122Chain of Responsibility............................................................................................................124Command Design Pattern........................................................................................................132Interpreter Design Pattern......................................................................................................143Iterator Design Pattern............................................................................................................156Mediator Design Pattern..........................................................................................................166Memento Design Pattern.........................................................................................................176Null Object Design Pattern......................................................................................................182Observer Design Pattern..........................................................................................................184State Design Pattern................................................................................................................187Strategy Design Pattern...........................................................................................................189Template Method Design Pattern............................................................................................191 Visitor Design Pattern..............................................................................................................194
 
Introduction3
of 
205
In software engineering, a
design pattern
is a general repeatable solution to a commonlyoccurring problem in software design. A design pattern isn't a finished design that can betransformed directly into code. It is a description or template for how to solve a problem that canbe used in many different situations.
Introduction
Uses of Design Patterns
Design patterns can speed up the development process by providing tested, proven developmentparadigms. Effective software design requires considering issues that may not become visibleuntil later in the implementation. Reusing design patterns helps to prevent subtle issues that cancause major problems and improves code readability for coders and architects familiar with thepatterns.Often, people only understand how to apply certain software design techniques to certainproblems. These techniques are difficult to apply to a broader range of problems. Design patternsprovide general solutions, documented in a format that doesn't require specifics tied to aparticular problem.In addition, patterns allow developers to communicate using well-known, well understood namesfor software interactions. Common design patterns can be improved over time, making themmore robust than ad-hoc designs.
Creational design patterns
This design patterns is all about class instantiation. This pattern can be further divided into class-creation patterns and object-creational patterns. While class-creation patterns use inheritanceeffectively in the instantiation process, object-creation patterns use delegation effectively to getthe job done.
 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
Object Pool
 Avoid expensive acquisition and release of resources by recycling objects that are nolonger in use
Prototype
 A fully initialized instance to be copied or cloned
Singleton
 A class of which only a single instance can exist

Activity (57)

You've already reviewed this. Edit your review.
apallab916 liked this
1 thousand reads
1 hundred reads
ABHISHEK ANAND liked this
jamesroy2008 liked this
Angelo liked this
pradeep_sharma_k liked this
Hien La liked this
Coolingcomet liked this
Edward Miao liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->