Week 13-Software Architecture and Patterns
Week 13-Software Architecture and Patterns
Design Patterns
• Architectural pattern is like a blue print and design pattern is actual implementation.
• Architecture is base which everything else adhere to and design pattern is a way to structure
classes to solve common problems.
• Architecture pattern: how components should behave and communicate in the system, set the
physical location of components and finally choose the tools in order to create components.
• Design pattern: while architecture deals more with the wide picture, design should drill down into
the details relating to implementing certain components. Designing of components end up with
classes, interfaces, abstract classes and other OO feature in order to fulfil the given component
tasks.
Architecture
Design Patterns
Patterns
-Gangs of Four (GoF) Design Patterns
1. Layered pattern Creational- The design patterns that deal with the creation of an
2. Client-server object. e.g Singleton, Factory, Abstract Factory, Builder, and
pattern Prototype.
3. Master-slave Structural- The design patterns in this category deals with how
pattern different objects and classes can be combined together to make a
4. Pipe-filter pattern bigger structure such as Inheritance and Composition. e.g. Adapter,
Composite, Proxy, Flyweight,Facade, Bridge, and Decorator
5. Model-view-
controller pattern Behavioral-This type of design patterns provide solution for the
better interaction between objects, how to provide lose coupling, and
flexibility to extend easily in future. E.g. Template Method,
Mediator,Chain of Responsibility, Observer, Strategy, Command etc.
Architectural Patterns
1. Layered pattern
• This pattern is also known as n-tier architecture pattern.
• It can be used to structure programs that can be decomposed into
groups of subtasks, each of which is at a particular level of abstraction.
• Each layer provides services to the next higher layer.
Usage
• General desktop applications.
• E commerce web applications.
Common layers of a general information system
Usage
• In database replication, the master database is regarded as the authoritative
source, and the slave databases are synchronized to it.
• Master slave is a way to optimise the I/O in your
application other then using caching.
Usage
• Compilers. The consecutive filters perform lexical analysis, parsing, semantic analysis, and code
generation.
• When data is produced and sent from the producer ‘PUMP’, it goes through the pipes and filters
and arrives at the destination ‘SINK’
Usage
• Architecture for World Wide Web applications in major programming languages.
Generic MVC Sequence Diagram: Example