17
1 Implementation UML Class Diagrams

Materi diagram kelas-implementasi-1

Embed Size (px)

Citation preview

Page 1: Materi diagram kelas-implementasi-1

1

Implementation UML Class Diagrams

Page 2: Materi diagram kelas-implementasi-1

2

Big questions What is UML?

Why should I bother? Do people really use UML?

What is a UML class diagram? What kind of information goes into it? How do I create it? When should I create it?

Page 3: Materi diagram kelas-implementasi-1

3

Page 4: Materi diagram kelas-implementasi-1

4

Page 5: Materi diagram kelas-implementasi-1

Representing Static variable or static operation:The static data is represented with an underline. Let’s take the below example.

5

Page 6: Materi diagram kelas-implementasi-1

Association:The association represents the static relationship between two classes along with the multiplicity. 

6

Page 7: Materi diagram kelas-implementasi-1

The unidirectional relationship shows that the source object can invoke methods of the destination class. In Java a possible example can be the instance variable of source class referencing the destination class.

7

Page 8: Materi diagram kelas-implementasi-1

8

Page 9: Materi diagram kelas-implementasi-1

Bidirectional association

9

Page 10: Materi diagram kelas-implementasi-1

10

Page 11: Materi diagram kelas-implementasi-1

11

Both use of ArrayList and Array is for illustration purposes only

Page 12: Materi diagram kelas-implementasi-1

Generalization

12

Page 13: Materi diagram kelas-implementasi-1

Realization: This is related to the relationship between the class and

the interface. The realization is equivalent to the “implements” keyword in Java

13

Page 14: Materi diagram kelas-implementasi-1

Realization

14

Page 15: Materi diagram kelas-implementasi-1

Aggregation This shows “has a” relationship. It is a form of

association relationship. This relationship highlights that a whole is made of its parts. So if a whole is destroyed the part still remains.

15

Page 16: Materi diagram kelas-implementasi-1

Composition This is again a whole or part relationship where if the

whole is destroyed then the part cannot exist independently. Another important point about Composition is that the part at any point in time can have only one owner.

16

Page 17: Materi diagram kelas-implementasi-1

17