BYT 2004 Design Patterns

background image

Design Patterns

Design Patterns

By Mareck Kortylevitch and

By Mareck Kortylevitch and

Piotreck Ratchinsky

Piotreck Ratchinsky

background image

What is Design Pattern?

What is Design Pattern?

Recurring solution to known

Recurring solution to known

problems

problems

Workaround to problems

Workaround to problems

that arise when developing

that arise when developing

software within a particular

software within a particular

context

context

background image

History

History

Precursor of design pattern

Precursor of design pattern

was Christopher Alexander

was Christopher Alexander

First Design Patterns used in

First Design Patterns used in

architecture

architecture

background image

Why to use DP?

Why to use DP?

Help you learn from others'

Help you learn from others'

successes instead of your

successes instead of your

own failures

own failures

Provide a communication

Provide a communication

platform concerning

platform concerning

elegant, reusable solutions

elegant, reusable solutions

to commonly encountered

to commonly encountered

programming challenges

programming challenges

background image

Why to use...continuation

Why to use...continuation

Enforce using techspeak

Enforce using techspeak

Isolate changes in the code

Isolate changes in the code

Design and interaction of

Design and interaction of

objects

objects

background image

Design Patterns Examples

Design Patterns Examples

Facade

Facade

Adapter

Adapter

Singleton

Singleton

Abstract Factory

Abstract Factory

Bridge

Bridge

background image

Facade - definition

Facade - definition

Provide a unified interface

Provide a unified interface

to a set of interfaces in a

to a set of interfaces in a

subsystem. Façade defines a

subsystem. Façade defines a

higher-level interface that

higher-level interface that

makes the subsystem easier

makes the subsystem easier

to use.

to use.

background image

Facade -

Facade -

UML class

UML class

diagram

diagram

background image

Facade - example

Facade - example

Facade

Facade

  

  

(MortgageApplication)

(MortgageApplication)

knows which subsystem classes are

knows which subsystem classes are

responsible for a request.

responsible for a request.

delegates client requests to

delegates client requests to

appropriate subsystem objects.

appropriate subsystem objects.

Subsystem classes

Subsystem classes

  

  

(Bank,

(Bank,

Credit, Loan)

Credit, Loan)

implement subsystem functionality.

implement subsystem functionality.

handle work assigned by the Facade

handle work assigned by the Facade

object.

object.

have no knowledge of the facade

have no knowledge of the facade

and keep no reference to it.

and keep no reference to it.

background image

Facade – example diagram

Facade – example diagram

Facade

Subsystems

Loan

Credit

Bank

background image

Singleton - definition

Singleton - definition

ensure a class has only one

ensure a class has only one

instance and provide a global

instance and provide a global

point of access to it.

point of access to it.

defines an Instance operation

defines an Instance operation

that lets clients access its unique

that lets clients access its unique

instance. Instance() is a class

instance. Instance() is a class

operation.

operation.

responsible for creating and

responsible for creating and

maintaining its own unique

maintaining its own unique

instance.

instance.

background image

Singleton – UML

Singleton – UML

Singleton

-Singleton()

+static
getInstance():Singleton

-static Singleton: instance


Document Outline


Wyszukiwarka

Podobne podstrony:
Learning Python Design Patterns Gennadiy Zlobin signed
BYT 2004 Quality system
BYT 2004 Projekt informatyczny podstawowe zagadnienia
BYT 2004 Cykl zycia oproprogramowania
BYT 2004 Work organization methods and schemes
BYT 2004 Roles in programming project
BYT 2004 Jakosc w projekcie informatycznym v1
BYT 2004 Zarzadzanie komunikacja w projekcie
(Oracle) J2EE Design Patterns
BYT 2004 Role w zespole programistycznym
BYT 2004 Software Testing
BYT 2004 Strukturalne wzorce projektowe
BYT 2004 Communication in project team
BYT 2004 The concept of a project life cycle
BYT 2004 Szacowanie zlozonosci oprogramowania v2
BYT 2004 Jakosc w projekcie informatycznym v2
J2EE & EJB Design Patterns Craig Larman
16352479 Software Design Patterns Made Simple
Design Patterns Elements of Reusable Object Oriented Software Examples

więcej podobnych podstron