Chapter 6 - Object Modeling
📦 Chapter 6 — Object Modeling Cheat Sheet
DES329 System Analysis & Design | Final Exam Prep
🧠 Why Object-Oriented Analysis?
Object-Oriented (OO) Analysis describes an information system using objects — real-world things that matter to the system.
| Why OO? | Benefit |
|---|---|
| Matches real-world thinking | Easier for analysts + developers to align |
| Modular design | Each object is independent → easy to maintain |
| Reusable components | Objects/classes can be reused across systems |
| Integrates with OO languages | Works directly with Java, Python, Swift, C++ |
End product = an Object Model: a full picture of the system using objects and OO concepts.
🧱 Core Building Blocks
Object
A person, place, event, or transaction that is significant to the information system.
Each object has:
- Attributes — what it knows (data/characteristics)
- Methods — what it does (functions/behaviors)
- Instance — a specific real occurrence of that object
Example:
| PARENT object | STUDENT object | |
|---|---|---|
| Attributes | Name, Age, Sex, Hair color | Name, Age, GPA, Student ID |
| Methods | Read bedtime story, Drive carpool | Register for class, Pay fees |
| Instance | Mary Smith (25, Female, Red hair) | Google Intakaew (21, Male) |
🍎 Analogy: An object is like a blueprint + an actual product. The PARENT class is the blueprint; Mary Smith is the built product (instance).
Attributes
Characteristics that describe an object. They define the object's current state.
- Determined during the development process
- An object's state = the current values of all its attributes at a given moment
🔧 Think of attributes as columns in a database row — they describe what the object looks like right now.
Methods
Tasks or functions that an object performs when it receives a message/command.
Each method = a series of steps.
Example — MORE FRIES method:
- Heat oil
- Fill fry basket with frozen potato strips
- Lower basket into hot oil
- Check for readiness
- Raise basket when ready, let drain
- Pour fries into warming tray
- Add salt
🍎 Analogy: Methods are like the instructions on a machine — you press a button (send a message), and the machine knows exactly what to do internally.
Messages
A command that tells an object to perform a method. It triggers behavior without specifying how it's done internally.
Why messages? → They allow objects to interact without knowing each other's internals.
This leads to two key concepts:
🔀 Polymorphism
The same message sent to different objects produces different results.
| Message | Object | Behavior |
|---|---|---|
GOOD NIGHT | PARENT | Reads a bedtime story |
GOOD NIGHT | DOG | Goes to sleep |
GOOD NIGHT | CHILD | Gets ready for bed |
🍎 Why use it? You don't need to write separate
goodNightParent(),goodNightDog()commands — one message, smart routing.
📦 Encapsulation
An object is a black box — all data and methods are self-contained. You only need to know what message to send, not how it works inside.
🍎 Real-world analogy: A microwave. You press "2 minutes" (send a message). You don't need to know how the magnetron generates microwaves. The internal process is hidden.
🗂️ Classes, Subclasses, and Superclasses
Class
A group/category that objects belong to. All objects in a class share the same attributes and methods.
Superclass vs Subclass
| Term | Meaning |
|---|---|
| Superclass | The general parent class (e.g., VEHICLE) |
| Subclass | A more specific child class (e.g., CAR, TRUCK) |
Example — VEHICLE hierarchy:
VEHICLE (Superclass)
Attributes: Make, Model, Year, Weight, Color
Methods: Start, Stop, Park
├── CAR (inherits all VEHICLE attributes)
├── MINIVAN (inherits all VEHICLE attributes)
├── TRUCK (+ Load limit attribute)
└── SCHOOL BUS (+ Emergency exit location attribute)
Example — Fitness Center hierarchy:
PERSON (Superclass)
Attributes: Name, Date of birth
Methods: Breathe, Eat, Sleep
└── EMPLOYEE (Class)
Attributes: SSN, Telephone, Hire date, Title, Pay rate
Methods: Get hired, Terminate, Change telephone
└── INSTRUCTOR (Subclass)
Attributes: Instructor type, Availability
Methods: Teach fitness-class
🍎 Analogy: Superclass = a job description template. Subclass = a specific role (like "Senior Instructor") that inherits the general requirements and adds its own.
🔗 Relationships Among Objects and Classes
Inheritance (Strongest Relationship)
A child class derives attributes and methods from a parent class, and can add its own.
Example — INSTRUCTOR inherits from EMPLOYEE:
| Attribute/Method | Source |
|---|---|
| SSN, Telephone, Hire date, Title, Pay rate | ✅ Inherited from EMPLOYEE |
| Get hired, Terminate, Change telephone | ✅ Inherited from EMPLOYEE |
| Type of Instructor | ➕ New — added by INSTRUCTOR |
Why inheritance? → Avoid repeating the same attributes. Define once in the parent; all children get it for free.
Object Relationship Diagram — Fitness Center
📸 Include Figure 6-10 from textbook here
Key relationships to memorize:
EMPLOYEE→ is a →MANAGER,OFFICE STAFF,INSTRUCTORMANAGER→ determines →FITNESS-CLASS SCHEDULEINSTRUCTOR→ teaches →FITNESS-CLASSOFFICE STAFF→ administers →REGISTRATION RECORDREGISTRATION RECORD→ generates roster →FITNESS-CLASSREGISTRATION RECORD→ adds →STUDENTSTUDENT→ takes →FITNESS-CLASS
📐 UML — Unified Modeling Language
UML = a standard visual language for describing OO systems using symbols and diagrams.
Why UML? → Everyone (analyst, developer, client) can read the same diagram format. It's the universal language of system design.
There are 6 main diagram types in this chapter:
1. 🎭 Use Case Modeling
Describes who does what in the system — a step-by-step description of a business function.
- Use Case = one specific business function/process
- Actor = external entity (person/system) that initiates the use case (drawn as a stick figure)
- Actor → arrow → Use Case (oval)
Use Case Description Fields:
| Field | What It Covers |
|---|---|
| Name | Name of the use case |
| Actor | Who triggers it |
| Description | Brief summary |
| Successful completion | Step-by-step happy path |
| Alternative | What happens when the main path fails |
| Precondition | What must be true before it starts |
| Postcondition | What is true after it completes |
| Assumptions | Any assumed conditions |
Example — ADD NEW STUDENT:
| Field | Content |
|---|---|
| Actor | Student / Manager |
| Precondition | Student requests fitness-class |
| Successful path | 1. Manager checks schedule → 2. Notifies student → 3. Student pays → 4. Manager registers student |
| Alternative | 1. Manager checks schedule → 2. Class is full → 3. Manager notifies student |
| Postcondition | Student enrolled and fees paid |
🍎 Analogy: Use cases = user stories in Agile ("As a student, I want to register for a class") — but more structured and formal.
2. 🗺️ Use Case Diagrams
A visual summary of multiple related use cases in a system or subsystem.
- Rectangle = system boundary (inside = in-scope, outside = out-of-scope)
- Actors outside the rectangle
- Use cases inside the rectangle
📸 Include Figure 6-15 (Auto Service Department) from textbook here
Actors: Customer, Service Writer, Mechanic
Use Cases: Create Work Order, Update Work Schedule, Prepare Invoice
Why use case diagrams? → Quickly shows the scope of the system and who interacts with what.
3. 🏗️ Class Diagrams
Shows the object classes, their attributes/methods, and relationships for a use case.
Each class = a rectangle with 3 sections:
┌─────────────────┐
│ Class Name │ ← Top
├─────────────────┤
│ Attributes │ ← Middle
├─────────────────┤
│ Methods │ ← Bottom
└─────────────────┘
Lines between classes show relationships, labeled with cardinality.
Cardinality Notations (MEMORIZE THESE):
| Notation | Meaning | Example |
|---|---|---|
0..* | Zero or many | An employee can have 0 or many payroll deductions |
0..1 | Zero or one | An employee can have 0 or 1 spouse |
1 | One and only one | An office manager manages exactly 1 office |
1..* | One or many | One order includes 1 or more items |
📸 Include Figure 6-17 (Sales Order Class Diagram) from textbook here
Key relationships in the Sales Order example:
Sales Managermanages (1 → 0..*)Sales RepSales Repassigned to (0..* ↔ 0..*)CustomerCustomerplaces (1) →OrderOrderincludes (0..* → 1..*)Items Ordered
🍎 Analogy: Class diagrams are like ERDs in databases — same concept (relationships + cardinality), just OO notation.
4. ⏱️ Sequence Diagrams
A dynamic model showing how classes interact over time during a use case — who sends what to whom and in what order.
Key Symbols:
| Symbol | Meaning |
|---|---|
| Rectangle (top) | Class/Object |
| Dashed vertical line | Lifeline — time the object exists and can interact |
| Arrow | Message — labeled with what is communicated |
| Narrow rectangle on lifeline | Focus — when messages are actively sent/received |
X at bottom of lifeline | Object is destroyed / interaction ends |
Example — ADD NEW STUDENT Sequence:
STUDENT MANAGER FITNESS-CLASS SCHEDULE REGISTRATION RECORD
| | | |
|--Request fitness-class--> | |
| |--Check schedule-->| |
| |<--Schedule info---| |
|<--Notify-----| | |
|--Pay-------->| | |
| |--Register------------------------>| |
| | | X (ends) |
📸 Include Figure 6-19 from textbook here
🍎 Analogy: Sequence diagrams = network packet flow diagrams. You can trace exactly who sent what, to whom, and in what order — like wireshark for business logic.
Why use sequence diagrams vs class diagrams?
Class diagrams show structure (what exists). Sequence diagrams show behavior over time (what happens when). You need both.
5. 🔄 State Transition Diagrams
Shows how an object changes state based on events. Documents all possible states and what triggers transitions between them.
- Rounded rectangles = states
- Arrows = transitions triggered by events
Example — ORDER object states:
[New Order] --payment received--> [Confirmed] --shipped--> [In Transit] --delivered--> [Completed]
|
[Cancelled] <--cancellation request--
🍎 Analogy: Like a traffic light FSM (Finite State Machine) — it's always in one state (Red/Yellow/Green), and specific events trigger transitions.
Why use it? → Ensures you've handled every possible scenario an object can be in. Great for catching edge cases before coding.
6. 🔀 Activity Diagrams
Shows actions and events as they occur, in order — including decisions and outcomes.
- Very similar to flowcharts, but in UML notation
- Shows parallel processes and conditional branching
Example — ATM Cash Withdrawal:
Start
→ Customer inserts ATM card
→ [Card accepted?]
YES → Customer enters PIN
→ [PIN accepted?]
YES → Customer requests cash amount
→ [Sufficient funds?]
YES → ATM provides cash → ATM adjusts balance → End
NO → ATM notifies customer → End
NO → Card returned → End
NO → Card returned → End
📸 Include Figure 6-21 (ATM Activity Diagram) from textbook here
🍎 Analogy: Activity diagrams = flowcharts with UML clothes. If you can draw a flowchart, you can draw an activity diagram.
When to use activity vs sequence?
Activity = shows what steps happen in a process (like a workflow).
Sequence = shows which objects talk to each other in what order.
7. 🏢 Business Process Modeling (BPM)
Models the people, events, and interactions in an entire business workflow — not just one use case.
- Can be used at any point during development
- Compatible with object modeling (not a replacement)
- Great for visualizing end-to-end processes across departments
Why BPM vs Use Case?
Use cases = narrow, one function at a time.
BPM = wide view, entire business process from start to finish.
🛠️ Tools for Object Modeling
Object modeling generates many diagrams — doing this manually is slow and error-prone.
CASE Tools (Computer-Aided Software Engineering):
- Speed up diagram creation
- Provide a consistent framework for documentation
- Help validate and cross-check model consistency
Examples in practice: Lucidchart, Visual Paradigm, StarUML, Enterprise Architect
📊 Quick Comparison — When to Use Which Diagram?
| Diagram | Shows | Use When |
|---|---|---|
| Use Case | Who does what (text form) | Defining system scope and user interactions |
| Use Case Diagram | Visual overview of use cases + actors | Showing system boundary and actor relationships |
| Class Diagram | Structure — classes, attributes, methods, relationships | Designing the static data model |
| Sequence Diagram | Dynamic — object interactions over time | Tracing message flow in a specific scenario |
| State Transition | Object state changes | Modeling lifecycle of a key object |
| Activity Diagram | Process flow with decisions | Modeling workflows and conditional logic |
| BPM | Full end-to-end business process | Modeling organizational workflows |
📝 Key Definitions (Exam-Ready)
| Term | Definition |
|---|---|
| Object | A person, place, event, or transaction significant to the information system |
| Attribute | A characteristic that describes an object; defines its current state |
| Method | A task/function the object performs when it receives a message |
| Message | A command that triggers a method; enables objects to interact |
| Polymorphism | Same message → different behavior depending on which object receives it |
| Encapsulation | All data and methods are self-contained; internal workings are hidden |
| Class | A group of objects sharing common attributes and methods |
| Superclass | The general parent class |
| Subclass | A more specific child class that inherits from the superclass |
| Inheritance | The strongest OO relationship; child derives attributes/methods from parent |
| Instance | A specific, real occurrence of an object |
| State | The current values of all of an object's attributes at a given moment |
| UML | Unified Modeling Language — standard visual notation for OO systems |
| Actor | External entity (user/system) that initiates a use case |
| Lifeline | Dashed line in a sequence diagram showing how long an object is active |
| Cardinality | The numerical relationship between two classes (e.g., 1 to many) |
| CASE Tools | Software tools that support and speed up object modeling |