May 7, 2012

How to make a system in 25 days? ctd...



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

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.

public class Customer {
  List getPurchases() {...}
  void setPurchases(List purchases) {...}
  ...
}


No comments:

Post a Comment

Followers