0% found this document useful (0 votes)
73 views22 pages

11-Class Diagram

This document discusses object-oriented programming concepts like class diagrams, encapsulation, inheritance, polymorphism, and relationships between classes. It provides examples of how to model an e-commerce system using classes, class attributes, and methods. It also describes how to extend the class diagram to add user states like new, active, and banned, as well as order statuses for tracking order fulfillment. The document is a lecture on object-oriented design patterns and modeling real-world systems using classes and relationships.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views22 pages

11-Class Diagram

This document discusses object-oriented programming concepts like class diagrams, encapsulation, inheritance, polymorphism, and relationships between classes. It provides examples of how to model an e-commerce system using classes, class attributes, and methods. It also describes how to extend the class diagram to add user states like new, active, and banned, as well as order statuses for tracking order fulfillment. The document is a lecture on object-oriented design patterns and modeling real-world systems using classes and relationships.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Rohail Qamar

OBJECT ORIENTED PROGRAMMING Lecturer


CLASS DIAGRAM (UML) [email protected]
CLASS DIAGRAM

OBJECT ORIENTED PROGRAMMING BY ROHAIL QAMAR 2


-
ENCAPSULATION (+,#, )

OBJECT ORIENTED PROGRAMMING BY ROHAIL QAMAR 3


INHERITANCE

OBJECT ORIENTED PROGRAMMING BY ROHAIL QAMAR 4


POLYMORPHISM

OBJECT ORIENTED PROGRAMMING BY ROHAIL QAMAR 5


CALLING A METHOD IN THE SUPER/PARENT/BASE CLASS

OBJECT ORIENTED PROGRAMMING BY ROHAIL QAMAR 6


CONVERTING CLASS DIAGRAMS TO CODE

OBJECT ORIENTED PROGRAMMING BY ROHAIL QAMAR 7


CONVERTING CLASS DIAGRAMS TO CODE

OBJECT ORIENTED PROGRAMMING BY ROHAIL QAMAR 8


CONVERTING CLASS DIAGRAMS TO CODE

OBJECT ORIENTED PROGRAMMING BY ROHAIL QAMAR 9


USING STATIC/SHARED MEMBERS

OBJECT ORIENTED PROGRAMMING BY ROHAIL QAMAR 10


USING STATIC/SHARED MEMBERS

OBJECT ORIENTED PROGRAMMING BY ROHAIL QAMAR 11


USING STATIC/SHARED MEMBERS

OBJECT ORIENTED PROGRAMMING BY ROHAIL QAMAR 12


USING STATIC/SHARED MEMBERS

OBJECT ORIENTED PROGRAMMING BY ROHAIL QAMAR 13


USING STATIC/SHARED METHODS

OBJECT ORIENTED PROGRAMMING BY ROHAIL QAMAR 14


USING STATIC/SHARED METHODS

OBJECT ORIENTED PROGRAMMING BY ROHAIL QAMAR 15


INTERFACE

OBJECT ORIENTED PROGRAMMING BY ROHAIL QAMAR 16


ASSOCIATIONS

OBJECT ORIENTED PROGRAMMING BY ROHAIL QAMAR 17


AGGREGATION DESCRIBE A “HAS A” RELATIONSHIP
A customer has a address
A car has a engine
A bank has many bank accounts
A university has many students

OBJECT ORIENTED PROGRAMMING BY ROHAIL QAMAR 18


AGGREGATION AND COMPOSITIONS

OBJECT ORIENTED PROGRAMMING BY ROHAIL QAMAR 19


CLASS ACTIVITY E-COMMERCE
1. For the above Class-Diagram, list the class name, any two class data members,
and member functions.
2. Suppose E-commerce wants to add the provision of User state can be new, active,
and banned the current system. Extend the Class-Diagram to the model for this
addition.
3. Further extend the system for adding the class Order status can be new, hold,
shipped, delivered, and closed.

OBJECT ORIENTED PROGRAMMING BY ROHAIL QAMAR 20


OBJECT ORIENTED PROGRAMMING BY ROHAIL QAMAR 21
THANK YOU

OBJECT ORIENTED PROGRAMMING BY ROHAIL QAMAR 22

You might also like