Architectural DesignPatterns
Architectural DesignPatterns
Architectural DesignPatterns
&
Patterns
Members:
Abdul Manan 1420 Areeba Riaz 1439
Junaid Majeed 1428 Allah Ditta 1419
Architectural Pattern
• An architectural pattern is a general, reusable solution to a
commonly occurring problem in software architecture.
• Architectural patterns are similar to software design pattern but
have a broader scope.
• Design patterns are medium-scale tactics that flesh out some of the
structure and behavior of entities and their relationships.
• Architectural patterns are high-level strategies that concerns large-
scale components, the global properties and mechanisms of a
system.
• The architectural patterns address various issues in software
engineering, such as computer hardware performance
limitations, high availability and minimization of a business risk.
Categories of architectural patterns
Architectural patterns 3
Architectural Pattern - Layers
Architectural patterns 4
Architectural Pattern - Pipes and
filters
• System process a stream of data.
• Each processing step is encapsulated in a filter component.
• Examples
• A shell in an operating system, like Linux/UNIX or MS-DOS
• find “a” data.txt | sort | more
• Find all lines with “a” in data.txt | sort the lines | show the lines, one screen at a
time
• Compilation of a Java program
• Lexical analysis | syntax analysis | semantic analysis | code generation
• Reuse of filter components
5
Distributed systems
6
Architectural Pattern - Broker
• Coordinates communication between distributed components
• Broker features
• Locate servers
• Forward messages
• Examples
• CORBA
• Common Object Request Broker Architecture
• an architecture that enables pieces of programs, called objects, to
communicate with one another regardless of what programming
language they were written in or what operating system they're running on.
CORBA was developed by an industry consortium known as the Object
Management Group (OMG).
• Some chat / messenger systems
7
Broker, consequences
• Benefits
• Location transparency
• Clients do not need to know where servers are.
• Servers can be moved to other computers.
• Changeability and extensibility
• Servers can be changed
• Keep the same interface
• Reusability
• Components can be reused in other application
• Liabilities
• Efficiency
• Fault tolerance
• Broker is not working => nothing is working
8
Architectural Pattern
– Master-Slave
• Divide and conquer
• Master functions
• Split work
• Call slaves
• Combine results
• Examples
• Parallel processing
• Fault tolerance
• Computational accuracy
9
Master-Slave, consequences
• Benefits
• Faster computation
• Split the problem over threads and machines.
• Robustness
• Slaves can be duplicated
10
Interactive systems
• Interaction with the user
• Through graphical user interfaces
• System responds to events (user inputs)
• Functional core of the system must be kept independent
of the user interface
• You must be able to add a new user interface to the system.
• A single system can have many user interfaces
• PC interface
• Web interface
• Mobil phone interface
11
Interactive System Architectural
Patterns
• There are the followings architectural patterns:
• MVC – Model View Controller
• MVP – Model View Presenter
• MVVM – Model View View-Model
MVC - Model View Controller
• Model View Controller or MVC as it is popularly called, is a
design pattern for developing web applications. A Model View
Controller pattern is made up of the following three parts:
• Model - The lowest level of the pattern which is responsible for
maintaining data.
• View - This is responsible for displaying all or a portion of the data
to the user.
• Controller - Software Code that controls the interactions between the
Model and View.
• MVC is popular as it separates the application logic from the
user interface layer and supports separation of concerns.
The Model
• The model is responsible for managing the data of the
application.
• It responds to the request from the view and it also responds
to instructions from the controller to update itself.
The View
• A presentation of data in a particular format, produced by
a controller's decision to present the data.
• They are script based templating systems like JSP, ASP,
PHP and very easy to integrate with AJAX technology.
The Controller
• The controller is responsible for responding to user input and
perform interactions on the data model objects.
• The controller receives the input, it validates the input and then
performs the business operation that modifies the state of the
data model.
• Struts2 is a MVC based framework.
• Apache Struts 2 is an open-source web application framework
for developing Java EE web applications. It uses and extends
the Java Servlet API to encourage developers to adopt a model–
view–controller (MVC) architecture
Implementation