2. Merupakan diagram statis (yang menggambarkan struktur dari sistem) Berupa kombinasi dari beberapa elemen, yaitu : Kelas Attribut Operasi (method) Asosiasi (Association) Agregasi (aggregation) Komposisi (composition) Generalisasi (generalisation)
3. Properti dari diagram kelas yaitu - Model statis : - Memodelkan struktur dan perilaku - Digunakan sebagai dasar dari diagram lainnya - Mudah untuk diubah ke dalam diagram obyek Nam a Attribut Opera si
4. Apakah terdapat data yang membutuhkan penyimpanan, transformasi atau analisa? Apakah terdapat sistem luar yang berinteraksi dengan data pada pertanyaan sebelumnya? Apakah ada pustaka kelas atau komponen lain yang digunakan (misal dari pustaka project sebelumnya)? Apakah sistem tersebut menangani suatu perangkat? Analisa keseluruhan dari tugas/peran aktor pada use case
5. Analisa Tekstual (based on Dennis, 2002) Kata benda umum ( common noun ) menunjukkan sebuah kelas. Kata benda yang mengacu langsung ( direct reference noun ) menunjukkan sebuah obyek (instan dari sebuah kelas) Kumpulan kata benda ( collective noun ) menunjukkan sebuah kelas yg tercipta dari grup obyek kelas lain. Kata sifat ( adjective ) menunjukkan sebuah atribut Kata kerja doing (melakukan) menunjukkan operasi Kata kerja being (menjadi) menunjukkan klasifikasi hubungan (relasi) antara objek dan kelasnya Kata kerja having (memiliki) menunjukkan relasi agregasi dan asosiasi. Kata kerja transitive menunjukkan operasi Kata kerja intransitive menunjukkan pengecualian (exception) Kata keterangan menunjukkan atribut dari relasi atau operasi
6. Sangat bergantung pada sistem Menggambarkan karakteristik dari obyek yang dimiliki kelas tersebut. Dapat menjadi informatif atau mungkin membingunkan Memiliki tipe tertentu, yaitu : Primitif (boolean, integer, real, dll) Bahasa tertentu Kelas lain Tipe data yang didefinisikan sendiri Memiliki visibility yang berbeda, yaitu public private
7. Dapat diberikan suatu nilai default Dapat diberikan nilai dalam range tertentu (enumerasi) Dapat langsung diimplementasikan pada bahasa pemrograman yang mendukung object-oriented (java, c++) Sintak atribut : Visibility name:type=init_value{property_string}
8. Invoice + amount : real + date : date = current date + customer : string + specification : string - administrator : string = "unspecified" - number_of_invoices : integer + amount : real + date : date = current date + customer : string + specification : string - administrator : string = "unspecified" - number_of_invoices : integer + status : status = unpaid { unpaid, paid } UNIXaccount + username : string + groupname : string + filesystem_size : integer + creation_date : date - password : string UNIXaccount + username : string + groupname : string = staff" + filesystem_size : integer + creation_date : date - password : string Invoice
9. Public class UNIXaccount { public string username; public string groupname = "csai"; public int filesystem_size; public date creation_date; private string password; static private integer no_of_accounts = 0 public UNIXaccount() { //Other initialisation no_of_accounts++; } //Methods go here }; UNIXaccount + username : string + groupname : string = staff" + filesystem_size : integer + creation_date : date - password : string - no_of_accounts : integer = 0
10. Public class Figure { private int x = 0; private int y = 0; public void draw() { //Java code for drawing figure } }; Figure fig1 = new Figure(); Figure fig2 = new Figure(); fig1.draw(); fig2.draw(); Figure - x : integer = 0 - y : integer = 0 + draw()
12. Person Car Drives * * Driver Company car Person Car * * Adult Company car Employee Drives 1 1 Driver Driver Person Person Married to Husband Wife Domestic appliance Family member 揃 Turns on Heater 揃 Cleans Toaster Dad 揃 Tunes Child Radio Mum
13. Person Car * Plates User PID Process Host IP-addr * * Item of clothing Male person 0 ..* Female person 0 ..* {or} 1 1
14. Library Books * 1 ..* {ordered by date} Member {ordered by surname} * 1 ..* Person Establishment Bank card Client 0 ..* No qualified or aggregation associations allowed in ternary. 1 ..* Credit card Shop 1 ..*
20. Zoo Mammal Bird Falcon Monkey Giraffe 0..* 0..* 0..* Zoo Monkey[0..*]: Mammal Giraffe[0..*]: Mammal Human[1..*]: Mammal Falcon[0..*]: Bird Cage[1..*]: Equipment Equipment Human 1..* Cage 1..* My family Family member Ernest Fiona My family Ernest: Family member Fiona: Family member
21. Aircraft {abstract} Make Seats Engine type Start() {abstract} land() {abstract} Jet plane Make Seats Engine type Start() land() Helicopter Make Seats Engine type Start() land() Start jet engines Lower flaps & landing gear Start blades Decrease prop speed
22. Figure {abstract} Position: Pos Draw() {abstract} Group Draw() Polygon Draw() Canvas Consists of * Electronic * Consists of Line Draw() Circle Draw() Consists of *
23. abstract public class Figure { abstract public void Draw(); Pos position; } public class Group extends Figure { private FigureVector consist_of; public void Draw() { for (int i = 0; i < consist_of.size(), i++) { consist_of[i].draw(); } } } public class Polygon extends Figure { public void Draw() { /* something similar to group only using lines instead */ } } public class Line extends Figure { public void Draw() { /* code to draw line */ } } public class circle extends Figure { public void Draw() { /* code to draw circle */ } }
24. Rules are expressed using constraints and derivations Constraints were mentioned earlier (e.g. or-associations, ordered associations, inheritance constraints, etc.) Derivations are rules governing how entities can be derived (e.g. age = current date - DOB)
25. Airport Flight Aircraft Passenger Turbo-prop aircraft Jet-turbine aircraft Uses uses /1 class passenger Fixed-wing passenger craft Is on Name Surname Age Nationality Destination Ticket price /1 class passenger Passenger {1 class passenger = = (Ticket price > 400)} N.B. Relation cardinality is omitted for example clarity /1 class passenger
26. Shop Order Customer Processes /bulk-buying customer Places Wholesaler Supplies /supermarket Name Address Owner Category Date of registration Area /Supermarket Shop {Supermarket = = (Area > 200 && Category = "dept")} N.B. Relation cardinality is omitted for example clarity
27. Database Organisation Employee Entry in Member of {subset} Maintains N.B. Relation cardinality is omitted for example clarity Project manager of
33. Buat kelas diagram untuk menggambarkan interkoneksi sebenarnya dalam jaringan Buat kelas diagram untuk menggambarkan sistem hirarki direktori dari OS
34. Menggambarkan penggunaan aplikasi pengolah kata : Seorang user dapat membuka (open) dokumen baru atau yang sudah ada. Teks dapat dimasukkan (entered) melalui keyboard . Dokumen dibentuk dari beberapa halaman ( pages ) dan setiap halaman dibentuk dari header , body dan footer . Tanggal , waktu dan no halaman dapat ditambahkan (be added) ke header atau footer. Body dokumen dibentuk dari kalimat(sentences) , dimana kalimat tersebut terdiri dari kata (word) dan karakter tanda baca (punctuation character) . Kata dibentuk dari huruf , digit dan/atau karakter khusus . Gambar dan tabel bisa disisipkan ( insert ) ke dalam body dokumen. Tabel dibentuk dari baris dan kolom dan setiap sel nya dapat berisi teks dan gambar. User dapat menyimpan ( save ) atau mencetak ( print ) dokumen.
35. Kata benda (bergaris bawah) bisa berupa kelas atau atributnya. Kata kerja (huruf miring) merupakan operasi dari kelas. Entitas utama yang ditangani : do k umen
An association is a structural relationship that specifies that objects of one thing are connected to objects of another. Given an association connecting two classes, you can navigate from an object of one class to an object of the other class, and vice versa
A qualified association is an association which allows us to restrict the objects referred in an association thanks to a key. A derived association is an association made starting from another association. An association with class is an association itself managed by a class, which can thus provide attributes or operations specific for association.
A derived association is an association made starting from another association.
Association classes allow you to add attributes, operations, and other features to associations We can see from the diagram that a Person may work for a single Company. We need to keep information about the period of time that each employee works for each Company. We can do this by adding a dateRange attribute to the association. We could add this attribute to the Person class, but it is really a fact about a Person's relationship to a Company, which will change should the person's employer change.