0% found this document useful (0 votes)
30 views

Class and Object Diagrams: Dr.A.Ashok Kumar Department of Computer Science Alagappa Government Arts College Karaikudi

This document discusses class and object diagrams in UML modeling. It explains that class diagrams correspond to C++ code with private, public and protected visibility symbols mapping to keywords. An example class diagram for a Time class is shown along with its equivalent C++ code. Object diagrams depict the system structure at a point in time using real world examples to provide clarity on relationships between objects.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Class and Object Diagrams: Dr.A.Ashok Kumar Department of Computer Science Alagappa Government Arts College Karaikudi

This document discusses class and object diagrams in UML modeling. It explains that class diagrams correspond to C++ code with private, public and protected visibility symbols mapping to keywords. An example class diagram for a Time class is shown along with its equivalent C++ code. Object diagrams depict the system structure at a point in time using real world examples to provide clarity on relationships between objects.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Class and Object Diagrams

Dr.A.Ashok Kumar
Department Of Computer Science
Alagappa Government Arts College
Karaikudi
• The visibility symbols appearing in a UML class
diagram correspond to the C++ keywords:
– "-" → "private:"
– "+" → "public:"
– "#" → "protected:"
UML Modeling Class Equivalent C++ code
diagram

class Time
{
private:
int hours;
int minutes;
int seconds;
public:
Time();
Time(int h, int m, int s);
Time(int s);
Time add(Time t2);
Time* add(Time* t2);
void print();
void read();
};
• Object Diagrams use real world examples to depict the nature and structure
of the system at a particular point in time
• Object diagrams provide a clearer view of the relationships that
exist between objects
• The object diagram should have a meaningful name to indicate its purpose

You might also like