Categorization of Software Architectures
A Dataflow architectures Pipes and Filters Batch sequential
B Independent components
Client-server systems Parallel communicating
processes Event systems Service-oriented (added)
C Virtual machines Interpreters Rule-based systems
D Repository architectures
Databases Hypertext systems Blackboards
E Layered architectures1
A -Data Flow Architecture
Each processing unit of the Data Flow Diagram is designed INDEPENDENTLY of the others
Data arises from sources, such as the users and flows back to users or collapse such as account databases.
The functions of data flow diagram may reside on more than one physical diagram
2
account #& deposit
balancequery
account #& deposit
account #
User
Makeinquiry
accountdatabase
deposittransaction
accountdata
Get deposit
Get inquiry
Validateinquiry
Do deposit
transaction
Create account
summary
Validatedeposit
errorerror
Printer
memberbanks
bank name
Display account
account #
accountdata
accountdisplay
Data Flow Diagram for ATM Application
3
Data Flow Architecture I: Pipe and Filter Architectures
filter
filter
filter
filter filter
filter
pipe
< stream
stream >
pipe
Pipe and Filter Architecture
Processing elements (filters) accept streams as input (sequences of a uniform data elements) at any time, and produce output streams
Each filter must be designed to be implemented of the other filters.
The advantage is modularity.
Example of Pipe & Filter Data Flow Architecture
Maintain financial transactions
Bankdata
Requirement:
record Logtransaction analyze
deposit
deposit data
withdraw
withdrawal
account data
bank address
transaction result
transaction result
transaction
account data
account data
Comm
account data
Data Flow Architecture II : Batch Sequential Data Flow Architecture
Manage bank funds available for mortgages & unsecured lending.
Collectmortgage funds
Accountbalances
Mortgagepool
Unsecuredpool
Architecture:
Collectunsecured funds
Requirement:
Processing elements are only given batches of data, the result is a batch sequential form of data flow.
For decades, data flow has been the most common way of expressing architectures.
Disadvantages of the data flow diagrams include the fact that they don’t map cleanly to code, whether object oriented or not.
Disadvantage of Data Flow Architecture
B - Independent Components Architecture
Independent components are operated in parallel and communicated with each other from time to time.
This can be found on the WWW, where millions of servers and browsers continuously in parallel and periodically communicate each other
Components are portions of software that do notchange and that do not require knowledge of the software using them.
B- Independent Component Examples
.NET assemblies and Java NetBeans are example component technologies
Eclipse is a development platform designed to accommodate plug-insThese are independent components
They can be created by developers for various purposes
They are added to the platform without affecting existing functionality
Independent Components I :Tiered and Client Server Architectures
The server component serves the needs of the client upon requests
Client server architectures have the advantage of low coupling between the components.
When more than one person performs implementation, developers’ packages are often related as client and server It is naturel to tie up a package of classes to each
developer and developers require the services of classes for which others are responsible
Independent Components I : (cont’d) Tiered and Client- Server Architectures
A server component acts more effectively when its interface is Narrow.Narrow means that the interface (a collection of
functions) contains only necessary parts is collected in one place is clearly defined
If a third tier lies between client and server, three-tiered architecture is constituted.
Client-Server ArchitectureThe computer runs software called the client The computer interacts with another software known as
the server located at a remote computer. The client is usually a browser such as Internet Explorer,
Netscape Navigator or Mozilla. Browsers interact with the server using a set of instructions
called protocols. These protocols help in the accurate transfer of data through
requests from a browser and responses from the server. There are many protocols available on the Internet.
The World Wide Web, which is a part of the Internet, brings all these protocols.
We can use HTTP, FTP, Telnet, email etc. from one platform (web browser.)
Example I :Two –Tiered Client-Server Architecture
Static HTML pages
The client (browser) requests for an HTML file stored on the remote machine through the server software.
The server locates this file and passes it to the client. The client then displays this file on machine.
In this case, the HTML page is static. Static pages do not change until the developer modifies them.
Example II: CGI Scripts
The server has to do more work since CGI programs consume the server machine's processing power.
Suppose a searchable form on a web page that runs a CGI program and browser sends the request to the server.
The server checks the headers and locates the necessary CGI program and passes it the data from the request
The CGI program processes this data and returns the results to the server. The server then sends this formatted in HTML to the browser which in turn
displays the HTML page. Thus the CGI program generates a dynamic HTML page. The contents of the dynamic page depend on the query passed to the CGI program.
Example III: Client-Server Architecture Server Side Scripting Technologies
This case also involves dynamic response generated by the use of server side technologies. There are many server side technologies
Active Server Pages (ASP): A Microsoft technology (the extension .asp). PHP: Hypertext Preprocessor (PHP): An open source technology. PHP (.php, .phtml or .php3 ) Java Server Pages: .jsp pages contain Java code. Server Side Includes (SSI): Involves the embedding of small code snippets inside the HTML page.(.shtml as its file extension).
Independent Components II:Parallel Communication Processes Architecture
Several processes or threads are executed at the same timeA process as the combination of parallel parts can simplify
the design (Disjkstra)An example of this is a simulation of bank customersMany simulations were designed without parallelism by
storing and handling the eventsSuch design can sometimes be simplified , if the movement
of each customer is a separate process (a thread object in Java)
Such a parallel communicated process matches more closely to the activities that it simulates.
Platforms for Communicating ProcessorsPlatform 1 Platform 2 Platform 3
execution
comunication
Parallelprocessesmay runonseparateplatforms similar to the process on a singleplatform
Example I Parallel Communicating Processes Architecture
Manage ATM traffic. Architecture beginning with first session:
Requirement:
deposit
create retrieve*
12
3
4
‡
Customer_n :Customer:
session_m :Session
customer_n_checking:Account
deposit*5
(more work)
(thread detail omitted)*
Customer n creates session mSession m retrieves an Account objectsuch as customer n checking.The retrieval is performed asynchronously . • A thread (parallel process) is created
(1)An object for customer is created(2)Customer n creates session m .(3)Session m retrieves an Account object customer n checking
The retrieval is performed asynchronously . A thread (parallel process) is created because it may take time.This allows the customer to carry out other business in the same time.
(4)The customer object immediately performs a deposit transaction by sending a message to the Session object
(5) The session object executes the deposit transaction by sending a message to the session object, producing a new thread
Other work can go on while deposit is processed
Processing of the Parallel Architecture step by step
Example II: Parallel Communicating Processes Architecture Manage ATM traffic.
Architecture:
Requirement:
withdraw
deposit
create
create retrieve*
retrieve*
1
23
4
Customer_n :Customer:
customer s :Customer
session_k:Session
session_m :Session
customer_ s_saving : Account
customer_n_checking:Account
deposit*5
(thread detail omitted)*
withdraw*
21
Class Model For Parallel Processing Example
*
Sessions
SessionCustomer
Customers
Accountdeposit()
withdraw()retrieve()
*
Example of parallel communicating processor architecture –manage ATM traffic class model
Independent Components III:Event System Architectures and Design
Patterns
Many set of components are viewed . Each of them waits until an event occurs that
effect it.A word processor waits for the user to click on an
icon. It then reacts. Event systems are achieved as state
transaction systems .The state pattern solves the problem how to
use an object without having to know its state.
RolePlayingGame
State Design Pattern Applied toEncounter
RPGamehandleEvent()
GameStatehandleEvent()
state
{ state.handleEvent(); }
EncounterGame
State design pattern can be used to handle the states and actions of Encounter. The framework class RPGame (role-playing game) has an attribute called state ,
which is of type GameState. The subtype of state (which class of GameState it belong to) determines what
happens when handleEvent() is called on an RPGameObject. The code for handleEvent() in RPGame passes control to the handleEvent()
function of state.
Virtual Machine Architectures
Application 1
Interpreter
Program 1written in language
understoodby interpreter
Application 2
Interpreter
Program 2written in language
understoodby interpreter
Leveraging Interpreter to Facilitate Creation of Applications
This architecture threats an application as a program written in a specific-purpose language.
Since an interpreter for such a language has to be built , this architecture is effective only if several programs are to be written in the language, generating several applications
Advantages: If the application consists of processing of complex entities, and if these entities (such as the orders) are readily describable by a grammar.
Example
An example requiring a virtual machine is an application that provides simple user-level programming of a special purpose language.
A nonpogrammer user is capable of writing a script .
27
Layered Architecture
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.
Layered ArchitecturesLayering reflects a division of the software into units
The Units are layersEach layer represents a virtual machine.
Virtual machines are created to interact with each other according to a strict ordering relation.
If (A,B) is in this relation, we say “Layer B is beneath layer A”, and that means either, or both, of the following:
“The implementation of layer A is allowed to use any of the public facilities of the virtual machine provided by layer B.” “The public facilities in layer B are allowed to be used by the software in layer A.”
Layered Architectures*
An architectural layer is a coherent collection of software artifacts (like a package of classes)
A layer uses at most one other layer and is used by at most one other layer
Building application layer by layer can simplify the process
Some layers, such as frameworks can serve several applications.
*layer - A virtual machine with a set of capabilities/services. These services can only beaccessed through a layer’s interface.
Layered Architectures
Segmented LayersSometimes layers are divided into segments
denoting some finer grained decomposition of the software.
This occurs when there is some pre-existingset of units such as imported components
Components from separate teams that share the same allowed-to-use relation.
Segmented Layers
Advantages
Layered Architecture allows replacement of entire layers so long as the interface is maintained.
Redundant facilities (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
A high-level layer may have to interact directly with lower layers rather than through the layer immediately below it.
Performance can be a problem because of multipnle levels of interpretation of a service request as it is processed at each level
A Generic Layered Architecture
Role-playing game layer
Another Layered Architecture
Characters LayoutRolePlayingGame
EncounterCharacters
EncounterEnvironment
Encounter Game
Application layer
3D engine layer
«uses»
«uses»
The Architecture of the iLearn system
Application Architectures
Transaction Processing Systems are interactive systems that allow information in a database to be remotely accessed and modified by a number of users. Interactive banking system, e-commerce system,
booking system Language Processing Systems are systems in
which the user’s intentions are expressed in a formal language (such as Java )Compilers
Layered Information Systems
All systems that involve interaction with a standard database can be considered to be transaction-based information systems.
Layers include:– The user interface– User communications– Information retrieval
The Architecture of the Mentcare System
The top layer is responsible for implementing the user interface. The UI has been implemented using a web browser. The second layer provides the used interface functionality. It includes components to allow users to log in to the system and checking components. The third layer implements the functionality of the system and provides components that implements system security, patent information creation and update,…… The lowest layer, which is built using the commercial database management system, provides
transaction management and persistent data storage.
Web-based Information Systems
Information and resource management systems are now usually web-based systems where the user interfaces are implemented using a web browser.
For example, e-commerce systems are Internet-based resource management systemsAccept electronic orders for goods or services Arrange delivery of these goods or services to the customer.
In an e-commerce system The application-specific layer includes additional functionality
supporting a ‘shopping cart’ users can place a number of items in separate transactions and pay for them all together in a single transaction.
Server ImplementationThese systems are often implemented as multi-
tier client server/architecturesThe web server is responsible for all user
communications, with the user interface implemented using a web browser
The application server is responsible for implementing application-specific logic as well as information storage and retrieval requests
The database server moves information to and from the database and handles transaction management.
Layered Architecture Example Using Aggregation
Architecture:
Class model:(relationships withinpackages not shown)
Ajax bank printing Layer
Accounts Layer Ajax bank common library Layer
Ajax bank printing
Printer PageFormatter
AjaxLogo AjaxDisclaimer Regulations
Accounts
Account Customer
Vendor-supplied Layer
Ajax bank common library
“uses”
Vendor-suppliedlayer not shown
Ajax common library contains classes throughout Ajax applications and addresses
Ajax Bank Printing Applications The application layer, Ajax bank printing, has to do with
printing and formatting. It is built upon (uses) the Accounts and the Aja Bank
Common Class Layers. The latter are built upon a vendor-supplied layer
It contains general utilities such as sorting and searching In this example, a layer is realized as a package of
classes. Ajax common library comprises classes used throughout
Ajax applications, and addresses such issues as banks’ logo and its regulations.
Air Traffic control systemSubsystems Layers cross conceptual paths with
the concept of subsystemThe problem may be divided into several areas of capability:
interpreting radar data to display aircraft positions on screens
detecting aircraft that are about to violate separation constraints
running simulations for trainingrecording and playback for after-situation analysis and
training monitoring its own health and status
Air Traffic Control System
A subsystem consists of a segment from the top layer, plus any segments of any lower layers it’s allowed to use.
A subset of the system, when shown in a layer diagram is called a slice or vertical slice
Confusions About Layered Architecture Layer diagrams are often confused with other architectural viewsi)Work assignments. There is a tendency to regard layers as identical to work assignments.A layer may in fact be assigned as a unit of work, but it is not necessarily always so.
Segmented layers are often introduced to show work assignments. If a work assignment spans layers, colors or fill patterns are often used
Confusions About Layered Architecture ii) Tiers. Layers are very often confused with the tiers in an n-tier client-server architecture,
Layers are not tiers. However, tiers do resemble layers. Each obeys an allowed-to-use relation The presentation layer is implemented in terms of the virtual
machine provided by the business logic It can use the data server.
Confusions
iii)Logical view. Layers are often confused with modules in the logical viewThey have much in common.
Both are collections of usable software services. Both have interfaces through which they require theirclients to make use of their provided services.Both have private parts Are they not the same?
They may be the same, but do not have to be
Architectural Views A logical view shows the
key abstractions in the system as objects or object classes.
A process view shows how ( at run-time) the system is composed of interacting processes.
A development view shows how the software is decomposed for development.
A physical view shows the system hardware and how software components are distributed across the processors in the system
Language Processing Systems
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 dataMeta-case tools process tool descriptions, method
rules, etc and generate tools.
Language Processing Systems
Other language processing systems may translate an XML data description into commands to query a database or to an alternative XML representation
Natural processing systems may translate one natural language to another.
The Architecture of a Language Processing System
Compiler componentsA 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.
Compiler components
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.
A Repository Architecture for a Language Processing System
A Pipe and Filter Compiler Architecture
The pipe and filter model of language compilation is effective in batch environments where programs are compiled and executes without user interactions For example in the translation of one XML document into another.
Repository Architectures
An architecture built primary around data is called a repository architecture.
These systems are designed to perform transactions against a database For example , an electric company maintains a data
base customers that includes details about them. Other examples are IDEs (ınteractive development
Environment IDEs apply processes such as editing and
compiling to a database of source and object files.
59
Repository Architecture
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 a this is an efficient data sharing mechanism.
A Repository Architecture for an IDE
More Repository Architectures Blackboard architectures developed for artificial intelligence
applications are repositories that behave in accordance with posting rules
Hypertext architecture The most common use of hypertext is on the Web. An application that manages the artifacts of a software
engineering application The word repository used in industry to denote a
application that provides a unified view of a collection of databases (not just one) – Data Warehouses Repositories don’t change the structure of databases,
but they allow uniform access to them .
When is Repository Architecture Preferred?
Many applications make their databases their core, therefore repository architectures occupy significant part of applications.
When the processing is negligible compared to the formatting of data from the database, repository architectures are appropriate.
62
Architectural Patterns
Patterns are a means of representing, sharing and reusing knowledge.
An architectural pattern is a stylized description of good design practice, which has been tried and tested in different environments.
Patterns should include information about when they are and when the are not useful.
Patterns may be represented using tabular and graphical descriptions.
MVC (Model-View-Controller)
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 interactions (key presses, mouse clicks…) and passes these interactions to the View and the Model
MVC (Model-View_Controller) separates presentation and interaction from the system dataThe system is structured into three logical components that interact with each other
Web application architecture using the MVC pattern
Service-Oriented Architectures(SOAs)as a component based architecture
A means of developing distributed systems where the components are stand-alone services
Services may execute on different computers from different service providers
Standard protocols have been developed to support service communication and information exchange
Service-Oriented Architecture (SOA)
Services are platform and implementation –language independent
Software systems are constructed using services from different providers with continuous interaction between services.
SOA is recognized as a significant development, particularly for business application systems
Summary I: Service-Oriented Architecture – SOA
Based on components as a combination of servicesthat provide functionality according to an interfacespecification
Principally via Web services that describe a set of interoperable components rather than to create a single application In the character of facade objects (A segment of the client community needs a
simplified interface to the overall functionality of a complex subsystem).They aren’t necessarily object oriented.
Example: An application concerning orders. – Wouldn’t assume an Order class known to all– Instead: Define an order schema; reference when Web services
involve orders
Facade Object
Facade discusses encapsulating a complex subsystem within a single interface object.
This reduces the learning curve necessary to successfully leverage the subsystem. It also promotes decoupling the subsystem from its potentially
many clientsOn the other hand, if the Facade is the only access point for the
subsystem, it will limit the features and flexibility that “power users” may need.
ExampleSOAs allow dynamic linking of services We want to write an application that orders
stationary for a company. We want the application to identify all qualified
vendors, check prices availability, call for bids and terms, select a vendor, and place the order
To do this, the application can’t be permanently bounded a set of vendors.For this reason, SOAs are built around a registration
system
Summary II: Service-Oriented Architecture – SOA
“Fire and forget”– Stateless as much as possible
Extensible– Additional functionality easily added
DiscoverableAccount for Quality of Service
– E.g., security
Layering for Service-Oriented Architectures
SOAs frequently use a business process layer. This defines the components of the business such as
the customer database and businessService interface layer defines the services
available that are based upon the business processIt specifies functionality such as listing all customers in
the database and checking a transaction for conformance to business rules
The application layer consists of application built using the service interface layer.
Layering for Service-Oriented Architectures
Business Process Layer
Service Interface Layer
«uses»
«uses»
Appplication A(.NET)
Appplication C(Legacy)
Application B(JEE)
Trading off Architecture Alternatives
Creating and comparing two architectures
Let separate the application into three major parts: The back-end database, The middle part which contains the business logic, and The GUIs
This is a three-tier architecture. It is often an appropriate choice when some or all of the tiers
reside on physically separate platforms.
3-Tier Architecture Alternative
VSGUIs VSDataVSOperations
Presentationtier
Middletier
Datatier
Video store application
Trading off Architecture Alternatives
In particular, if the GUIs are all on PCs, the middle layer on a server, and the databases controlled by a database management system, then three-tier architectures map to separate hardware and software units.
There is no necessity that hardware be the same as software architectures.
We may want a logical (conceptual) view of an application to be entirely independent of hardware platforms hosting it. (These are the physical view vs. the logical view).
Alternative Architecture for a Video Store Application
DVRentals
VSCustomers
DVDs
The Rentals package contains classes that relate videos and customersThe Customer package contains classes corresponding to the customers , including associated GUIsThe third option would be to group all displays in a package.
The Strength of three-tiered architecture
Since the GUI part is separate from the rental operations it can be changed without disturbing latter.
The weakness of three-tiered architecture
One weakness is the coupling between GUIs package and the VSO operations package;
There may be several GUI classes corresponding to the Customer class.
There is also coupling between the classes in the VSData package and the classes VSOperations
Comparing Architectures
Three-tier Alternative
Understandable?Yes Yes
Flexible?Yes: GUI easy to change Yes: Basic building blocks
easy to identify.
Reusable?
Not very: Each layer is special to Video Store rentals.
Yes: Easy to generalize to generic rentals
Easy to construct?
Perhaps Yes: Clear potential to use Façade.
Tools for Architectures
Various CASE tools are used to facilitate a software engineering processSome tools represent classes and relationships ,
such as Rational Rose.Some tools facilitate the drafting of object
models, linking them with the corresponding source code and sequence diagrams
In selecting a modeling tool, a list of requirements for the tools is drawn up.
Some Requirements for Modeling Tools
Essential: Facilitate drawing object models and sequence diagrams
Essential: Create classes quickly Essential: Edit classes easily Essential: Should cost no more than …$per user Essential: Zoom into parts of the model Essential: Possible to jump directly from the object to the
source code Essential: Reverse engineering available ( means create
objects from source code) Essential: Use color coding for status of class implementation
Tool Packages Implementation-oriented tools such as JavaDoc can be
useful to supplement the design process. JavaDoc ( a tool for generating API documentation in HTML
format from doc comments in source code) is useful for navigating packages because it provides an alphabetical listing of classes and the parent hierarchy of classes
Interactive development Environments (IDEs) are delivered with compilers and widely used as partial modeling tools.
Object-oriented IDEs show inheritance in graphical formsThese IDEs are close to the compilation and debugging process
Tool Packages Component assembly tools create applications by
dragging and dropping icons that represent processing elementsFor example: JavaBeans environments
Beans can be obtained from libraries, customized, and related to each other by means of events
The JavaBeans standard was created with the express purpose of facilitating such simple assemlies by means of graphical tools.
Question: What is the disadvantage of using modeling tools?
Architecture of Eclipse :
Java Development Tools
Platform
Adapted from “Contributing to Eclipse” p5
Plug-In Development Environment
depends on
The platform is a infrastructure od Eclipse and is independent of languageswith which Eclipse can be used and independent of all plug-ins. The Java development tools utilize the platform and is class model for a Java interactive development environment The Plug-In Development Environment allows developers to create and add plug-ins. It usesJava development tool
Architecture of Eclipse : The Platform
Java Development Tools
Platform
[Adapted from “Contributing to Eclipse” p283]
Plug-In Development Environment
UI
Core
JFace
Standard Widget Toolset
Workbench
Workspace
Runtime
depends on
86
Platform decomposes as UI and Core Runtime handles the available plug-ins at runtimeWorkspace manage projects , which consist of files and foldersStandard Widget Toolset (SWT) provides graphics elementsJFace is a set of UI framework using SWT, used for common UIs.Workbench defines the Eclipse UI paradigm. This involves editors, views and perspectives
Top Related