ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    Object Oriented Analysis and Design
    COMP3150
    Progress0 / 17 topics
    Topics
    1. Principles of Object Technology2. OOP Review3. Principles of Modeling4. OOA&D Overview5. OO Development Process6. Requirements Engineering: Use Cases and Prototyping7. Class Models8. Interaction Diagrams9. Verification and Validation10. Architectural and Detailed Design11. Class Diagrams12. State Machines and Diagrams13. Implementation and Package Diagrams14. Activity Diagrams15. OO Patterns16. Object Diagram, Component Diagram, and Deployment Diagram17. Network Diagram
    COMP3150›Class Models
    Object Oriented Analysis and DesignTopic 7 of 17

    Class Models

    3 minread
    503words
    Beginnerlevel

    📘 Class Models (OOAD)


    🔹 1. Definition

    A Class Model is a static representation of a system that shows:

    • Classes
    • Attributes (data)
    • Methods (functions)
    • Relationships between classes

    👉 Simple idea: It describes the structure of the system (what it is made of), not how it behaves.


    🔹 2. What is a Class?

    A class is a blueprint for creating objects.

    Example:

    Class: Student
    - name
    - rollNo
    + study()
    + attendClass()
    

    🔹 3. Components of a Class Model


    🔸 3.1 Class

    Represented as a rectangle divided into 3 parts:

    -----------------
    | Class Name     |
    -----------------
    | Attributes     |
    -----------------
    | Methods        |
    -----------------
    

    🔸 3.2 Attributes

    • Properties of a class
    • Represented as variables

    Example:

    • name
    • age

    🔸 3.3 Methods (Operations)

    • Functions that define behavior

    Example:

    • display()
    • calculate()

    🔹 4. Relationships in Class Models ⭐


    🔸 4.1 Association

    Definition: A general relationship between two classes.

    Example:

    Teacher —— Student
    

    👉 A teacher teaches students


    🔸 4.2 Multiplicity

    Shows how many objects are involved.

    Notation Meaning
    1 One
    0..1 Zero or one
    1..* One or many
    * Many

    🔸 4.3 Aggregation

    Definition: A weak “has-a” relationship (part can exist independently).

    Example:

    Classroom ◇—— Student
    

    👉 Students can exist without classroom


    🔸 4.4 Composition

    Definition: A strong “has-a” relationship (part cannot exist independently).

    Example:

    House ◆—— Room
    

    👉 Room cannot exist without house


    🔸 4.5 Inheritance (Generalization)

    Definition: One class inherits from another.

    Example:

    Vehicle
      ↑
    Car
    

    🔸 4.6 Dependency

    Definition: One class depends on another temporarily.


    🔹 5. Types of Class Models


    🔸 5.1 Conceptual Class Model

    • High-level
    • No implementation details

    🔸 5.2 Design Class Model

    • Detailed
    • Includes methods and data types

    🔸 5.3 Implementation Class Model

    • Close to actual code

    🔹 6. Steps to Create a Class Model


    🔹 Step 1: Identify Classes

    • Find nouns in problem statement

    🔹 Step 2: Define Attributes

    • Identify properties

    🔹 Step 3: Define Methods

    • Identify actions

    🔹 Step 4: Establish Relationships

    • Association, inheritance, etc.

    🔹 Step 5: Add Multiplicity

    • Define how many objects relate

    🔹 7. Example (Library System)


    🔹 Classes:

    • Book
    • Member
    • Librarian

    🔹 Class Diagram:

    Book
    - title
    - author
    + issue()
    
    Member
    - name
    + borrow()
    
    Relationship:
    Member —— borrows —— Book
    

    🔹 8. Advantages of Class Models

    • Clear system structure
    • Easy to understand
    • Supports code development
    • Helps in maintenance

    🔹 9. Important Rules / Guidelines

    • Keep classes simple and meaningful
    • Avoid too many attributes
    • Use proper relationships
    • Maintain high cohesion & low coupling

    🔹 10. Likely Exam Questions

    1. Define class model.
    2. Explain components of a class diagram.
    3. What is association? Explain with example.
    4. Difference between aggregation and composition.
    5. Explain inheritance in class models.
    6. What is multiplicity?
    7. Steps to create a class model.
    8. Types of class models.
    9. Draw a class diagram for a simple system.
    10. Advantages of class modeling.

    🔹 11. Quick Revision Summary 🧠

    • Class Model = Structure of system

    • Shows:

      • Classes
      • Attributes
      • Methods
      • Relationships

    Key Relationships:

    • Association
    • Aggregation
    • Composition
    • Inheritance

    👉 Trick: "CAAMID" (C → Class, A → Attributes, A → Association, M → Methods, I → Inheritance, D → Dependency)


    Previous topic 6
    Requirements Engineering: Use Cases and Prototyping
    Next topic 8
    Interaction Diagrams

    Past Papers

    Open this section to load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time3 min
      Word count503
      Code examples0
      DifficultyBeginner