Class Diagram A class diagram: describes the elements of the system and the relationships between them. The object diagram visualizes instances of classes that are modeled in a class diagram
Class Diagrams the Attribute Syntax
1-Visibility 2-Derived Attribute 3-Name 4-Type 5-Multiplicity 6-Default Value 7-Properties
Pre-defined properties ▪ { readOnly } … value cannot be changed ▪ {unique} … no duplicates permitted ▪ {non-unique} … duplicates permitted ▪ {ordered} … fixed order of the values ▪ {unordered} … no fixed order of the values Attribute specification ▪ Set: {unordered, unique } ▪ Multi-set: {unordered, non-unique} ▪ Ordered set: {ordered, unique} ▪ List: {ordered, non-unique}
the Operation Syntax
Class [Static] Variables & Operations Instance variable (≡ instance attribute ). Class variable (≡ class attribute, static attribute ). Class operation (≡ static operation ).
Example(1) Classes of Library Management System : Library Management System class – It manages all operations of Library Management System. It is central part of organization for which software is being designed. User Class – It manages all operations of user. Librarian Class – It manages all operations of Librarian. Book Class – It manages all operations of books. It is basic building block of system. Account Class – It manages all operations of account. Library database Class – It manages all operations of library database. Staff Class – It manages all operations of staff. Student Class – It manages all operations of studen
Attributes of Library Management System : Library Management System Attributes – UserType , Username, Password User Attributes – Name, Id Librarian Attributes – Name, Id, Password, SearchString Book Attributes – Title, Author, ISBN, Publication Account Attributes – no_borrowed_books , no_reserved_books , no_returned_books , no_lost_books fine_amount Library database Attributes – List_of_books Staff Class Attributes – Dept Student Class Attributes – Class