Please enable JavaScript.
Coggle requires JavaScript to display documents.
Data Modeling (Class diagram), Data Modeling (Class diagram) - Coggle…
Data Modeling (Class diagram)
Key elements
Class
Describe the different things that are in the system.
Instance of that class
Attributes
An attribute is a significant piece of data containing values that describe each instance of that class.
Identify a specific instance of the class
Also known as fields, variables, or properties
Methods
Also known as operations or functions
Allows to specify any behavioral features of a class
Relationships
Inheritance
No need to duplicate attributes
One of the advantages of inheritance is that if we wanted to change or add an attribute for all classes, we wouldn’t have to go in and make that change to all sub classes.
Relationships that exist between classes
Abstraction
When instantiate one of the classes, it’s going to be a subclass.
Association
There’s no dependency between the classes
Aggregation
A special type of association that specifies a whole and its parts
That type of relationship, where a part can exist outside the whole, is aggregation
Composition
Where the part can’t exist outside the whole
When a child object wouldn’t be able to exist without its parent object.
Multiplicity
Allows you to set numerical constraints on the relationships
All other observations that makes the UML
Cass diagrams are a type of structure diagram because they describe what must be present in the system being modeled
Notions and their significance
Attributes
Formatted a certain way
The name of the attribute beginning
with a lowercase letter.
Then follow it with a colon and the data type.
Most cases, your attributes are going to be Private or Protected
Methods
Need to be formatted a certain way
Method beginning with
a lowercase letter.
Next put parentheses to signify the function that is going be program later.
Add variables and the data type in here
Methods are often Public
Visibility
Visibility of an attribute or a method sets the accessibility for that attribute or method.
Minus sign
Which indicates that each of these
attributes and methods are private.
They can’t be accessed by any other class or subclass.
Plus sign
Which means an attribute or method is public and
can be accessed by any other class.
Hash
An attribute or method is protected
These can only be accessed by the same class or its subclasses.
Tilde
Sets the visibility to package or default
Which means it can be used by any other class
as long as it’s in the same package
But that one is rarely ever used
Relationship
Inheritance
Make the classes into subclasses by drawing open arrows
Subclasses inherit all the attributes and methods of the superclass
Could also use the terms child and parent class
Abstract
Put the name in italics
Could also put the class name inside <>
Association
From a class, it is possible to draw an association, which is just depicted by a simple line.
Aggregation
Denote it with an open diamond
Composition
Denote a composition relationship with a closed diamond
Multiplicity
0..1 - Zero to one
0..* - Zero to many
1..* - One to many
m..n - specific number range
n, representing a specific amount
Data Modeling (Class diagram)