Difference between revisions of "W2561 UML Class Diagrams"
From Coder Merlin
(Created page with "== Research == * Read [https://en.wikipedia.org/wiki/Class_diagram Class Diagram (Wikipedia)]") |
|||
Line 1: | Line 1: | ||
== Research == | == Research == | ||
* Read [https://en.wikipedia.org/wiki/Class_diagram Class Diagram (Wikipedia)] | * Read [https://en.wikipedia.org/wiki/Class_diagram Class Diagram (Wikipedia)] | ||
== Key Concepts == | |||
* '''Class Diagram'''s provide a means for communicating the general, static, conceptual model of an application | |||
* Classes are represented by a box with with three compartments | |||
** The top compartment contains the ''name'' of the class, capitalized and centered | |||
** The middle compartment contains the ''attributes'' (properties) of the class, left-aligned in camel case | |||
** The bottom compartment contains the ''operations'' (methods) of the class, left-aligned in camel case | |||
*** Abstract operations are indicated by using italics for the operation name | |||
* An abstract class is indicated by using italics for the class name | |||
* '''Visibility notations''' may be placed in front of the attributes and operations | |||
** '''+''' indicates ''public'' access | |||
** '''-''' indicates ''private'' access | |||
* '''Scope notations''' may be used to specify the scope of attributes and operations | |||
** An underline indicates ''classifier'' (static) scope | |||
** The lack of an underline indicates ''instance'' scope | |||
* A '''relationship''' describes logical connections between entities | |||
** '''Instance-Level''' relationships | |||
** '''Class-Level''' relationships | |||
*** '''Inheritance''' indicates that one of the classes is a specialized form (''subclass'') of the other (''superclass''). This is also known as an ''is a'' relationship, e.g. "a dog is a mammal". This is indicated on a diagram by drawing a line from the subclass to the superclass with a hollow triangle on the superclass end. | |||
*** '''Realization''' indicates that one of the classes (the ''client'') realizes (implements) the behavior specified by the other class (the ''supplier''). This is indicated on the diagram by drawing a dashed line from the client to the supplier with a hollow triangle on the supplier end. |
Revision as of 14:42, 11 April 2019
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder
Research[edit]
Key Concepts[edit]
- Class Diagrams provide a means for communicating the general, static, conceptual model of an application
- Classes are represented by a box with with three compartments
- The top compartment contains the name of the class, capitalized and centered
- The middle compartment contains the attributes (properties) of the class, left-aligned in camel case
- The bottom compartment contains the operations (methods) of the class, left-aligned in camel case
- Abstract operations are indicated by using italics for the operation name
- An abstract class is indicated by using italics for the class name
- Visibility notations may be placed in front of the attributes and operations
- + indicates public access
- - indicates private access
- Scope notations may be used to specify the scope of attributes and operations
- An underline indicates classifier (static) scope
- The lack of an underline indicates instance scope
- A relationship describes logical connections between entities
- Instance-Level relationships
- Class-Level relationships
- Inheritance indicates that one of the classes is a specialized form (subclass) of the other (superclass). This is also known as an is a relationship, e.g. "a dog is a mammal". This is indicated on a diagram by drawing a line from the subclass to the superclass with a hollow triangle on the superclass end.
- Realization indicates that one of the classes (the client) realizes (implements) the behavior specified by the other class (the supplier). This is indicated on the diagram by drawing a dashed line from the client to the supplier with a hollow triangle on the supplier end.