SlideShare uma empresa Scribd logo
1 de 35
Design Patterns – Eran Toch
Methodologies in Information System Development
Design Patterns:Design Patterns:
Talking in the Design LanguageTalking in the Design Language
Eran Toch
Methodologies in the Development
of Information Systems
Design Patterns – Eran Toch
2November 2003
AgendaAgenda
• What is a Design Pattern?
• Structural Patterns
– The Composite Pattern
• Behavioral Patterns
– The Strategy Pattern
• Creational Patterns
– The Singleton Pattern
• Human Interaction Patterns
– Go Back to a Safe Place
• Summary
Design Patterns – Eran Toch
3November 2003
What is a Design Pattern?What is a Design Pattern?
In Short, a solution
for a typical problem
“a description of a recurrent
problem and of the core of possible
solutions.“
Design Patterns – Eran Toch
4November 2003
Why do we need them?Why do we need them?
• Problems are not always unique. Reusing
existing experience might be proved useful.
• We need a common language to describe
problems and solutions.
• The Design of Object-Oriented systems limits
the scope of problems and solutions we can
talk about
Design Patterns – Eran Toch
5November 2003
History of Design PatternsHistory of Design Patterns
Christopher Alexander
A Pattern Language: Towns, Buildings Construction 1970’
1995’
2000’
Architecture
Object Oriented
Software Design
Other Areas:
HCI, Organizational Behavior…
Gang of Four (GoF)
Design Patterns: Elements of
Reusable Object-Oriented Software
Many Authors
Design Patterns – Eran Toch
6November 2003
Structure of a design patternStructure of a design pattern
• Pattern Name and Classification
• Intent
– a Short statement about what the pattern does
• Motivation
– A scenario that illustrates where the pattern would be
useful
• Applicability
– Situations where the pattern can be used
Design Patterns – Eran Toch
7November 2003
Structure of a design pattern – cont’dStructure of a design pattern – cont’d
• Structure
– A graphical representation of the pattern
• Participants
– The classes and objects participating in the pattern
• Collaborations
– How to do the participants interact to carry out their
responsibilities?
• Consequences
– What are the pros and cons of using the pattern?
• Implementation
– Hints and techniques for implementing the pattern
Design Patterns – Eran Toch
8November 2003
Classification of patternsClassification of patterns
• Structural
– Composite*, Decorator, Façade, Adapter…
• Behavioral
– Strategy*, Command, Observer, Chain of
Responsibilities…
• Creational
– Singleton*, Abstract Factory, Factory Method…
• Other
– User interface Patterns
• Go Back to a Safe Place
Design Patterns – Eran Toch
9November 2003
AgendaAgenda
• What is a Design Pattern?
• Structural Patterns
• Behavioral Patterns
• Creational Patterns
• Human Interaction Patterns
• Summary
Design Patterns – Eran Toch
10November 2003
The Composite PatternThe Composite Pattern
• Intent:
– Compose objects into tree structures to represent
part-whole hierarchies.
– Composite lets clients treat individual objects and
compositions of objects uniformly. This is called
recursive composition.
Design Patterns – Eran Toch
11November 2003
MotivationMotivation
When Processing the hierarchal
collection, we need to query the
type of the object (composite or
primitive) and act differently
Diagram reference: Design
Patterns [Gof]
Design Patterns – Eran Toch
12November 2003
Composite: ApplicabilityComposite: Applicability
• Use the Composite pattern when:
– You want to represent part-whole hierarchies of
objects.
– You want clients to be able to ignore the
difference between compositions of objects and
individual objects. Clients will treat all objects in
the composite structure uniformly.
Design Patterns – Eran Toch
13November 2003
Composite: StructureComposite: Structure
• Define an abstract base class that specifies the
uniform behavior.
• Subclass the Primitive and Composite classes of the
Component class.
Diagram reference: Design
Patterns [Gof]
Design Patterns – Eran Toch
14November 2003
Composite: ConsequencesComposite: Consequences
• Benefits
– It makes it easy to add new kinds of components
– It makes clients simpler, since they do not have to
know if they are dealing with a leaf or a composite
component
• Liabilities
– It makes it harder to restrict the type of components of
a composite
Design Patterns – Eran Toch
15November 2003
Composite: Known UsesComposite: Known Uses
1. A GUI system has window objects which can
contain various GUI components (widgets) such as,
buttons and text areas. A window can also contain
widget container objects which can hold other
widgets.
Concrete examples: Java Swing, MFC
2. Folder based file system
3. Arithmetic expressions
Design Patterns – Eran Toch
16November 2003
AgendaAgenda
• What is a Design Pattern?
• Structural Patterns
• Behavioral Patterns
• Creational Patterns
• Human Interaction Patterns
• Summary
Design Patterns – Eran Toch
17November 2003
The Strategy PatternThe Strategy Pattern
• Intent:
– Define a family of algorithms, encapsulate each one,
and make them interchangeable.
– Strategy lets the algorithm vary independently from
clients that use it.
Design Patterns – Eran Toch
18November 2003
Strategy: MotivationStrategy: Motivation
The client wants to use the algorithm
without knowing which one to use in
advance. We want to add new
algorithms without changing the
client class.
Design Patterns – Eran Toch
19November 2003
Strategy: StructureStrategy: Structure
• Encapsulate the behavior of the context class in a
separate algorithm class.
• The context class keeps a reference to the algorithm
class and passes on the messages.
• The algorithm class can be sub-classed to support
multiple algorithms.
Design Patterns – Eran Toch
20November 2003
Strategy: ConsequencesStrategy: Consequences
• Benefits
– Provides an alternative to subclassing the Context
class to get a variety of algorithms or behaviors
– Keeps the client clean from large conditional
statements
– Provides a choice of implementations for the same
behavior
• Liabilities
– Increases the number of objects
– All algorithms must use the same Strategy interface
– We still need conditional statements!
Design Patterns – Eran Toch
21November 2003
Strategy: Known UsesStrategy: Known Uses
• QSIA Learning System
• Layout Manager in Java
Swing
• Sorting algorithms,
memory allocation
algorithms and more…
Design Patterns – Eran Toch
22November 2003
AgendaAgenda
• What is a Design Pattern?
• Structural Patterns
• Behavioral Patterns
• Creational Patterns
• Human Interaction Patterns
• Summary
Design Patterns – Eran Toch
23November 2003
The Singleton PatternThe Singleton Pattern
• Intent.
– Ensure a class only has one instance, and provide a
global point of access to it.
• Motivation.
– Sometimes, an application needs one, and only one,
instance of an object. For example, we want just one
window manager. Or just one factory for a family of
products.
– We need to have that one instance easily accessible.
– And we want to ensure that additional instances of the
class can not be created.
Design Patterns – Eran Toch
24November 2003
Singleton: StructureSingleton: Structure
• Declare the single instance as a private static data
member.
• Provide a public static member function that
encapsulates all initialization code, and provides
access to the instance.
Design Patterns – Eran Toch
25November 2003
Singleton: Example CodeSingleton: Example Code
public class Singleton {
// The private reference to the one and only instance.
private static Singleton uniqueInstance = null;
// An instance attribute.
private int data = 0;
/**
* Returns a reference to the single instance.
* Creates the instance if it does not yet exist.
*/
public static Singleton instance() {
if(uniqueInstance == null)
uniqueInstance = new Singleton();
return uniqueInstance;
}
/**
* The Singleton Constructor. Note that it is private!
* No client can instantiate a Singleton object!
*/
private Singleton() {}
}
Design Patterns – Eran Toch
26November 2003
Singleton: Example Code – cont’dSingleton: Example Code – cont’d
public class TestSingleton {
public static void main(String args[]) {
// Get a reference to the single instance of Singleton.
Singleton s = Singleton.instance();
// Set the data value.
s.setData(34);
System.out.println("First reference: " + s);
System.out.println("Singleton data value is: " + s.getData());
// Get another reference to the Singleton.
// Is it the same object?
s = null;
s = Singleton.instance();
System.out.println("nSecond reference: " + s);
System.out.println("Singleton data value is: " + s.getData());
}
}
What will be the output?
Design Patterns – Eran Toch
27November 2003
AgendaAgenda
• What is a Design Pattern?
• Structural Patterns
• Behavioral Patterns
• Creational Patterns
• Human Interaction Patterns
• Summary
Design Patterns – Eran Toch
28November 2003
Human Interaction PatternsHuman Interaction Patterns
• A Pattern language to describe human
interaction situations
• Examples:
– Go Back to a Safe Place
– Form
– Control Panel
– WYSIWYG Editor
– Hierarchical Set
– Map of Navigable Spaces
– More…
Design Patterns – Eran Toch
29November 2003
Go Back to a Safe PlaceGo Back to a Safe Place
• Problem:
– How can the artifact make navigation easy, convenient, and
psychologically safe for the user?
• Forces:
– A user may forget where they were, if they stop using the artifact
while they're in the middle of something and don't get back to it
for a while.
– If the user gets into a space or a state that they don't want to be
in, they will want to get out of it in a safe and predictable way.
– The user is more likely to explore an artifact if they are assured
that they can easily get out of an undesired state or space; that
assurance engenders a feeling of security.
Design Patterns – Eran Toch
30November 2003
Go Back to a Safe PlaceGo Back to a Safe Place
• Solution:
– Provide a way to go back to a checkpoint of the user's
choice.
• Examples:
– The "Home" button on a Web browser
– Turning back to the beginning of a chapter in a
physical book or magazine
– The “undo" feature on some computer applications
Design Patterns – Eran Toch
31November 2003
AgendaAgenda
• What is a Design Pattern?
• Structural Patterns
• Behavioral Patterns
• Creational Patterns
• Human Interaction Patterns
• Summary
Design Patterns – Eran Toch
32November 2003
SummarySummary
• Patterns learned:
– Composite, Strategy, Singleton, Go Back to a Safe
Place.
• Advantages of Design Patterns:
– They capture expertise and make it accessible to non-
experts.
– Their names collectively form a vocabulary that helps
developers communicate better.
– They help people understand a system more quickly
when it is documented with the patterns it uses.
Design Patterns – Eran Toch
33November 2003
ReferencesReferences
• Design Patterns: Elements of Reusable Object-Oriented
Software, Gamma E. et el., 1995, Addison-Wesley.
• A course from Bob Tarr from UMBC University
http://www.research.umbc.edu/~tarr/dp/fall00/cs491.html
• The Design Patterns Java Companion, James W. Cooper (an
online version of the book)
http://www.patterndepot.com/put/8/JavaPatterns.htm
• A Site dedicated to Design Patterns by Vince Huston
http://home.earthlink.net/~huston2/dp/patterns.html
• Seven Habits of Successful Pattern Writers, John Vlissides
http://hillside.net/patterns/papers/7habits.html
• COMMON GROUND: A Pattern Language for Human-
Computer Interface Design, Jenifer Tidwell,
http://www.mit.edu/~jtidwell/common_ground_onefile.html
Design Patterns – Eran Toch
34November 2003
Doesn’t it go too far?Doesn’t it go too far?
• Taken from Vince Huston’s site about Design
Patterns:
Design Patterns – Eran Toch
Methodologies in Information System Development
Thanks!Thanks!

Mais conteúdo relacionado

Destaque

SW development process and the leading indicator
SW development process and the leading indicatorSW development process and the leading indicator
SW development process and the leading indicatorJean Pаoli
 
Cohr managing stress training
Cohr managing stress trainingCohr managing stress training
Cohr managing stress trainingJean Pаoli
 
Effective prioritization & zbb
Effective prioritization & zbbEffective prioritization & zbb
Effective prioritization & zbbJean Pаoli
 
PMC post implementation review
PMC post implementation reviewPMC post implementation review
PMC post implementation reviewJean Pаoli
 
Diversity in thinking styles (part 1)
Diversity in thinking styles (part 1)Diversity in thinking styles (part 1)
Diversity in thinking styles (part 1)Jean Pаoli
 

Destaque (8)

SW development process and the leading indicator
SW development process and the leading indicatorSW development process and the leading indicator
SW development process and the leading indicator
 
Cohr managing stress training
Cohr managing stress trainingCohr managing stress training
Cohr managing stress training
 
Effective prioritization & zbb
Effective prioritization & zbbEffective prioritization & zbb
Effective prioritization & zbb
 
PMC post implementation review
PMC post implementation reviewPMC post implementation review
PMC post implementation review
 
PMP study TTT
PMP study TTTPMP study TTT
PMP study TTT
 
Diversity in thinking styles (part 1)
Diversity in thinking styles (part 1)Diversity in thinking styles (part 1)
Diversity in thinking styles (part 1)
 
Pmp study: time
Pmp study: timePmp study: time
Pmp study: time
 
Unified process
Unified processUnified process
Unified process
 

Semelhante a Design patterns

CS6201 Software Reuse - Design Patterns
CS6201 Software Reuse - Design PatternsCS6201 Software Reuse - Design Patterns
CS6201 Software Reuse - Design PatternsKwangshin Oh
 
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...Anil Sharma
 
CEN6016-Chapter1.ppt
CEN6016-Chapter1.pptCEN6016-Chapter1.ppt
CEN6016-Chapter1.pptNelsonYanes6
 
System architecture infosheet
System architecture infosheetSystem architecture infosheet
System architecture infosheetjeanrummy
 
Interaction design patterns
Interaction design patternsInteraction design patterns
Interaction design patternsDCU_MPIUA
 
Object-Oriented Analysis and Design
Object-Oriented Analysis and DesignObject-Oriented Analysis and Design
Object-Oriented Analysis and DesignRiazAhmad786
 
Module 2 design patterns-2
Module 2   design patterns-2Module 2   design patterns-2
Module 2 design patterns-2Ankit Dubey
 
Design pattern in android
Design pattern in androidDesign pattern in android
Design pattern in androidJay Kumarr
 
1 modeling concepts
1 modeling concepts1 modeling concepts
1 modeling conceptsMinal Maniar
 
Design Pattern - Introduction
Design Pattern - IntroductionDesign Pattern - Introduction
Design Pattern - IntroductionMudasir Qazi
 
Conversational AI from an Information Retrieval Perspective: Remaining Challe...
Conversational AI from an Information Retrieval Perspective: Remaining Challe...Conversational AI from an Information Retrieval Perspective: Remaining Challe...
Conversational AI from an Information Retrieval Perspective: Remaining Challe...krisztianbalog
 
Usability and User Experience Training Seminar
Usability and User Experience Training SeminarUsability and User Experience Training Seminar
Usability and User Experience Training Seminarlabecvar
 
Patterns - More than Mere Stencils
Patterns - More than Mere StencilsPatterns - More than Mere Stencils
Patterns - More than Mere StencilsAnthony Draffin
 
Knowledge mechanisms in IEEE 1471/ISO 42010
Knowledge mechanisms in IEEE 1471/ISO 42010Knowledge mechanisms in IEEE 1471/ISO 42010
Knowledge mechanisms in IEEE 1471/ISO 42010Rich Hilliard
 

Semelhante a Design patterns (20)

CS6201 Software Reuse - Design Patterns
CS6201 Software Reuse - Design PatternsCS6201 Software Reuse - Design Patterns
CS6201 Software Reuse - Design Patterns
 
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
 
Design Patterns.ppt
Design Patterns.pptDesign Patterns.ppt
Design Patterns.ppt
 
CEN6016-Chapter1.ppt
CEN6016-Chapter1.pptCEN6016-Chapter1.ppt
CEN6016-Chapter1.ppt
 
CEN6016-Chapter1.ppt
CEN6016-Chapter1.pptCEN6016-Chapter1.ppt
CEN6016-Chapter1.ppt
 
System architecture infosheet
System architecture infosheetSystem architecture infosheet
System architecture infosheet
 
Patterns Overview
Patterns OverviewPatterns Overview
Patterns Overview
 
Software Design
Software DesignSoftware Design
Software Design
 
5-CEN6016-Chapter1.ppt
5-CEN6016-Chapter1.ppt5-CEN6016-Chapter1.ppt
5-CEN6016-Chapter1.ppt
 
Interaction design patterns
Interaction design patternsInteraction design patterns
Interaction design patterns
 
Designpattern
DesignpatternDesignpattern
Designpattern
 
Object-Oriented Analysis and Design
Object-Oriented Analysis and DesignObject-Oriented Analysis and Design
Object-Oriented Analysis and Design
 
Module 2 design patterns-2
Module 2   design patterns-2Module 2   design patterns-2
Module 2 design patterns-2
 
Design pattern in android
Design pattern in androidDesign pattern in android
Design pattern in android
 
1 modeling concepts
1 modeling concepts1 modeling concepts
1 modeling concepts
 
Design Pattern - Introduction
Design Pattern - IntroductionDesign Pattern - Introduction
Design Pattern - Introduction
 
Conversational AI from an Information Retrieval Perspective: Remaining Challe...
Conversational AI from an Information Retrieval Perspective: Remaining Challe...Conversational AI from an Information Retrieval Perspective: Remaining Challe...
Conversational AI from an Information Retrieval Perspective: Remaining Challe...
 
Usability and User Experience Training Seminar
Usability and User Experience Training SeminarUsability and User Experience Training Seminar
Usability and User Experience Training Seminar
 
Patterns - More than Mere Stencils
Patterns - More than Mere StencilsPatterns - More than Mere Stencils
Patterns - More than Mere Stencils
 
Knowledge mechanisms in IEEE 1471/ISO 42010
Knowledge mechanisms in IEEE 1471/ISO 42010Knowledge mechanisms in IEEE 1471/ISO 42010
Knowledge mechanisms in IEEE 1471/ISO 42010
 

Último

办理(麻省罗威尔毕业证书)美国麻省大学罗威尔校区毕业证成绩单原版一比一
办理(麻省罗威尔毕业证书)美国麻省大学罗威尔校区毕业证成绩单原版一比一办理(麻省罗威尔毕业证书)美国麻省大学罗威尔校区毕业证成绩单原版一比一
办理(麻省罗威尔毕业证书)美国麻省大学罗威尔校区毕业证成绩单原版一比一diploma 1
 
Untitled presedddddddddddddddddntation (1).pptx
Untitled presedddddddddddddddddntation (1).pptxUntitled presedddddddddddddddddntation (1).pptx
Untitled presedddddddddddddddddntation (1).pptxmapanig881
 
MT. Marseille an Archipelago. Strategies for Integrating Residential Communit...
MT. Marseille an Archipelago. Strategies for Integrating Residential Communit...MT. Marseille an Archipelago. Strategies for Integrating Residential Communit...
MT. Marseille an Archipelago. Strategies for Integrating Residential Communit...katerynaivanenko1
 
2024新版美国旧金山州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
2024新版美国旧金山州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree2024新版美国旧金山州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
2024新版美国旧金山州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degreeyuu sss
 
专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degreeyuu sss
 
(办理学位证)约克圣约翰大学毕业证,KCL成绩单原版一比一
(办理学位证)约克圣约翰大学毕业证,KCL成绩单原版一比一(办理学位证)约克圣约翰大学毕业证,KCL成绩单原版一比一
(办理学位证)约克圣约翰大学毕业证,KCL成绩单原版一比一D SSS
 
FiveHypotheses_UIDMasterclass_18April2024.pdf
FiveHypotheses_UIDMasterclass_18April2024.pdfFiveHypotheses_UIDMasterclass_18April2024.pdf
FiveHypotheses_UIDMasterclass_18April2024.pdfShivakumar Viswanathan
 
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...Rishabh Aryan
 
How to Empower the future of UX Design with Gen AI
How to Empower the future of UX Design with Gen AIHow to Empower the future of UX Design with Gen AI
How to Empower the future of UX Design with Gen AIyuj
 
shot list for my tv series two steps back
shot list for my tv series two steps backshot list for my tv series two steps back
shot list for my tv series two steps back17lcow074
 
定制(CQU文凭证书)中央昆士兰大学毕业证成绩单原版一比一
定制(CQU文凭证书)中央昆士兰大学毕业证成绩单原版一比一定制(CQU文凭证书)中央昆士兰大学毕业证成绩单原版一比一
定制(CQU文凭证书)中央昆士兰大学毕业证成绩单原版一比一Fi ss
 
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一Fi L
 
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,Aginakm1
 
原版1:1定制堪培拉大学毕业证(UC毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制堪培拉大学毕业证(UC毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制堪培拉大学毕业证(UC毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制堪培拉大学毕业证(UC毕业证)#文凭成绩单#真实留信学历认证永久存档208367051
 
group_15_empirya_p1projectIndustrial.pdf
group_15_empirya_p1projectIndustrial.pdfgroup_15_empirya_p1projectIndustrial.pdf
group_15_empirya_p1projectIndustrial.pdfneelspinoy
 
办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一
办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一
办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一z xss
 
(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一
(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一
(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一Fi sss
 
办理(USYD毕业证书)澳洲悉尼大学毕业证成绩单原版一比一
办理(USYD毕业证书)澳洲悉尼大学毕业证成绩单原版一比一办理(USYD毕业证书)澳洲悉尼大学毕业证成绩单原版一比一
办理(USYD毕业证书)澳洲悉尼大学毕业证成绩单原版一比一diploma 1
 
Pharmaceutical Packaging for the elderly.pdf
Pharmaceutical Packaging for the elderly.pdfPharmaceutical Packaging for the elderly.pdf
Pharmaceutical Packaging for the elderly.pdfAayushChavan5
 
Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Rndexperts
 

Último (20)

办理(麻省罗威尔毕业证书)美国麻省大学罗威尔校区毕业证成绩单原版一比一
办理(麻省罗威尔毕业证书)美国麻省大学罗威尔校区毕业证成绩单原版一比一办理(麻省罗威尔毕业证书)美国麻省大学罗威尔校区毕业证成绩单原版一比一
办理(麻省罗威尔毕业证书)美国麻省大学罗威尔校区毕业证成绩单原版一比一
 
Untitled presedddddddddddddddddntation (1).pptx
Untitled presedddddddddddddddddntation (1).pptxUntitled presedddddddddddddddddntation (1).pptx
Untitled presedddddddddddddddddntation (1).pptx
 
MT. Marseille an Archipelago. Strategies for Integrating Residential Communit...
MT. Marseille an Archipelago. Strategies for Integrating Residential Communit...MT. Marseille an Archipelago. Strategies for Integrating Residential Communit...
MT. Marseille an Archipelago. Strategies for Integrating Residential Communit...
 
2024新版美国旧金山州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
2024新版美国旧金山州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree2024新版美国旧金山州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
2024新版美国旧金山州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
 
专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
 
(办理学位证)约克圣约翰大学毕业证,KCL成绩单原版一比一
(办理学位证)约克圣约翰大学毕业证,KCL成绩单原版一比一(办理学位证)约克圣约翰大学毕业证,KCL成绩单原版一比一
(办理学位证)约克圣约翰大学毕业证,KCL成绩单原版一比一
 
FiveHypotheses_UIDMasterclass_18April2024.pdf
FiveHypotheses_UIDMasterclass_18April2024.pdfFiveHypotheses_UIDMasterclass_18April2024.pdf
FiveHypotheses_UIDMasterclass_18April2024.pdf
 
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
 
How to Empower the future of UX Design with Gen AI
How to Empower the future of UX Design with Gen AIHow to Empower the future of UX Design with Gen AI
How to Empower the future of UX Design with Gen AI
 
shot list for my tv series two steps back
shot list for my tv series two steps backshot list for my tv series two steps back
shot list for my tv series two steps back
 
定制(CQU文凭证书)中央昆士兰大学毕业证成绩单原版一比一
定制(CQU文凭证书)中央昆士兰大学毕业证成绩单原版一比一定制(CQU文凭证书)中央昆士兰大学毕业证成绩单原版一比一
定制(CQU文凭证书)中央昆士兰大学毕业证成绩单原版一比一
 
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一
 
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,
 
原版1:1定制堪培拉大学毕业证(UC毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制堪培拉大学毕业证(UC毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制堪培拉大学毕业证(UC毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制堪培拉大学毕业证(UC毕业证)#文凭成绩单#真实留信学历认证永久存档
 
group_15_empirya_p1projectIndustrial.pdf
group_15_empirya_p1projectIndustrial.pdfgroup_15_empirya_p1projectIndustrial.pdf
group_15_empirya_p1projectIndustrial.pdf
 
办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一
办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一
办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一
 
(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一
(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一
(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一
 
办理(USYD毕业证书)澳洲悉尼大学毕业证成绩单原版一比一
办理(USYD毕业证书)澳洲悉尼大学毕业证成绩单原版一比一办理(USYD毕业证书)澳洲悉尼大学毕业证成绩单原版一比一
办理(USYD毕业证书)澳洲悉尼大学毕业证成绩单原版一比一
 
Pharmaceutical Packaging for the elderly.pdf
Pharmaceutical Packaging for the elderly.pdfPharmaceutical Packaging for the elderly.pdf
Pharmaceutical Packaging for the elderly.pdf
 
Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025
 

Design patterns

  • 1. Design Patterns – Eran Toch Methodologies in Information System Development Design Patterns:Design Patterns: Talking in the Design LanguageTalking in the Design Language Eran Toch Methodologies in the Development of Information Systems
  • 2. Design Patterns – Eran Toch 2November 2003 AgendaAgenda • What is a Design Pattern? • Structural Patterns – The Composite Pattern • Behavioral Patterns – The Strategy Pattern • Creational Patterns – The Singleton Pattern • Human Interaction Patterns – Go Back to a Safe Place • Summary
  • 3. Design Patterns – Eran Toch 3November 2003 What is a Design Pattern?What is a Design Pattern? In Short, a solution for a typical problem “a description of a recurrent problem and of the core of possible solutions.“
  • 4. Design Patterns – Eran Toch 4November 2003 Why do we need them?Why do we need them? • Problems are not always unique. Reusing existing experience might be proved useful. • We need a common language to describe problems and solutions. • The Design of Object-Oriented systems limits the scope of problems and solutions we can talk about
  • 5. Design Patterns – Eran Toch 5November 2003 History of Design PatternsHistory of Design Patterns Christopher Alexander A Pattern Language: Towns, Buildings Construction 1970’ 1995’ 2000’ Architecture Object Oriented Software Design Other Areas: HCI, Organizational Behavior… Gang of Four (GoF) Design Patterns: Elements of Reusable Object-Oriented Software Many Authors
  • 6. Design Patterns – Eran Toch 6November 2003 Structure of a design patternStructure of a design pattern • Pattern Name and Classification • Intent – a Short statement about what the pattern does • Motivation – A scenario that illustrates where the pattern would be useful • Applicability – Situations where the pattern can be used
  • 7. Design Patterns – Eran Toch 7November 2003 Structure of a design pattern – cont’dStructure of a design pattern – cont’d • Structure – A graphical representation of the pattern • Participants – The classes and objects participating in the pattern • Collaborations – How to do the participants interact to carry out their responsibilities? • Consequences – What are the pros and cons of using the pattern? • Implementation – Hints and techniques for implementing the pattern
  • 8. Design Patterns – Eran Toch 8November 2003 Classification of patternsClassification of patterns • Structural – Composite*, Decorator, Façade, Adapter… • Behavioral – Strategy*, Command, Observer, Chain of Responsibilities… • Creational – Singleton*, Abstract Factory, Factory Method… • Other – User interface Patterns • Go Back to a Safe Place
  • 9. Design Patterns – Eran Toch 9November 2003 AgendaAgenda • What is a Design Pattern? • Structural Patterns • Behavioral Patterns • Creational Patterns • Human Interaction Patterns • Summary
  • 10. Design Patterns – Eran Toch 10November 2003 The Composite PatternThe Composite Pattern • Intent: – Compose objects into tree structures to represent part-whole hierarchies. – Composite lets clients treat individual objects and compositions of objects uniformly. This is called recursive composition.
  • 11. Design Patterns – Eran Toch 11November 2003 MotivationMotivation When Processing the hierarchal collection, we need to query the type of the object (composite or primitive) and act differently Diagram reference: Design Patterns [Gof]
  • 12. Design Patterns – Eran Toch 12November 2003 Composite: ApplicabilityComposite: Applicability • Use the Composite pattern when: – You want to represent part-whole hierarchies of objects. – You want clients to be able to ignore the difference between compositions of objects and individual objects. Clients will treat all objects in the composite structure uniformly.
  • 13. Design Patterns – Eran Toch 13November 2003 Composite: StructureComposite: Structure • Define an abstract base class that specifies the uniform behavior. • Subclass the Primitive and Composite classes of the Component class. Diagram reference: Design Patterns [Gof]
  • 14. Design Patterns – Eran Toch 14November 2003 Composite: ConsequencesComposite: Consequences • Benefits – It makes it easy to add new kinds of components – It makes clients simpler, since they do not have to know if they are dealing with a leaf or a composite component • Liabilities – It makes it harder to restrict the type of components of a composite
  • 15. Design Patterns – Eran Toch 15November 2003 Composite: Known UsesComposite: Known Uses 1. A GUI system has window objects which can contain various GUI components (widgets) such as, buttons and text areas. A window can also contain widget container objects which can hold other widgets. Concrete examples: Java Swing, MFC 2. Folder based file system 3. Arithmetic expressions
  • 16. Design Patterns – Eran Toch 16November 2003 AgendaAgenda • What is a Design Pattern? • Structural Patterns • Behavioral Patterns • Creational Patterns • Human Interaction Patterns • Summary
  • 17. Design Patterns – Eran Toch 17November 2003 The Strategy PatternThe Strategy Pattern • Intent: – Define a family of algorithms, encapsulate each one, and make them interchangeable. – Strategy lets the algorithm vary independently from clients that use it.
  • 18. Design Patterns – Eran Toch 18November 2003 Strategy: MotivationStrategy: Motivation The client wants to use the algorithm without knowing which one to use in advance. We want to add new algorithms without changing the client class.
  • 19. Design Patterns – Eran Toch 19November 2003 Strategy: StructureStrategy: Structure • Encapsulate the behavior of the context class in a separate algorithm class. • The context class keeps a reference to the algorithm class and passes on the messages. • The algorithm class can be sub-classed to support multiple algorithms.
  • 20. Design Patterns – Eran Toch 20November 2003 Strategy: ConsequencesStrategy: Consequences • Benefits – Provides an alternative to subclassing the Context class to get a variety of algorithms or behaviors – Keeps the client clean from large conditional statements – Provides a choice of implementations for the same behavior • Liabilities – Increases the number of objects – All algorithms must use the same Strategy interface – We still need conditional statements!
  • 21. Design Patterns – Eran Toch 21November 2003 Strategy: Known UsesStrategy: Known Uses • QSIA Learning System • Layout Manager in Java Swing • Sorting algorithms, memory allocation algorithms and more…
  • 22. Design Patterns – Eran Toch 22November 2003 AgendaAgenda • What is a Design Pattern? • Structural Patterns • Behavioral Patterns • Creational Patterns • Human Interaction Patterns • Summary
  • 23. Design Patterns – Eran Toch 23November 2003 The Singleton PatternThe Singleton Pattern • Intent. – Ensure a class only has one instance, and provide a global point of access to it. • Motivation. – Sometimes, an application needs one, and only one, instance of an object. For example, we want just one window manager. Or just one factory for a family of products. – We need to have that one instance easily accessible. – And we want to ensure that additional instances of the class can not be created.
  • 24. Design Patterns – Eran Toch 24November 2003 Singleton: StructureSingleton: Structure • Declare the single instance as a private static data member. • Provide a public static member function that encapsulates all initialization code, and provides access to the instance.
  • 25. Design Patterns – Eran Toch 25November 2003 Singleton: Example CodeSingleton: Example Code public class Singleton { // The private reference to the one and only instance. private static Singleton uniqueInstance = null; // An instance attribute. private int data = 0; /** * Returns a reference to the single instance. * Creates the instance if it does not yet exist. */ public static Singleton instance() { if(uniqueInstance == null) uniqueInstance = new Singleton(); return uniqueInstance; } /** * The Singleton Constructor. Note that it is private! * No client can instantiate a Singleton object! */ private Singleton() {} }
  • 26. Design Patterns – Eran Toch 26November 2003 Singleton: Example Code – cont’dSingleton: Example Code – cont’d public class TestSingleton { public static void main(String args[]) { // Get a reference to the single instance of Singleton. Singleton s = Singleton.instance(); // Set the data value. s.setData(34); System.out.println("First reference: " + s); System.out.println("Singleton data value is: " + s.getData()); // Get another reference to the Singleton. // Is it the same object? s = null; s = Singleton.instance(); System.out.println("nSecond reference: " + s); System.out.println("Singleton data value is: " + s.getData()); } } What will be the output?
  • 27. Design Patterns – Eran Toch 27November 2003 AgendaAgenda • What is a Design Pattern? • Structural Patterns • Behavioral Patterns • Creational Patterns • Human Interaction Patterns • Summary
  • 28. Design Patterns – Eran Toch 28November 2003 Human Interaction PatternsHuman Interaction Patterns • A Pattern language to describe human interaction situations • Examples: – Go Back to a Safe Place – Form – Control Panel – WYSIWYG Editor – Hierarchical Set – Map of Navigable Spaces – More…
  • 29. Design Patterns – Eran Toch 29November 2003 Go Back to a Safe PlaceGo Back to a Safe Place • Problem: – How can the artifact make navigation easy, convenient, and psychologically safe for the user? • Forces: – A user may forget where they were, if they stop using the artifact while they're in the middle of something and don't get back to it for a while. – If the user gets into a space or a state that they don't want to be in, they will want to get out of it in a safe and predictable way. – The user is more likely to explore an artifact if they are assured that they can easily get out of an undesired state or space; that assurance engenders a feeling of security.
  • 30. Design Patterns – Eran Toch 30November 2003 Go Back to a Safe PlaceGo Back to a Safe Place • Solution: – Provide a way to go back to a checkpoint of the user's choice. • Examples: – The "Home" button on a Web browser – Turning back to the beginning of a chapter in a physical book or magazine – The “undo" feature on some computer applications
  • 31. Design Patterns – Eran Toch 31November 2003 AgendaAgenda • What is a Design Pattern? • Structural Patterns • Behavioral Patterns • Creational Patterns • Human Interaction Patterns • Summary
  • 32. Design Patterns – Eran Toch 32November 2003 SummarySummary • Patterns learned: – Composite, Strategy, Singleton, Go Back to a Safe Place. • Advantages of Design Patterns: – They capture expertise and make it accessible to non- experts. – Their names collectively form a vocabulary that helps developers communicate better. – They help people understand a system more quickly when it is documented with the patterns it uses.
  • 33. Design Patterns – Eran Toch 33November 2003 ReferencesReferences • Design Patterns: Elements of Reusable Object-Oriented Software, Gamma E. et el., 1995, Addison-Wesley. • A course from Bob Tarr from UMBC University http://www.research.umbc.edu/~tarr/dp/fall00/cs491.html • The Design Patterns Java Companion, James W. Cooper (an online version of the book) http://www.patterndepot.com/put/8/JavaPatterns.htm • A Site dedicated to Design Patterns by Vince Huston http://home.earthlink.net/~huston2/dp/patterns.html • Seven Habits of Successful Pattern Writers, John Vlissides http://hillside.net/patterns/papers/7habits.html • COMMON GROUND: A Pattern Language for Human- Computer Interface Design, Jenifer Tidwell, http://www.mit.edu/~jtidwell/common_ground_onefile.html
  • 34. Design Patterns – Eran Toch 34November 2003 Doesn’t it go too far?Doesn’t it go too far? • Taken from Vince Huston’s site about Design Patterns:
  • 35. Design Patterns – Eran Toch Methodologies in Information System Development Thanks!Thanks!