Utilizing the break...
I'm using java for coding.
Class Diagram
purpose: show the types being modeled within the system
Example of a class diagram for the class 'Flight' would look like this
Mapping a class diagram
- Packages - map to Java package names
- Classes - map directly to Java classes
- Interfaces - map to Java interfaces
- Attributes - map to Java properties and fields
- Associations, Aggregations, Compositions - map to Java references
- Operations - map to Java methods
- Generalizations - map to Java inheritance relations
- Attributes - map to Java properties and fields
- Attributes - map to Java properties and fields
- Realizations - map to implementation of Java interfaces
- Dependencies - at the most basic level these just map to Java import statements
UML Associations
Cardinality - a cardinality of one on a given relationship end generates a Java reference
Aggregation
Composition associations - child object can not exists with out the parent.when the parent is deleted child also is deleted when we implement in java.
Aggregation Association - same behavior as a regular association.
One to many association
resulting code for this is something like following.
Composition associations - child object can not exists with out the parent.when the parent is deleted child also is deleted when we implement in java.
Aggregation Association - same behavior as a regular association.
One to many association
resulting code for this is something like following.
public class Customer { List getPurchases() {...} void setPurchases(List purchases) {...} ... }
No comments:
Post a Comment