Class Diagram and Object Diagram

  • Class is a category or group of things that have similar attributes and common behaviors
  • Object is an instance of a class; specific thing that has specific values of the attributes and behavior


    Example of the UML Class Diagram
    Washing Machine
    brandName
    modelName
    serialNumber
    capacity
    addClothes()
    addDetergent()
    removeClothes()
    turnOn()
    <--class name

    <--attribute (key attributes are underlined)


    {capacity=16 or 18 or 20lbs}

    <--operations



    Example of the UML Object Diagram
    <--name of instance on left, name of the class on the right
    My Washer:Washing Machine
    Maytag:BrandName
    Ultima:ModelName
    a1054:SerialNumber
    20lbs:Capacity
    addClothes()
    addDetergent()
    removeClothes()
    turnOn()