Software Design and Implementation: An Overview

Chapter 7: Software Design and Implementation

Introduction

This chapter explores the design and implementation stage of software development, where an executable software system is created.

Software Design

Software design is a creative process where software components and their relationships are defined based on customer requirements. Implementation translates this design into a functional program.

Object-Oriented Design (OOD)

Object-oriented design is a popular approach, particularly beneficial for large systems. However, it can be resource-intensive and may not be suitable for smaller projects.

Stages in OOD:

  1. Define the system’s context and usage patterns.
  2. Design the system architecture.
  3. Identify the primary system objects.
  4. Develop design models.
  5. Specify object interfaces.

A system context model (structural) illustrates the system’s interaction with other systems in its environment. An interaction model (dynamic) demonstrates how the system interacts with its environment during use.

Object Class Identification Approaches:

  1. Grammatical approach: Analyzes the natural language description of the system.
  2. Behavioral approach: Identifies objects based on their participation in system behavior.
  3. Scenario-based analysis: Identifies objects, attributes, and methods within specific scenarios.

Design Models

Design models visually represent objects, object classes, and their relationships. They can be categorized into:

  1. Static models: Describe the system’s structure in terms of object classes and relationships (e.g., class diagrams).
  2. Dynamic models: Illustrate the dynamic interactions between objects (e.g., sequence diagrams).

Examples of Design Models:

  • Subsystem models: Show the logical grouping of objects into subsystems using packages (UML).
  • Sequence models: Depict the sequence of interactions between objects.
  • State machine models: Illustrate how objects respond to service requests and their state transitions. Useful for high-level modeling but can introduce unnecessary detail if used excessively.

Key Points:

  • Software design and implementation are intertwined activities. The design’s detail level depends on the system’s complexity and the development approach (plan-driven or agile).
  • OOD involves designing the architecture, identifying objects, creating object models, and documenting component interfaces.
  • Various models are used in OOD, including static models (class, generalization, association) and dynamic models (sequence, state machine).
  • Component interfaces must be well-defined for seamless interaction with other objects. UML interface stereotypes can be used for this purpose.

Design Patterns

A design pattern provides a reusable solution to a commonly occurring problem in software design.

Pattern Elements:

  • Name
  • Problem description
  • Solution description
  • Consequences

Example: Observer Pattern

The Observer pattern addresses the problem of notifying multiple objects about changes in the state of another object.

Common Design Problems and Patterns:

  • Notifying objects about state changes: Observer pattern
  • Simplifying interfaces of related objects: Façade pattern
  • Standardized access to collection elements: Iterator pattern
  • Extending class functionality at runtime: Decorator pattern

Implementation Issues:

Reuse

Modern software development heavily relies on reusing existing code and components. Maximizing code reuse is crucial for efficient development.

Configuration Management

Managing different versions of software components is essential. Configuration management systems track changes, integrate different versions, and help manage bug reports.

Host-Target Development

Software is often developed on a host system and deployed on a separate target system. This requires specific tools and considerations.

Reuse Levels:

  • Abstraction level
  • Object level
  • Component level
  • System level

Configuration Management Activities:

  • Version management: Tracking different versions of components.
  • System integration: Defining component versions for each system version.
  • Problem tracking: Managing bug reports and issues.

Host-Target Development Platform Tools:

  • Integrated compiler and syntax-directed editors
  • Language debugging systems
  • Graphical editing tools
  • Testing tools
  • Project support tools