Software Modelling and Design

Summary

Table of Contents

Use Cases

Level of Detail

Use case variants

Actors

Importance

Use case Model

Use case Diagram

Use case diagram

Use case notation

Relevance of Use cases

To check whether use-cases are at the right level for application requirements analysis, you can apply a number of tests.

Example:

Include relationship

Extensions: 

6b. Paying by credit: Include Handle Credit Payment.

Use case include relationship

Extend relationship

Use case extend and include

OO Analysis

Domain Models

Identifying conceptual classes

Approaches:

Associations

Attributes

Creating a Domain Model

  1. find conceptual classes
  2. draw as classes in UML class diagram
  3. add associations and attributes

Description Class

Description class example 1

Description class example 2

System Sequence Diagrams

System Sequence Diagram

Communication Diagrams

Closest Store: System Sequence Diagram vs System Communication Diagram

System Sequence diagram

System Communication Diagram

Pickup before close: SSD vs SCD

SSD

SCD

Combined System Communication Diagram

SCD

Message Sequence Numbers

SSD

SSD

Sequence vs Communication diagram

Object-Oriented Design Models

OO Domain Models

OO Design Models

Input Artefacts to OO design

OO Software Design

Output Artefacts of OOSD

Static Design Models

Comparison to Domain models

Dynamic Design Models

SSD vs DSD

Lifeline Notation

Lifeline Notation

Reference frames

Reference Frames

Loop frames

Loop Frame

OO Implementation

Translating design models to code

Visibility

Achieving visibility

A can get visibility of B in 1 of 4 ways:

  1. B is an attribute of A
  2. B is a parameter of a method of A
  3. B is a (non-parameter) local object in a method of A
  4. B has global visibility

State Machines

When to apply state machine diagrams?

UML Details

Transition actions and guards

Nested States

Choice Pseudostate

Implementation Details

Implementation

public class IncreasingPairFinder {
  // enum for all the states of the state machine
  enum State { STATE1, STATE2, FINAL }
  // initialise to start state
  State state = State.STATE1;
  int lastX;

  // trigger
  public void eventA(int x) { 
    if (state == State.STATE1) {
      // action
      lastX = x;
      // transition
      state = State.STATE2;
    } else if (state == State.STATE2) {
      // condition
      if (x > lastX) {
        // action
        otherClass.doStuff(x - lastX);
        // transition
        state = State.STATE1;
      }
    } 
  }

  public void eventB() {
    if (state == State.STATE1) {
      state = State.FINAL;
    }
  }
}

Architecture

Software Architecture

Architectural Analysis

Architectural analysis identifies and analyses:

Architecturally significant functional requirements

Architecturally significant Non-functional Requirements

Effects of requirements on design

Steps

Priorities

Architectural Factor Table

Fields

Technical Memo

Contents

Logical Architecture

Layered architecture

UML Package Diagram

Layers and Partitions

Package nesting

Information Systems - Typical Logical Architecture

IS Logical Architecture

UML Packages to code

UML Component Diagram - Implementation View

UML Components

UML Components

UML Components 2

Distributed Architectures

Distributed Architectures

Client-server

Client-server

Tiered Client-server

Tiered Client-server

Peer-to-Peer

P2P

Pipeline

Pipeline Architecture

Architectural Improvement

Strategies

Options that might be considered: buy, build, modify

Handling issues: some ideas

Modelling and Design in the Software Process

Unified Process

Artefacts

Sample Artefact Timeline

Inception

Artefacts

[Bold means mandatory]

You’re doing it wrong:

  1. more than a few weeks spent
  2. attempted to define most requirements
  3. expect estimates to be reliable
  4. defined the architecture
  5. tried to sequence the work: requirements, then architecture, then implement
  6. you don’t have a business case/vision
  7. you wrote all uses cases in detail
  8. you wrote no use cases in detail

Elaboration

Spreading use cases across Iterations

Artefacts

You’re doing it wrong:

  1. more than a few months long
  2. only has 1 iteration
  3. most requirements were defined before elaboration
  4. risky elements/core architecture are not being addressed
  5. not production code
  6. considered requirements/design phase, preceding implementation
  7. attempt to design fully before programming
  8. minimal feedback/adaptation
  9. no early/realistic testing
  10. architecture is speculatively finalised, before implementation

Test-Driven Development and Refactoring

Test-Driven Development

Advantages

Unit test the Sale class

Refactoring

Code smells

Code smells are suggestive of a need to refactor

Refactorings

There are many named refactorings.

UML Notes

Class Diagrams

Dependency

Composite Aggregation

Composite Aggregation


Edit this page.