Lab Report on Class Diagram


TITLE:                                                             CLASS DIAGRAM

THEORY:

CLASS DIAGRAM

Class Diagram is a type of Unified Modeling Language (UML) diagram. It describes the structure of a system by showing the system’s classes, their attributes, operations and the relationship among objects. It can be considered as the main building block of Object-Oriented modeling.

Class diagram is represented by a box with three compartments; these three compartments are described as follows:

>The top compartment contains the name of the class which is represented in bold and first letter is capitalized.

>The middle compartment contains the attributes of the class. They are left-aligned and first letter is lowercase.

>The bottom compartment contains the operations the class can excute.They are also left-aligned and the first letter is lowercase.

The visibility of the attributes and the operations can be reperesented in following ways:

Public: A public member is visible from anywhere in the system. In class diagram; it is prefixed by the symbol ’+.’

Private: A private member is visible only from within the class. It cannot be accessed from outside the class. A private member is prefixed by the symbol ‘−’.

Protected: A protected member is visible from within the class and from the subclasses inherited from this class, but not from outside. It is prefixed by the symbol ‘#’.

In the design of a system, a number of classes are identified and grouped together in a class diagram that helps to determine the static relations between them. With detailed modeling, the classes of the conceptual design are often split into a number of subclasses.

 
Class Diagram on different Scenario

Library Management System


Figure: Class Diagram for Library Management System

 

There are four classes in this class diagram of library management systems which are Books, Librarian, Users, and Publisher. The association between class Books, User, and Librarian is unary association and relationship is one –to- many. Here librarian may or may not issue the books. No one or many users can request up to 4 books. Librarian and user are in one –to- many relationships and librarian can order books from one or many publisher.

Order Processing System


Figure: Class Diagram for Order Processing System

 

There are four classes which are Customer, Order, Product, and Store. The relationship among the class Customer and Order is one to many that is a customer can place an order or many order. Oder class has a number of products to be ordered and Store has a number of products to store, i.e. one to many relationship.

 

Android Bluetooth Chat App 


Figure: Class Diagram for Android Bluetooth Chat App

 

 

 
Discussion and conclusion

From this lab session we got familiarized with the class diagram. Class Diagram is the representation of class along with their attributes and operation.

Hence, from this lab we understood about the class diagram.

No comments:

Post a Comment