Chapter 7: Design: Architecture and Methodology
Design Topics Covered
Architectural vs. detailed design
“Common” architectural styles, tactics, and reference architectures
Basic techniques for detailed design
Basic issues with user-interface design
Starts mostly from/with requirements (evolving mostly from functionalities and other non-functional characteristics).
How is the software solution going to be structured?
What are the main components—(functional comp)?
Often directly from requirements’ functionalities (use cases).
How are these components related?
Possibly re-organize the components (composition/decomposition).
Two main levels of design:
Architectural (high level)
How should we depict design—notation/language?
Relationship between Architecture and Design
Structure(s) of the solution, comprising:
Major software elements
Their externally visible properties
Relationships among elements
Every software system has an architecture.
May have multiple structures!
Multiple ways of organizing elements, depending on the perspective
External properties of components (and modules)
Component (module) interfaces
Component (module) interactions, rather than internals of components and modules
Views and Viewpoints
View – representation of a system structure
4+1 views (by Krutchen)
Logical (OO decomposition – key abstractions)
Process (run-time, concurrency/distribution of functions)
+1: use cases
Other classification (Bass, Clements, Kazman)
Allocation (mapping to development environment)
Different views for different people
Pipes and filters
We discuss architectural styles/patterns as
“reusable” starting point for design activities.
Pipe-Filter Architecture Style
The high-level design solution is decomposed into two “generic” parts (filters and pipes):
Filter is a service that transforms a stream of input data into a stream of output data.
Pipe is a mechanism or conduit through which the data flows from one filter to another.
Problems that require batch file processing seem to fit this architecture: e.g., payroll, compilers, month-end accounting.
** Reminds one of DFD without the data store or source sink.**
Event Driven (Real Time)
The high-level design solution is based on an event dispatcher, which manages events and the functionalities that depend on those events. These have the following characteristics:
Events may be a simple notification or may include associated data.
Events may be prioritized or be based on constraints such as time.
Events may require synchronous or asynchronous processing.
Events may be “registered” or “unregistered” by components.
Problems that fit this architecture include real-time systems such as: airplane control,
medical equipment monitor, home monitor, embedded device controller, game, etc.
- - - Try a commercial flight control system - - -
Basic Client-Server Style
Application split into client component and server component.
Client may connect to more than one server (servers are usually independent).
Separates model (data) from view.
Controller often integrated with view nowadays.
Model-View-Control (MVC) Style
Most internet web applications fall under this style.
The “outer” layer can only ask for service from the “inner” layer; the “upper” layer can only ask for service from the “lower” layer.
− Strict layering: only directly inside or below layers
− Relaxed layering: any inside or below layers
Shared Data (DB)-Centric Style
Very popular within the business applications community
Three-Tier Style (Mixture)
Clients do not access DB directly.
Better flexibility, integrity. (Why?)
Reminds one of client server or MVC.
Tactics (in contrast to architectural style) are for solving “smaller, specific” problems.
Do not affect overall structure of system.
Example: we add specific functionalities or component (e.g., to increase reliability) in the design for fault detection—especially for distributed systems:
Serve as “templates” or as “a reference” for a class of systems.
Example: J2EE reference architecture (MVC2).
There also are “application domain−specific” reference architectures.
Further refine architecture and match with requirements.
Maybe of different levels of detail for different views.
Functional Decomposition Technique
Dates back to “structured programming” [now (non-OO) Web apps with PHP tool].
Start with: main (task/requirements) --> module.
Refine into sub-modules.
There are alternative decompositions.
Possible Decomposition of (Student-Course Management App)
Relational Database Design
Most databases use relational technology.
Rows (tuples), columns (attributes)
A row may be an entity; columns may be relationships or attributes.
Primary key (unique identifier) – for search
Foreign keys (connects tables)
Conceptual modeling (done during analysis/requirement phase) produces ER diagram.
Logical design (to relational).
Physical design (decide data types, etc.).
Low-level physical (which hard drive, etc.)
Adjustment of indexes
Weak: double lines
Multi-valued: double lines
ER Diagram Example
Logical DB Design – Entities
Table per entity.
Flatten composite attributes.
For weak entities, add the primary key of the strong entity.
Logical DB Design – Multi-Valued
New table needed for multi-valued attributes.
Logical DB Design – Relationships
If one side related to just one entity, add foreign key to that side.
For many to many, need new table.
For ternary, need new table.
Physical DB Design
Data types for each attribute.
Check which ones your DBMS support.
Decide on indexes.
Searches are faster, updates are slower.
Indexes consume space.
Can always adjust during deployment.
Denormalization done sometimes (avoid).
First step: review and refine use cases.
Which classes to create
How are the classes related
Use UML as the design language.
Use Case Diagram
Classes represent real-world entities or system concepts.
Organized into classes: objects in a class have similar characteristics.
Classes have properties (attributes or data).
Classes also have methods (perform functions).
UML Class Diagrams
Use “no-fill” diamond for aggregation.
UML Class Diagrams – Inheritance
UML State Diagram
depicting a student’s “status” in school
UML “Sequence Diagram”
used to depict a flow of interactions
User Interface Design
Most apparent to the user
Two main issues:
Flow of interactions
ii) Look and feel
Types of interfaces
Flow of Interactions
Registration: shows term.
Select first course.
Registration: shows term, course(s) with schedule and cost.
Select *Additional course; *Delete course; *Finish registration.
Registration: shows final schedule.
Select Confirm or Cancel.
High Fidelity Prototype
User: Screens: Process:
User Interaction Added to the Sequence Diagram
Norman’s 7 Stage Model
The GOMS Model (an “advanced” topic for UI)
Consider different kinds of users.
Four factors (for the kind of user)
Goals of the user
Operations provided by the system
Methods or the sequence of operations
Selection rules for the methods
Other UI Issues
Kinds of users
HTML Script Simple Example
Model-View-Controller (MVC) Software Project
Object-Relational Impedance Mismatch (an “advanced” topic)
How do we handle mismatches between object-oriented concepts and relational DB such as:
Private and public
Inheritance and polymorphism
Nested structure versus table structure