Ch6 Handouts
Ch6 Handouts
² Architectural views
Architectural Design ² Architectural patterns
² Application architectures
Chapter 6
Dr. Mahmood Qureshi Hashmi
Assistant Professor
Department of Electrical & Computer Engineering Chapter 6 Architectural design 2
² The design process for identifying the sub-systems ² Understanding of how a system should be organized and
making up a system and the framework for sub-system designing the overall structure of that system.
control and communication is architectural design. ² Architecture design is the first stage in the software
² The output of this design process is a description of the design process.
software architecture. ² Represents the link between specification and design
processes.
² Often carried out in parallel with some specification
activities.
² It involves identifying major system components and
their communications.
Chapter 6 Architectural design 3 Chapter 6 Architectural design 4
² You can design software Architecture at two levels of ² Simple, informal block diagrams showing entities and
abstractions relationships are the most frequently used method for
² Architecture in the small is concerned with the documenting software architectures.
architecture of individual programs. At this level, we are ² But these have been criticised because they lack
concerned with the way that an individual program is semantics, do not show the types of relationships
decomposed into components. between entities nor the visible properties of entities in
² Architecture in the large is concerned with the the architecture.
architecture of complex enterprise systems that include ² Depends on the use of architectural models.The
other systems, programs, and program components. requirements for model semantics depends on how the
These enterprise systems are distributed over different models are used.
computers, which may be owned and managed by
different companies.
Chapter 6 Architectural design 5 Chapter 6 Architectural design 6
² Very abstract - they do not show the nature of ² Is there a generic application architecture that can be
component relationships nor the externally visible used?
properties of the sub-systems. ² How will the system be distributed?
² However, useful for communication with stakeholders ² What architectural styles are appropriate?
and for project planning.
² What approach will be used to structure the system?
² How will the system be decomposed into modules?
² What control strategy should be used?
² How will the architectural design be evaluated?
² How should the architecture be documented?
Chapter 6 Architectural design 7 Chapter 6 Architectural design 8
² What views or perspectives are useful when designing
§ Localise critical operations and minimise communications. Use
large rather than fine-grain components. and documenting a system’s architecture?
² Security ² What notations should be used for describing
§ Layered structure of architecture should be used. architectural models?
² Safety
§ Localise safety-critical features in a small number of sub-
systems.
² Availability
§ Include redundant components and mechanisms for fault
tolerance.
² Maintainability
§ Use fine-grain, replaceable components.
Chapter 6 Architectural design 9 Chapter 6 Architectural design 10
² A logical view, which shows the key abstractions in the ² Patterns are a way of presenting, sharing and reusing
system as objects or object classes. knowledge.
² A process view, which shows how, at run-time, the ² An architectural pattern is a stylized description of good
system is composed of interacting processes. design practice, which has been tried and tested in
² A development view, which shows how the software is different environments.
decomposed for development. ² Patterns should include information about when they are
² A physical view, which shows the system hardware and useful and when they are not useful.
how software components are distributed across the ² Patterns may be represented using tabular and graphical
processors in the system. descriptions.
² Related using use cases or scenarios (+1)
Chapter 6 Architectural design 11 Chapter 6 Architectural design 12
Name MVC (Model-View-Controller)
Description Separates presentation and interaction from the system data. The system is
structured into three logical components that interact with each other. The
Model component manages the system data and associated operations on
that data. The View component defines and manages how the data is
presented to the user. The Controller component manages user interaction
(e.g., key presses, mouse clicks, etc.) and passes these interactions to the
View and the Model.
Example Architecture of a web-based application system organized using the MVC
pattern.
When used Used when there are multiple ways to view and interact with data. Also used
when the future requirements for interaction and presentation of data are
unknown.
Advantages Allows the data to change independently of its representation and vice versa.
Supports presentation of the same data in different ways with changes made
in one representation shown in all of them.
Disadvantages Can involve additional code and code complexity when the data model and
interactions are simple.
Chapter 6 Architectural design 13 14
Chapter 6 Architectural design 15 Chapter 6 Architectural design 16
² Used to model the interfacing of sub-systems.
² Organises the system into a set of layers (or abstract
machines) each of which provide a set of services.
² Supports the incremental development of sub-systems in
different layers. When a layer interface changes, only the
adjacent layer is affected.
² However, often artificial to structure systems in this way.
Chapter 6 Architectural design 17 Chapter 6 Architectural design 18
Name Layered architecture
Description Organizes the system into layers with related functionality
associated with each layer. A layer provides services to the layer
above it so the lowest-level layers represent core services that are
likely to be used throughout the system.
Example A layered model of a system for sharing copyright documents held
in different libraries.
When used Used when building new facilities on top of existing systems; when
the development is spread across several teams with each team
responsibility for a layer of functionality; when there is a
requirement for multi-level security.
Advantages Allows replacement of entire layers so long as the interface is
maintained. Redundant facilities (e.g., authentication) can be
provided in each layer to increase the dependability of the system.
Disadvantages In practice, providing a clean separation between layers is often
difficult and a high-level layer may have to interact directly with
lower-level layers rather than through the layer immediately below ² Layered architecture with four layers. The lowest layer includes system support
it. Performance can be a problem because of multiple levels of software. The next layer is the application layer. Third layer is concerned with user
interpretation of a service request as it is processed at each layer. interface. With the top layer providing user interface fascilities.
Chapter 6 Architectural design 19 Chapter 6 Architectural design 20
² How a set of inetracting components can share data
² Sub-systems must exchange data. This may be done in
two ways:
§ Shared data is held in a central database or repository and may
be accessed by all sub-systems;
§ Each sub-system maintains its own database and passes data
explicitly to other sub-systems.
² When large amounts of data are to be shared, the
repository model of sharing is most commonly used and
this is an efficient data sharing mechanism.
² An example of how this layered architecture pattern can be applied to a library
system called LIBSYS,
Chapter 6 Architectural design 21 Chapter 6 Architectural design 22
Name Repository
Description All data in a system is managed in a central repository that is accessible to all
system components. Components do not interact directly, only through the
repository.
Example Figure 6.9 is an example of an IDE where the components use a repository of
system design information. Each software tool generates information which is
then available for use by other tools.
When used You should use this pattern when you have a system in which large volumes
of information are generated that has to be stored for a long time. You may
also use it in data-driven systems where the inclusion of data in the repository
triggers an action or tool.
Advantages Components can be independent—they do not need to know of the existence
of other components. Changes made by one component can be propagated to
all components. All data can be managed consistently (e.g., backups done at
the same time) as it is all in one place.
Disadvantages The repository is a single point of failure so problems in the repository affect
the whole system. May be inefficiencies in organizing all communication
through the repository. Distributing the repository across several computers
may be difficult.
Chapter 6 Architectural design 23 Chapter 6 Architectural design 24
² Distributed system model which shows how data and Name Client-server
Description In a client–server architecture, the functionality of the system is organized into
processing is distributed across a range of components. services, with each service delivered from a separate server. Clients are
users of these services and access servers to make use of them.
§ Can be implemented on a single computer.
² Set of stand-alone servers which provide specific Example Example of a film and video/DVD library organized as a client–server system.
services such as printing, data management, etc. When used Used when data in a shared database has to be accessed from a range of
locations. Because servers can be replicated, may also be used when the
² Set of clients which call on these services. load on a system is variable.
Advantages The principal advantage of this model is that servers can be distributed across
² Network which allows clients to access servers. a network. General functionality (e.g., a printing service) can be available to
all clients and does not need to be implemented by all services.
Disadvantages Each service is a single point of failure so susceptible to denial of service
attacks or server failure. Performance may be unpredictable because it
depends on the network as well as the system. May be management
problems if servers are owned by different organizations.
Chapter 6 Architectural design 25 Chapter 6 Architectural design 26
² Functional transformations process their inputs to
produce outputs.
² May be referred to as a pipe and filter model (as in UNIX
shell).
² Variants of this approach are very common. When
transformations are sequential, this is a batch sequential
model which is extensively used in data processing
systems.
² Not really suitable for interactive systems.
Chapter 6 Architectural design 27 Chapter 6 Architectural design 28
Name Pipe and filter
Description The processing of the data in a system is organized so that each processing
component (filter) is discrete and carries out one type of data transformation. The
data flows (as in a pipe) from one component to another for processing.
Example Example of a pipe and filter system used for processing invoices.
When used Commonly used in data processing applications (both batch- and transaction-
based) where inputs are processed in separate stages to generate related outputs.
Advantages Easy to understand and supports transformation reuse. Workflow style matches
the structure of many business processes. Evolution by adding transformations is
straightforward. Can be implemented as either a sequential or concurrent system.
Disadvantages The format for data transfer has to be agreed upon between communicating
transformations. Each transformation must parse its input and unparse its output to
the agreed form. This increases system overhead and may mean that it is
impossible to reuse functional transformations that use incompatible data
structures.
Chapter 6 Architectural design 29 Chapter 6 Architectural design 30
² Application architecture is a critical aspect of software development ² An application architecture describes the patterns and
that defines how an application is structured and how its techniques used to design and build an application
components interact.
² ² The architecture gives you a roadmap and best practices
to follow when building an application, so that you end up
with a well-structured app.
² Professionals are responsible for designing, developing
and implementing applications for a company's computer
systems
Chapter 6 Architectural design 32
² Data processing applications
² Process user requests for information from a database
² Data driven applications that process data in batches without explicit
user intervention during the processing. (finance, healthcare, marketing, and or requests to update the database.
manufacturing, to enhance decision-making and operational efficiency) ² From a user perspective a transaction is:
² Transaction processing applications
² Any coherent sequence of operations that satisfies a
² Data-centred applications that process user requests and update goal;
information in a system database. (E-Commerce, Reservation Systems )
² Event processing systems ² For example - find the times of flights from London to
² Applications where system actions depend on interpreting events from
Paris.
the system's environment. (Google Cloud Data Flow, Azure Events Hubs, IBM ² Users make asynchronous requests for service which
Events Stream, Apache Storm, Amazon Kinesis)
are then processed by a transaction manager.
² Language processing systems
² Applications where the users' intentions are specified in a formal
language that is processed and interpreted by the system. ( E-Compilers,
Command Interpreters)
Chapter 6 Architectural design 33 Chapter 6 Architectural design 34
Chapter 6 Architectural design 35 Chapter 6 Architectural design 36
² Information systems have a generic architecture that can
be organized as a layered architecture.
² These are transaction-based systems as interaction with
these systems generally involves database transactions.
² Layers include:
² The user interface
² User communications
² Information retrieval
² System database
Chapter 6 Architectural design 37 Chapter 6 Architectural design 38
² Accept a natural or artificial language as input and
generate some other representation of that language.
² May include an interpreter to act on the instructions in
the language that is being processed.
² Used in situations where the easiest way to solve a
problem is to describe an algorithm or describe the
system data
² Meta-case tools process tool descriptions, method rules,
etc and generate tools.
Chapter 6 Architectural design 39 Chapter 6 Architectural design 40
² A lexical analyzer, which takes input language tokens
and converts them to an internal form.
² A symbol table, which holds information about the names
of entities (variables, class names, object names, etc.)
used in the text that is being translated.
² A syntax analyzer, which checks the syntax of the
language being translated.
² A syntax tree, which is an internal structure representing
the program being compiled.
Chapter 6 Architectural design 41 Chapter 6 Architectural design 42
² A semantic analyzer that uses information from the
syntax tree and the symbol table to check the semantic
correctness of the input language text.
² A code generator that ‘walks’ the syntax tree and
generates abstract machine code.
Chapter 6 Architectural design 43 Chapter 6 Architectural design 44
² Models of application systems architectures help us
understand and compare applications, validate
application system designs and assess large-scale
components for reuse.
² Transaction processing systems are interactive systems
that allow information in a database to be remotely
accessed and modified by a number of users.
² Language processing systems are used to translate
texts from one language into another and to carry out the
instructions specified in the input language. They include
a translator and an abstract machine that executes the
generated language.
Chapter 6 Architectural design 45 Chapter 6 Architectural design 46