BS Software Engineering - IV - A
Instructor: Baber Sheikh (Visiting Faculty)
Chapter 3: Models for Software Architecture
Software architecture is defined by the elements (what code/runtime units exist) and the connectors (how they interact).
Must understand the full "menu" of options (Design Space) to choose the right tools for the job.
Balancing functional requirements (what it does) with non-functional requirements (speed, security, cost).
Architecture can be understood through three key perspectives, each addressing different concerns of the system.
(Code / Development View)
The physical files, directories, and compile-time dependencies.
(Execution / Process View)
The running threads, processes, and active objects in memory.
(Allocation / Organization View)
How development responsibilities are distributed across teams.
Some connectors (e.g., function calls) exist in both views:
๐ Static view: How calls are defined in code.
๐ Runtime view: How calls actually execute in memory.
Refined definitions for exam preparation.
| Perspective | Definition & Elements | Connectors | Key Properties |
|---|---|---|---|
| Static (Code / Development) |
Describes compile-time organization.
|
|
|
| Runtime (Execution / Process) |
Describes system as it executes.
|
|
|
| Management (Allocation / Organization) |
Describes distribution of responsibilities.
|
|
|
"Each architectural view highlights different system qualities."
No single view is sufficientโmultiple views together form a complete architectural description.
(This is the main takeaway for the exam!)
Software architecture specifies a high level of abstraction by employing:
Unlike UML, semantics vary! Lines can mean:
Figure 3.1: Online Shopping Example
A blueprint for functional & non-functional requirements.
Identifies modules, boundaries, interfaces, usage scenarios.
Runtime performance, module communication styles.
Organization of software units (files, directories).
Deployment infrastructure (hardware, network, installation).
Wait, is this standard? (Authors added this). Look & Feel.
Validates ALL other views! Based on use cases.
Unified Modeling Language (UML) is a graphical language for visualizing, specifying, constructing, and documenting the artifacts of a software-intensive system.
It offers a standard way to draw a system's blueprints.
UML diagrams are grouped into two major categories:
Describes the static structure of elements.
Describes the behavior of objects.
Many can map diagrams directly to code (C++, Java, C#)!
| Diagram | Description |
|---|---|
| Class | Overview of classes and their static relationships. Does not show dynamic interaction. |
| Object | Snapshot of instances at a specific point in time. Based on Class diagram. |
| Composite Structure | Inner structure of a component, including internal classes and interfaces. |
| Component | Outline of composition structure of modules, their relationships, and interactions. |
| Package | Structure and organization of packages and classes within them. |
| Deployment | Hardware, software, and network connections in a real-world distributed setting. |
| Diagram | Description |
|---|---|
| Use Case | Overview of actors and use cases. Captures system requirements from external user perspective. |
| Activity | Data and control flow among objects. Decision points and threads of complex processes. |
| State Machine | Life cycle of objects (States + Transitions). Transitions caused by events/stimuli. |
| Sequence | Time sequence of messages passed among objects (Timeline focus). |
| Communication | Sequence of message passing focusing on Object Roles (Network focus). |
| Interaction | Combines Activity and Sequence diagrams for control flow overview. |
| Timing | Changes in state/condition/events over time. |
The Class Diagram provides a static view of the system and captures its vocabulary.
It is the most frequently used UML diagram, refined iteratively throughout the SDLC.
+public, -private,
#protected
1 (One), 0..1 (Zero/One),
1..* (At least one)
Figure 3.2: Online Purchase Order System
New and Existing
(Inheritance โต).0..* Orders
(Association).ItemLine
(Aggregation โ).Items.Note: Typical Logical Structure of a purchase system showing 6 interacting classes.
Attributes are "static", but Objects are alive. An Object Diagram shows a snapshot of instances at a specific runtime moment.
It is a concrete example of the Class Diagram.
Object diagrams are often referenced by:
Figure 3.3: Instances of Figure 3.2
This shows one specific scenario:
๐ค Customer: #1234 (A "new" customer)
๐ฆ Order: #123
๐ Items: Has ordered 2 items:
*Notice how distinct objects (instances) replace the generic classes.
Describes the internal structure of a class or conversation between instances.
It focuses on how interconnected elements collaborate at runtime.
Each class in the structure typically has an Annotation indicating its Role.
(e.g., "Buyer", "Seller")
Figure 3.4: Simple Composite Structure
Notice: OrderProcess (the dashed oval) is NEITHER a class
NOR an object.
It represents the collaboration itself.
Order Processing System.Customer.A Component is a deployable, reusable unit (e.g., .jar, .dll, .ear).
It hides implementation and exposes services via Interfaces.
The interface acts as a contract between the component and its clients.
Figure 3.5: Shopping Cart Components
GUI (ASP/JSP/PHP).
InventoryCatalogShippingCredit Check
Figure 3.6: Clinic Management Components
BillingPatient ManagementDoctor ManagementA Package is a "tabbed folder" that groups functions and sub-packages.
Think of them like directories in a file system or namespaces in Java/.NET.
Package diagrams show how a change in one package might ripple to others.
Figure 3.7: Component-Based Architecture Design
Shows dependencies (dashed arrows) between 4 packages:
GUI depends on logic & data.
Checkout needs cart contents.
* "Interface" contains all GUI classes.
* "Checkout" contains checkout logic classes.
Depicts the hardware nodes and the network connections between them.
It maps software components to hardware devices.
Links between nodes represent network connections defined by Protocols.
HTTP, TCP/IP, JDBC, RMI
Figure 3.8: Distributed System Deployment
A classic 3-Tier Architecture deployment:
Online Shopping Cart.HTTP to
Client.
TCP/IP to
Web Server.
JDBC to App
Server.
Describes system functionality as a contract between Actors (Users) and the System.
Actor: External user, app, or system. Use Case: Meaningful work scenario.
Figure 3.9: Shopping Cart Scenarios
Checkout --<<include>>-->
Credit Check, Shipping, Invoice.
Exception --<<extend>>-->
Order Confirmation.
Describes complex business processes, including concurrent execution and decisions.
It corresponds to a single business process (workflow-oriented).
Black Horizontal Bars indicate:
Figure 3.10: Purchase Order Processing
Demonstrates Parallel Processing:
Gets Order, then splits execution.
Both valid? โ Shipping/Handling.
Figure 3.11: Login Process
Depicts a standard Login Verification flow:
Initial loop waiting for User ID/Password input.
System verifies credentials against records.
Figure 3.12: Item Request Flow
Shows a high-level Order Processing flow referencing other diagrams:
Contains Shipping and Inventory services running in parallel, merging to Issue invoice.
Request Item โ Browse โ Checkout? โ Financial Check โ Valid? โ Processing (ad) or Notification.
Figure 3.13: Online Shopping
Illustrates the Checkout process timeline:
User browses, then triggers checkout. Checkcart calculates total (self-message).
Checkcart requests stock. Must wait for dashed-line reply before proceeding.
Initiates shipping, then returns final confirmation to User.
Figure 3.14: Shopping Process (Collaboration)
Shows the same Checkout process as Figure 3.13 but emphasizing links:
5.3 Confirmation: Ship โ User (Closing the loop).
Figure 3.15: Air Ticket Pricing
Illustrates Seasonal Discount Pricing over a calendar year:
Jan, May-July, Nov-Dec: Ticket sales are at peak price (High state).
Feb-Apr, Aug-Oct: Price drops to discount level (Low state).
Vertical lines indicate instantaneous state changes triggered by date events.
Figure 3.16: 4+1 View Model + UI View
Philippe Kruchten's model (1995) extended with a UI View:
The central "oval" that connects and validates all other views.
Verifies usability requirements; complies with Scenario view.
Figure 3.17: Package Organization
Demonstrates a modular architecture using packages:
Manages Item inventory and Catalog updates.
Figure 3.18: Order Processing Concurrency
Illustrates runtime concurrency in order processing:
Order Processing โ Check Credit: Standard sequential flow.
Processes wait at the join bar before Save Record executes.
Figure 3.19: Order System Deployment
Shows the system deployment across two specific server nodes:
The communication protocol linking the Web Server to the Database Server.
Figure 3.20: Online Shopping Interface
Demonstrates the End-User Experience:
Displays inventory (DVDs) with "Add to Cart" functionality.
Shows selected items, quantities, and "Check out" option.
Validates that the Scenario (Shopping) is intuitively supported by the system.
Simple Client-Server Design
Generated Acme Specification
Insight: AcmeStudio allows visual design which translates to Acme language specifications and can generate C++/Java code.
Multi-User / Single Server
Complex Connector Roles
Feature: Connectors can handle multiple roles (e.g., one event-announcer to multiple event-receivers).
Conclusion: Architecture design satisfies both functional and non-functional requirements through multi-view modeling.