Structural Modeling
Structural modeling represents the static aspects of a system by focusing on describing the system objects and their relationships. Unlike functional models that represent behavior, structural models capture the essential elements like people, places, and things within the system.
Classes, Attributes, and Operations
Classes are the fundamental building blocks of structural models and consist of three main elements:
- Classes
Templates for instances of people, places, or things - Attributes
Properties that describe the state of an object - Operations
Actions or functions that a class can perform
Relationships
There are three fundamental types of relationships in UML:
- Generalization
- Represents "a-kind-of" relationships
- Enables inheritance of attributes and operations
- Example: A savings account is a kind of bank account
- Aggregation
- Represents "a-part-of" relationships
- Shows how parts relate to wholes
- Example: A wheel is part of a car
- Association
- Represents general relationships between classes
- Usually weaker than aggregation
- Example: A student enrolls in a course
CRC Cards
CRC (Class-Responsibility-Collaboration) cards are physical or digital index cards used to document:
Front

Back

Class Diagrams
Notation

Access Modifiers

Relations (Arrows)

Association
Class1 and Class2 is related in some way
Can also have a no fill arrow to show the direction

Inheritance
SubClass1 and SubClass2 both inherit from SuperClass

Aggregation
Class1 is part of Class2
(The one with the diamond is part of, the aggregated)

Composition
Class1 cannot exist without Class2 and vice versa


Seven Steps to Structural Models
- Create CRC Cards
- Document initial classes and responsibilities
- Identify collaborations
- Review CRC Cards
- Look for missing elements
- Validate relationships
- Role-play the CRC Cards
- Simulate scenarios
- Identify gaps and issues
- Create the Class Diagram
- Transform CRC cards into formal notation
- Add relationships and multiplicities
- Review the Class Diagram
- Remove unnecessary elements
- Simplify where possible
- Incorporate Patterns
- Apply known solutions to common problems
- Leverage existing designs
- Review and Validate
- Check against requirements
- Verify with stakeholders