Unified Modeling Language/Class diagram: Difference between revisions
Jump to navigation
Jump to search
imported>Eric Evers mNo edit summary |
imported>Derek Hodges No edit summary |
||
Line 1: | Line 1: | ||
{{subpages}} | |||
A class diagram is one of the most popular types of UML diagrams. | A class diagram is one of the most popular types of UML diagrams. | ||
Latest revision as of 14:03, 4 March 2009
A class diagram is one of the most popular types of UML diagrams.
Class Diagrams use implements, composition and aggregation relationships.
---------------------------------------------------- Implementation example: A fedora is a (type of) hat. Arrowhead type: Unfilled closed triangle. Arrow direction: From example to category.
+--------+ | hat | +--------+ ∆ | | +--------+ | fedora | +--------+ ------------------------------------------------------------------ Composition example: A heart is a non-removable part of a person. Arrowhead type: Solid diamond. Arrow direction: From part to whole.
+--------+ | person | +--------+ ♦ | | +--------+ | heart | +--------+
---------------------------------------------------------- Aggregation example: A hat is a removable part of a person. Arrowhead type: Unfilled-diamond(lozenge). Arrow direction: From part to whole.
+--------+ | person | +--------+ ◊ | | +--------+ | hat | +--------+
---------------------------------------------------------- Inner Class example: Tree_search is an inner class of tree. Arrowhead type: Oplus(plus in a circle). Arrow direction: From part to whole. Purpose: Tree_search is a Search, but Tree_Search is an inner class of tree. Only trees need a tree_search class so it is hidden. Some languages do not support inner classes. Java does.
+--------+ +---------+ | tree | | search | +--------+ +---------+ ⊕ / \ | | | | +-------------+ | tree_search | +-------------+