Skip to content

Software Architecture and Design

Lecturer

Ants Torim, Department of Software Science, TalTech


Lecture 1 — Introduction

  • Focus: Analysis, design, and architecture.
  • Analysis studies the problem domain and requirements.
  • Design provides a conceptual solution that fulfills requirements.
  • Architecture describes the system’s high-level structure and most critical decisions.

Quality Attributes

Reusability, performance, supportability, conceptual integrity, availability, security, interoperability, testability, and usability.

Object-Oriented Design (OOD)

  • Language-independent logical modeling using UML.
  • Design patterns, contracts, and unit tests are essential tools.

Lecture 2 — Design by Contract (DbC) and Unit Testing

  • Goal: Describe class operations precisely, independent of implementation.
  • Black-box view: Focus on public behavior through inputs and outputs.
  • White-box view: Focus on internal mechanisms and collaboration.

Design by Contract (Bertrand Meyer)

  • Defines preconditions, postconditions, and invariants.
  • The contract describes a class’s obligations and guarantees.

Example:

put (x: G)
  require not full
  ensure not empty and item = x

DbC helps in: 1. Documenting behavior. 2. Ensuring correctness. 3. Assisting debugging and verification.


Lecture 3 — Interaction Diagrams in UML

  • Operation: A command or query defined by a class.
  • Message: Invocation of an operation.
  • Interaction diagrams describe message flows between objects.

Types of UML Interaction Diagrams

  • Sequence diagrams: Show the chronological order of messages.
  • Communication diagrams: Show object relationships and message numbering.

Key takeaway:

Use interaction diagrams to assign responsibilities and reveal dependencies between classes.


Lecture 4 — GRASP Patterns: Responsibility Assignment

GRASPGeneral Responsibility Assignment Software Patterns (C. Larman)

Pattern Purpose
Expert Give responsibility to the class with the necessary information.
Creator A class should create instances of classes it closely uses or contains.
Controller Handle system events at a high abstraction level.
Low Coupling Reduce dependencies between classes.
High Cohesion Keep classes focused and manageable.

Patterns help build a maintainable, modular, and understandable system design.


Lecture 5 — Object-Oriented Programming and Type Systems

Core OOP Concepts

  • Classes encapsulate data and behavior.
  • Encapsulation: Hide internal implementation details.
  • Inheritance: Create new classes based on existing ones.
  • Polymorphism: Enable objects of different classes to respond to the same message differently.

Static vs Dynamic Typing

  • Static typing (Java, C#): Type errors detected at compile-time.
  • Dynamic typing (Python): Errors found at runtime.

Interface Segregation Principle (ISP)

Clients should not depend on interfaces they do not use.

Generic Classes

Allow type-safe code reuse using type parameters (e.g., List<T> in C#).


Lecture 6 — Object-Oriented Analysis (OOA)

Definition

Analysis focuses on understanding the problem and requirements, not implementation.

Domain Model

  • Represents key concepts of the problem domain.
  • Built using UML class diagrams (concepts, attributes, relationships).
  • Serves as the foundation for design models.

Requirements

Should be: - Necessary, clear, complete, verifiable, traceable.
- Divided into functional and non-functional categories (FURPS model).

Use Case Model

Describes functional requirements via actors and use cases.


Lecture 7 — Software Architecture Basics

Architectural Concepts

  • Defines system structure, main components, and their interactions.
  • Architecture influences scalability, security, reusability, and maintainability.

Common Architectural Styles

  • Layered Architecture
  • Client-Server
  • Microservices
  • Model-View-Controller (MVC)
  • Event-driven systems

Lecture 8 — Design Principles and Patterns

SOLID Principles

  1. Single Responsibility Principle – each class has one reason to change.
  2. Open/Closed Principle – classes open for extension, closed for modification.
  3. Liskov Substitution Principle – subclasses should be usable via their base types.
  4. Interface Segregation Principle – no unnecessary dependencies.
  5. Dependency Inversion Principle – depend on abstractions, not concretions.

Key Design Patterns

  • Observer: Notify dependent objects of state changes.
  • Factory Method: Delegate object creation to subclasses.
  • Singleton: Ensure one instance of a class.
  • Strategy: Encapsulate algorithms for interchangeability.

Lecture 9 — System Design and Iterative Development

Iterative and Incremental Development

  • Each iteration refines the design and adds working functionality.
  • Commonly used in Unified Process (UP) and Agile methods.

Architectural Documentation

Includes: - Component and deployment diagrams.
- Sequence and class diagrams.
- Design rationale and key trade-offs.

Final Remarks

  • Software architecture links requirements, design, and implementation.
  • Good design balances theory, patterns, and practical constraints.

End of Summary
Compiled from lecture slides by Ants Torim, TalTech.