1. Introduction

Functional modelsStructural models
Represent system behaviorRepresent system objects and their relationships — people, places, things

Definition (Structural model)

  • Defines the key elements (things, ideas, concepts) of the problem domain and the relationships among them.
  • Creates a common vocabulary between analysts and users.
  • Main goal: identify the key data in the problem domain and build a model of the key objects and their relationships.

Drawn iteratively:

  1. Initial drawing — business-focused, conceptual view.
  2. Refinement — technology-focused view (databases, files).
  3. Progressive detail — more detail each iteration.

2. Classes, Attributes, Operations & Relationships

2.1 Basic Concepts

ConceptDefinition
ClassTemplate for instances of people, places or things
AttributeProperty describing the state of an instance (object)
OperationAction or function a class can perform
classDiagram
    class Box {
        -volume
        -material
        +fill()
        +empty()
    }

2.2 The Four Main Relationships

RelationshipMeaningExample
AssociationGeneral connectionStudent enrolls in Course
Generalization (inheritance)“is-a” / “a-kind-of” — inherits attributes and operationsCar is a Vehicle
Aggregation (shared)Weak “has-a” / “a-part-of” — part can exist without the wholeDepartment has Professors (they can move departments)
Composition (composite)Strong “has-a” — part cannot exist without the wholeHouse contains Rooms (destroy the house → rooms cease to exist)

3. Object Identification

Goal: identify the main objects (classes) of the problem domain.

3.1 Techniques

  1. Textual analysis (primary) — analyze the use cases:
    • Nouns → classes
    • Verbs → operations
    • Start with a rough list of candidate objects.
  2. Brainstorming (supporting) — team suggests extra ideas to find missing/unclear objects → initial class list → then define attributes, operations and relationships.

3.2 Common Object Types

TypeExamples
Physical thingsCar, Computer
Incidents (events)Order, Appointment
RolesCustomer, Doctor
InteractionsPayment, Booking

Patterns: reusable templates made of groups of collaborating classes; solve common problems and give a starting point for similar systems.

3.3 Textual Analysis Guidelines

Part of speechImplies
Common / improper nounA class
Proper noun / direct referenceAn instance of a class
Collective nounA class made of groups of instances of another class
AdjectiveAn attribute
Doing verbAn operation
Being verb (“is a”)Classification (generalization) relationship
Having verb (“has”)Aggregation or association
Transitive verbAn operation
Intransitive verbAn exception
Predicate / descriptive verb phraseAn operation
AdverbAn attribute of a relationship or operation

3.4 Worked Example — Make Old Patient Appt

Step 1: “The Patient contacts the office regarding an appointment.”

  • Classes: Patient, Office, Appointment
  • Operation: contactOffice()
  • Associations: Patient — Office, Patient — Appointment, Office — Appointment

Step 2: “The Patient provides the Receptionist with his or her name and address.”

  • Classes: Patient, Receptionist
  • Attributes: name, address
  • Operation: provideInformation()
  • Association: Patient — Receptionist
classDiagram
    class Patient {
        -name
        -address
        +contactOffice()
        +provideInformation()
    }
    class Office
    class Appointment
    class Receptionist
    Patient -- Office
    Patient -- Appointment
    Office -- Appointment
    Patient -- Receptionist

⚠ “Patient John Doe” — a proper noun is an instance (object diagram material), not a new class.


4. CRC Cards (Class–Responsibility–Collaboration)

Definition

Simple cards (one per class) used to build the structural model.

PartContentExample
ClassThe object modeledPatient, Appointment
Responsibilities — KnowingWhat the class knows → attributesPatient knows name, address
Responsibilities — DoingWhat the class does → operationsPatient books appointment
CollaborationClasses it works with to complete a taskPatient (requestor) asks for appointment; Receptionist (responder) schedules it

4.1 Example Card — Old Patient

Front side

Class Name: Old PatientID: 3Type: Concrete, Domain
Description: An individual who needs to receive or has received medical attentionAssociated Use Cases: 2
ResponsibilitiesCollaborators
Make appointmentAppointment
Calculate last visit
Change status
Provide medical historyMedical History

Back side

Attributes
Amount (double)Insurance carrier (text)
Relationships
Generalization (a-kind-of)Person
Aggregation (has-parts)Medical History
Other associationsAppointment

Translated to a class diagram:

classDiagram
    Person <|-- OldPatient
    OldPatient o-- MedicalHistory : has-parts
    OldPatient -- Appointment
    class OldPatient {
        -amount : double
        -insuranceCarrier : text
        +makeAppointment()
        +calculateLastVisit()
        +changeStatus()
        +provideMedicalHistory()
    }

4.2 CRC Cards & Role-Playing

After creating the cards, role-play use-case scenarios: team members take the roles of actors and objects and act out each step (using the activity diagrams). This discovers missing objects, attributes, operations, relationships and tests whether the model is clear and complete.

  1. Choose the most important use case.
  2. Assign roles (actors and classes).
  3. Perform each step of the scenario.
  4. Discover and fix problems until it concludes successfully.
  5. Repeat for the remaining use cases.

5. Class Diagrams

Definition

A static model showing classes and their relationships.

  • Classes — objects in the system; contain attributes (name, address) and operations (createAppointment()).
  • Relationships — lines between classes, with multiplicity (e.g., one Patient → many Appointments).

Example — appointment system (simplified from the slide’s sample class diagram):

classDiagram
    Participant <|-- Employee
    Participant <|-- Patient
    Employee <|-- Doctor
    Employee <|-- Receptionist
    Employee <|-- Nurse
    Patient "1" -- "0..*" Appointment : schedules
    Appointment "0..*" -- "1" Doctor : assignedTo
    Patient "0..*" -- "1..*" Symptom : suffers
    Patient "1" *-- "1" MedicalHistory : provides
    class Participant {
        -lastname
        -firstname
        -address
        -phone
        -birthdate
        -/age
    }
    class Patient {
        -amount
        -insuranceCarrier
        +makeAppointment()
        +calculateLastVisit()
        +changeStatus()
        +provideMedicalHistory()
    }
    class Appointment {
        -time
        -date
        -reason
        +cancelWithoutNotice()
    }
    class MedicalHistory {
        -heartDisease
        -highBloodPressure
        -diabetes
        -allergies
    }

5.1 Types of Classes

TypeRuleNotation
AbstractCannot be instantiated; used as a base className in italics
RootCannot have a parent; top of hierarchy<<root>>
LeafCannot have children; bottom of hierarchy<<leaf>>

5.2 Attributes

  • Properties describing an object’s state (Participant → firstName, lastName, address).
  • Derived attribute: computed from others, shown with a slash: /age (derived from birthdate).

5.3 Operations

Written with parentheses that may hold parameters.

TypeEffect on state
ConstructorCreates and initializes an object
QueryRetrieves information — does not change state
UpdateModifies attributes — changes state
DestructorDeletes/removes an object

⚠ Common operations available to every class (create/delete instance, getters/setters) are not shown. Only operations unique to the class appear.

5.4 Visibility

Controls who can access an attribute/operation (protects data, ensures consistency). UML has no default visibility — it must be specified.

SymbolVisibilityAccessible from
+PublicAll classes
−PrivateSame class only
#ProtectedSame class and subclasses
~PackageClasses in the same package

5.5 Scope

ScopeMeaningNotationExample
Instance (default)Each object has its own copy; invocation may affect the instance’s statenormalEach Applicant has its own name
Class (static)One shared value for all objects; invocation doesn’t affect the classifier’s stateunderlinedorigin : Point = (0,0) shared by all points

5.6 Multiplicity of Attributes

How many values an attribute can hold for one object:

  • address [2] → exactly 2 addresses
  • address [0..*] → zero or many

Worked example — putting §5.2–5.6 together:

classDiagram
    class Applicant {
        -name : String
        -address [0..*] : String
        -birthdate : Date
        -/age : int
        +count$ : int
        +Applicant(name)
        +getAge() int
        +changeAddress(newAddr)
    }
  • -name → private, instance scope.
  • address [0..*] → attribute multiplicity.
  • /age → derived from birthdate.
  • count$ → class (static) scope — rendered underlined in UML.
  • Applicant(name) constructor · getAge() query · changeAddress() update.

6. Relationships in Class Diagrams

  • A line between classes, named (e.g., IsLocatedIn).
  • A class can relate to itself (Employee manages Employee).
  • Can be directional — a small triangle shows reading direction (“Spare Tire is located in Trunk”, not the opposite).
  • Multiplicity = number of instances of one class associated with one instance of the other.

Example — sample associations

classDiagram
    Invoice "0..*" -- "1" PurchaseOrder : AssociatedWith
    Pilot "0..*" -- "0..*" Aircraft : Flies ▸
    SpareTire "0..1" -- "0..1" Trunk : IsLocatedIn ▸

6.1 Multiplicities

MeaningNotationExample
Exactly one1A Department has one and only one Boss
Zero or more0..*An Employee has zero to many Children
One or more1..*A Boss is responsible for one or more Employees
Zero or one0..1An Employee can be married to zero or one Spouse
Specified range2..4An Employee takes two to four Vacations per year
Multiple, disjoint ranges1..3,5An Employee is a member of one to three or five Committees

Reading rule: the multiplicity is written next to the class it counts. In Department "1" -- "1" Boss, the 1 beside Boss says each department has exactly one boss.

⚠ Read each end separately: Patient "1" -- "0..*" Appointment means one patient has 0..* appointments and each appointment belongs to exactly 1 patient.

6.2 Generalization, Aggregation, Composition

GeneralizationAggregationComposition
MeaningSubclass inherits from superclassWeak logical “part-of”Strong physical “part-of”
Part independent?—YesNo
NotationHollow triangle at the superclassHollow diamond ◇ at the wholeFilled diamond ◆ at the whole
ExampleCar → VehicleTeam has PlayersHouse has Rooms

Generalization hierarchy:

classDiagram
    Vehicle <|-- Land
    Vehicle <|-- Air
    Vehicle <|-- Sea
    Land <|-- Truck
    Land <|-- Car
    Air <|-- Plane
    Air <|-- Helicopter
    Sea <|-- Ship
    Sea <|-- Submarine

Aggregation (◇) vs. composition (◆):

classDiagram
    Department "1..*" o-- "1..*" Employee : IsPartOf
    Vehicle "1" o-- "1..*" Wheel : IsPartOf
    Office "1" o-- "0..*" Desk : IsPartOf
    Car "1" *-- "1..*" Door : IsPartOf
    Building "1" *-- "1..*" Room : IsPartOf
    Mouse "1" *-- "1..*" Button : IsPartOf

⚠ The diamond goes on the whole, never on the part. Test: “if the whole is destroyed, does the part disappear?” Yes → composition; No → aggregation.

6.3 Roles in Relationships

A role describes what a class does in a relationship; written near the class at the end of the association line.

classDiagram
    Citizen "0..* owner" -- "1..* ownedBy" Car

Citizens play the role owner; Cars play the role ownedBy.


7. Object Diagrams

Definition

Like a class diagram but with real instances and actual attribute values.

  • Class: Doctor → Object: Dr. Smith : Doctor.
  • Used to discover missing attributes, relationships or operations, or misplaced ones.

Worked example — instances of the appointment class diagram:

flowchart LR
    JD["<u>John Doe : Patient</u><br/>lastname = Doe<br/>firstname = John<br/>address = 1000 Main St<br/>phone = 555-555-5555<br/>birthdate = 01/01/72<br/>/age = 40<br/>amount = 0.00<br/>insurance carrier = JD Health Ins"]
    A1["<u>Appt1 : Appointment</u><br/>time = 3:00<br/>date = 7/7/2012<br/>reason = Pain in Neck"]
    DS["<u>Dr. Smith : Doctor</u><br/>lastname = Smith<br/>firstname = Jane<br/>address = Doctor's Clinic<br/>phone = 999-999-9999<br/>birthdate = 12/12/64<br/>/age = 48"]
    S1["<u>Symptom1 : Symptom</u><br/>name = Muscle Pain"]
    JD --- A1
    A1 --- DS
    JD --- S1

Issues found by reviewing the instances

IssueFix
1. Appointment has a reason attribute (“Pain in Neck”)Model Reason as a class associated with both Symptom and Appointment
2. Symptom is associated with PatientA symptom (e.g., “muscle pain”) occurs across many patients → link Symptom to the Appointment (or its reason), not to one patient

Updated class diagram: Patients have Appointments; each Appointment can involve multiple Symptoms.

classDiagram
    Patient "1" -- "0..*" Appointment : schedules
    Appointment "0..*" -- "1..*" Symptom : involves
    Appointment "0..*" -- "1" Doctor : assignedTo

8. Steps to Create Structural Models

flowchart LR
    A[1. Create CRC cards] --> B[2. Review cards<br/>find missing items]
    B --> C[3. Role-play<br/>fix breakdowns]
    C --> D[4. Create class diagram]
    D --> E[5. Review diagram<br/>remove unnecessary items]
    E --> F[6. Review & validate]
    C -.->|new cards| A
  1. Create CRC cards.
  2. Review them — identify missing objects, attributes, operations, relationships.
  3. Role-play the cards — look for breakdowns, correct, create new cards.
  4. Create the class diagram.
  5. Review it — remove unnecessary classes, attributes, operations, relationships.
  6. Review and validate the model.

9. Verifying & Validating the Structural Model

The analyst walks through the model with developers and users, explaining the reasoning behind each class.

#Rule (CRC card → class diagram)
1Each CRC card ⇒ a class in the diagram
2Responsibilities (front) ⇒ operations
3Collaborators (front) ⇒ imply the relationships listed on the back
4Attributes (back) ⇒ attributes in the diagram
5Each attribute on the back has a data type (e.g., name is a string)
6Relationships (back) correctly drawn — aggregation/association type and multiplicity

Worked example — checking the Old Patient card (§4.1) against its class (§4.1 diagram):

  • Card → class OldPatient ✓ (rule 1)
  • 4 responsibilities → 4 operations ✓ (rule 2)
  • Collaborators Appointment, Medical History → association + aggregation on the diagram ✓ (rules 3, 6)
  • amount : double, insuranceCarrier : text → typed attributes ✓ (rules 4, 5)
  • Generalization to Person drawn with hollow triangle ✓ (rule 6)