































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
































1
Sharif University of Technology
Patterns in Software Engineering – Lecture 8
From Mud to Structure
Layers,
Pipes and Filters, and
Blackboard
Distributed Systems
Broker; also
Microkernel and
Pipes and Filters
t
ti
t
nteractive Systems
Support the structuring of systems that feature human-computer interaction.
Model-View-Controller and
Presentation-Abstraction-Control
Adaptable Systems
Support extension of applications and their adaptation to evolving technology andchanging functional requirements.changing functional requirements.
Reflection and
Microkernel
2
Sharif University of Technology
Patterns in Software Engineering – Lecture 8
Divides an interactive application into three components.
The
Model
contains the core functionality and data.
Views
display information to the user.
Controllers
handle user input.
Controllers
handle user input.
A change-propagation mechanism ensures consistency between the user interface(views and controllers) and the model.
4
Sharif University of Technology
Patterns in Software Engineering – Lecture 8
Context
-
Interactive applications with a flexible human
-computer interface
Context
Interactive
applications with a flexible human computer interface.
Problem
-
Forces are as follows:
Problem
Forces
are as follows:
The same information is presented differently in different windows, for example,in a bar or pie chart.
The display and behavior of the application must reflect data manipulationsimmediately.
Changes to the user interface should be easy, and even possible at run-time.
Supporting different 'look and feel' standards or porting the user interfaceshould not affect code in the core of the application.
5
Sharif University of Technology
Patterns in Software Engineering – Lecture 8
Model-View-Controller: Structure
View
components present information to the user.
Each view defines an update procedure that is activated by the change propagationmechanism and retrieves data from the model.
Each view creates a suitable controller.
Views often offer functionality that allows controllers to manipulate the display.
Controller
components accept user input as events.
If the behavior of a controller depends on the state of the model, the controller
p
,
registers itself with the model and implements an update operation.
7
Sharif University of Technology
Patterns in Software Engineering – Lecture 8
8
Sharif University of Technology
Patterns in Software Engineering – Lecture 8
Scenario II
the MVC triad is initialized
the
MVC triad is initialized.
10
Sharif University of Technology
Patterns in Software Engineering – Lecture 8
Multiple views of the same model
9
Multiple
views of the same model
9
Synchronized views
9
'Pluggable' views and controllers
9
Exchangeability of 'look and feel'
g
y
9
Framework potential
8
Increased complexity
8
Potential for excessive number of updates
8
Potential for excessive number of updates
8
Close couplings
11
Sharif University of Technology
Patterns in Software Engineering – Lecture 8
Interactive Systems: Presentation-Abstraction-Control
y
Context -
Development of an interactive application with the
help of agents
Problem
Forces are as follows:
Problem
-
Forces
are as follows:
Agents often maintain their own state and data.
Interactive agents provide their own user interface.
Systems evolve over time.
13
Sharif University of Technology
Patterns in Software Engineering – Lecture 8
Interactive application is structured as a tree
-like hierarchy of PAC agents.
Interactive application is structured as a tree like hierarchy of PAC agents.
There should be one top-level agent, several intermediate level agents, andeven more bottom-level agents.
Every agent consists of three components:
and
Every agent consists of three components:
Th
T
l^
l PAC
t
Th
e
Top-level PAC agent:
provides the functional core of the system;
includes parts of the user interface that cannot be assigned to subtasks.
p
g
Bottom-level PAC agents:
represent self-contained semantic concepts on which users of the system canact
such as spreadsheets and charts
act, such as spreadsheets and charts.
Intermediate-level PAC agents:
represent either combinations of, or relationships between, lower-level agents.
14
Sharif University of Technology
Patterns in Software Engineering – Lecture 8
Presentation-Abstraction-Control: Structure
p
16
Sharif University of Technology
Patterns in Software Engineering – Lecture 8
Presentation-Abstraction-Control: Dynamics
y
Cooperation between different PAC agents when opening a new bar
-chart
Cooperation between different PAC agents when opening a new bar chartview of the election data.
17
Sharif University of Technology
Patterns in Software Engineering – Lecture 8
Presentation-Abstraction-Control: Consequences
q
9
Separation of concerns
9
Support for change and extension
9
Support for change and extension
9
Support for multi-tasking
8
Increased system complexity
8
Complex control component
8
Complex control component
8
Efficiency
8
Applicability
19
Sharif University of Technology
Patterns in Software Engineering – Lecture 8
Reflection:
p
rovides a mechanism for changing structure and behavior of p
g
g
software systems dynamically.
Supports the modification of fundamental aspects, such as type structures andfunction call mechanisms.function call mechanisms.
An application is split into two parts.
A
meta level provides information about selected system properties and makes the software self-awaresoftware self aware.
A
base level includes the application logic; its implementation builds on the meta level.
Microkernel:
Applies to software systems that must be able to adapt to
Microkernel:
Applies
to software systems that must be able to adapt to
changing system requirements.
separates a minimal functional core from extended functionality and customer-specific parts.
serves as a socket for plugging in such extensions and coordinating theircollaboration.
20
Sharif University of Technology