CHAPTER 7. HIERARCHICAL ARCHITECTURE

7.1. Main-Subroutine Architecture

The purpose is to reuse the subroutines

Data location

In the classical procedural paradigm

With object orientation,
the data is encapsulated in each individual object so that the information is protected.

a software system is decomposed into subroutines hierarchically

The hierarchy will be refined according to the desired functionality of the system.

Refinements are conducted vertically until

The decomposed subroutine is simple enough to have its sole independent responsibility

Whose functionality may be reused and shared by multiple callers.

A Data Flow Diagram (DFD) is often used to model the software requirement

A transform flow is mapped by a controlling module for incoming, transform and outgoing information processing

A transaction center is located at the fork origin of action paths.

Benefits

Easy to decompose

This architecture can still be used in a sub-system of OO Design.

Limitations

Globally shared data in classical main-subroutines introduces vulnerabilities

Tight coupling may cause more ripple effects of changes

7.2. Master-Slave Architecture

Is a variant of the main-subroutine architecture style supports

fault tolerance

system reliability

The master selects a particular service result among slaves by certain selection strategy.

The slaves may perform

the same functional task by

totally different functionality.

different algorithms

different methods

Applicable Design Domains

Used for the software system where the reliability is critical.

Also use the term master-slave or parent-child relationship in database schema design

to specify the dependency of one entity on another.

If the master node is deleted then the slave node does not have any reason to stay.

7.3. Layered Architecture

The system is decomposed into a number of higher and lower layers in a hierarchy

The interface of each layer encapsulates

all detailed service implementations in

the current layer

the interfaces of the layers below.

A request from higher layer to the layer below is made via

method invocation

the response goes back up via

method return

A simple software system may consist of two layers:

Interaction Layer

The Processing layer

The Interaction layer provides

User Interfaces to clients

Takes requests

Validates and Forwards request to processing layer for processing

Responds to clients

Gets the forwarded requests

Performs business logic process

Accesses database

Returns the results to its upper layer

Lets upper layer respond to clients

Applicable Design Domains

Any system that can be divided

Application specific portions

Platform specific portions which provide generic services to the application of the system.

Applications that have clean divisions between

Core services

Critical services

User interface services, etc.

Applications that have a number of classes that are closely related to each other

Benefits:

Incremental software development

Enhanced independence of upper layer to lower layer

Enhanced flexibility

Component-based technology is a suitable technology to implement the layered architecture

Promotion of portability

Limitations:

Lower runtime performance

Conflict of interlayer communication may cause deadlocks

bridging” may cause tight coupling

Exceptions and error handling is an issue

7.4. Virtual machine

Is built up on an existing system

Provides a virtual abstraction

a virtual machine looks like emulation software

In most cases,
A virtual machine separates a programming language or application environment from a execution platform

Applicable Domain:

Suitable for solving a problem by simulation or translation if there is no direct solution.

Sample applications include

Interpreters of microprogramming

XML processing

Script command language execution

Rule-based system execution

Smalltalk and Java interpreter typed programming language.

Benefits:

Portability and machine platform independency.

Simplicity of software development.

Simulation for disaster working model.

Limitations:

Slow execution of the interpreter due to the interpreter nature.

Additional overhead due to the new layer.