Difference between revisions of "Class Diagram"
Wiki admin (talk | contribs) |
Wiki admin (talk | contribs) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Definition == | == Definition == | ||
− | A '''Class Diagram''' is a graphical UML diagram is a type of static structure diagram | + | A '''Class Diagram''' is a graphical UML diagram that is a type of static structure diagram. It describes a system by showing the system's classes, their attributes, operations (or methods), and the relationships among objects. A class is the blueprint for a set of similar objects that appear |
+ | in the system to be specified. Class attributes allow to store information that has generally different specific values for each instance (object) of the class. Operations specify how specific behavior can be triggered on individual objects. | ||
+ | |||
+ | The concepts behind a class diagram originate from conceptual data modeling and object-oriented software development. The class diagram is based primarily on the concepts of class, generalization, and association. The documented elements and the relationships between them do not change over time. | ||
The class diagram is the main building block of object-oriented modeling. It is used for general conceptual modeling of the structure of the application, and for detailed modeling, translating the models into programming code. Class diagrams can also be used for data modeling. The classes in a class diagram represent both the main elements, interactions in the application, and the classes to be programmed. | The class diagram is the main building block of object-oriented modeling. It is used for general conceptual modeling of the structure of the application, and for detailed modeling, translating the models into programming code. Class diagrams can also be used for data modeling. The classes in a class diagram represent both the main elements, interactions in the application, and the classes to be programmed. | ||
+ | |||
+ | A class diagram is distinct but related to the [[Object Diagram]] | ||
== PlantUML Elements == | == PlantUML Elements == | ||
− | A [[PlantUML]] | + | A [[PlantUML]] class diagram specifies and shows the following: |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | * A Class | |
+ | * Class Attributes | ||
+ | * Class Methods | ||
== Example == | == Example == | ||
Line 18: | Line 20: | ||
<pre> | <pre> | ||
@startuml | @startuml | ||
− | |||
− | |||
− | |||
skinparam handwritten true | skinparam handwritten true | ||
− | |||
− | + | abstract class Borrower { | |
+ | -name : String | ||
+ | } | ||
− | + | class CorporateBorrower extends Borrower { | |
− | : | + | -market_capitalisation : number |
+ | } | ||
− | + | class PrivateBorrower extends Borrower { | |
− | + | -annual_income : number | |
− | |||
− | |||
− | |||
− | |||
} | } | ||
+ | |||
@enduml | @enduml | ||
</pre> | </pre> | ||
− | [[File: | + | [[File:Class.png|Class Diagram]] |
== References == | == References == | ||
<references/> | <references/> | ||
− | * [[wikipedia: | + | * [[wikipedia:Class diagram | Class Diagram @ Wikipedia]] |
* [https://plantuml.com/guide PlantUML Language Reference Guide] | * [https://plantuml.com/guide PlantUML Language Reference Guide] | ||
[[Category:PlantUML]] | [[Category:PlantUML]] |
Latest revision as of 18:57, 16 February 2022
Definition
A Class Diagram is a graphical UML diagram that is a type of static structure diagram. It describes a system by showing the system's classes, their attributes, operations (or methods), and the relationships among objects. A class is the blueprint for a set of similar objects that appear in the system to be specified. Class attributes allow to store information that has generally different specific values for each instance (object) of the class. Operations specify how specific behavior can be triggered on individual objects.
The concepts behind a class diagram originate from conceptual data modeling and object-oriented software development. The class diagram is based primarily on the concepts of class, generalization, and association. The documented elements and the relationships between them do not change over time.
The class diagram is the main building block of object-oriented modeling. It is used for general conceptual modeling of the structure of the application, and for detailed modeling, translating the models into programming code. Class diagrams can also be used for data modeling. The classes in a class diagram represent both the main elements, interactions in the application, and the classes to be programmed.
A class diagram is distinct but related to the Object Diagram
PlantUML Elements
A PlantUML class diagram specifies and shows the following:
- A Class
- Class Attributes
- Class Methods
Example
@startuml skinparam handwritten true abstract class Borrower { -name : String } class CorporateBorrower extends Borrower { -market_capitalisation : number } class PrivateBorrower extends Borrower { -annual_income : number } @enduml