Unified Modeling Language Philip Liew
UML Overview Standard defined by Object Management Group ( Current version at 1.5
Class Diagrams Class diagrams consist of several classes connected with relationships Representation of a class:
Class Diagram
Convention Name of class is a word with initial upper case letter Capitalize first letter of every word in name Name of attributes is lower case letter Capitalize first letter of every word other than first Operations have same naming schemes as attributes Brackets include parameter operation works on
Deriving Classes Nouns within requirement become classes Verbs become operations Nouns related to class nouns will become attributes
Associations In the form of a line between two objects Name of association just above line Role presented next to class near association Dashed line represents constraint
Associations Multiplicity represents number of objects from one class that relate with a number of objects in an associated class
Inheritance & Generalization Represented by a triangle Abstract class indicated by italics
Aggregation Components and Class represent a part-whole relationship Composite is a strong form of aggregation Components in a composite can be part of only one whole
Class Visibility Attributes and operations have three levels of visibility –Public Level: usability extends to other classes (+) –Protected Level: usability open only to inherited classes (#) –Private Level: Only original class can use attribute or operation (-)
Example Suppose that you're writing a document in Microsoft Word for example. You can start typing a new document, or open an existing one. You type a text by using your keyboard. Every document consists of several pages, and every page consists of header, document's body or/and footer. In header and footer you may add date, time, page number, file location e.t.c. Document's body has sentences. Sentences are made up of words and punctual signs. Words consists of letters, numbers and/or special characters. Also in the text you may insert pictures and tables. Table consists of rows and columns. Every cell from table may hold up text or pictures. After finishing the document, user can choose to save or to print the document.
Nouns document, text processing tool, MicrosoftWord, text, keyboard, header, footer, document's body, date, time, page number, location of file, page, sentence, word, punctual sign, letter, number, special character, picture, table, row, column, cell, user
Document Class Every Document consists of pages Page is a candidate for class
Header and Footer
Text, Table, and Picture
Finally