Pemodelan Perangkat Lunak UML

2,373 views

Published on

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,373
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
125
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • 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.
  • Pemodelan Perangkat Lunak UML

    1. 1. Pemodelan Perangkat Lunak
    2. 2. <ul><li>Merupakan diagram statis (yang menggambarkan struktur dari sistem) </li></ul><ul><li>Berupa kombinasi dari beberapa elemen, yaitu : </li></ul><ul><ul><li>Kelas </li></ul></ul><ul><ul><li>Attribut </li></ul></ul><ul><ul><li>Operasi (method) </li></ul></ul><ul><ul><li>Asosiasi (Association) </li></ul></ul><ul><ul><li>Agregasi (aggregation) </li></ul></ul><ul><ul><li>Komposisi (composition) </li></ul></ul><ul><ul><li>Generalisasi (generalisation) </li></ul></ul>
    3. 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. 4. <ul><li>Apakah terdapat data yang membutuhkan penyimpanan, transformasi atau analisa? </li></ul><ul><li>Apakah terdapat sistem luar yang berinteraksi dengan data pada pertanyaan sebelumnya? </li></ul><ul><li>Apakah ada pustaka kelas atau komponen lain yang digunakan (misal dari pustaka project sebelumnya)? </li></ul><ul><li>Apakah sistem tersebut menangani suatu perangkat? </li></ul><ul><li>Analisa keseluruhan dari tugas/peran aktor pada use case </li></ul>
    5. 5. <ul><li>Analisa Tekstual (based on Dennis, 2002) </li></ul><ul><ul><li>Kata benda umum ( common noun ) menunjukkan sebuah kelas. </li></ul></ul><ul><ul><li>Kata benda yang mengacu langsung ( direct reference noun ) menunjukkan sebuah obyek (instan dari sebuah kelas) </li></ul></ul><ul><ul><li>Kumpulan kata benda ( collective noun ) menunjukkan sebuah kelas yg tercipta dari grup obyek kelas lain. </li></ul></ul><ul><ul><li>Kata sifat ( adjective ) menunjukkan sebuah atribut </li></ul></ul><ul><ul><li>Kata kerja “ doing ” (melakukan) menunjukkan operasi </li></ul></ul><ul><ul><li>Kata kerja “being” (menjadi) menunjukkan klasifikasi hubungan (relasi) antara objek dan kelasnya </li></ul></ul><ul><ul><li>Kata kerja “having” (memiliki) menunjukkan relasi agregasi dan asosiasi. </li></ul></ul><ul><ul><li>Kata kerja transitive menunjukkan operasi </li></ul></ul><ul><ul><li>Kata kerja intransitive menunjukkan pengecualian (exception) </li></ul></ul><ul><ul><li>Kata keterangan menunjukkan atribut dari relasi atau operasi </li></ul></ul>
    6. 6. <ul><li>Sangat bergantung pada sistem </li></ul><ul><li>Menggambarkan karakteristik dari obyek yang dimiliki kelas tersebut. </li></ul><ul><li>Dapat menjadi informatif atau mungkin membingunkan </li></ul><ul><li>Memiliki tipe tertentu, yaitu : </li></ul><ul><ul><li>Primitif (boolean, integer, real, dll) </li></ul></ul><ul><ul><li>Bahasa tertentu </li></ul></ul><ul><ul><li>Kelas lain </li></ul></ul><ul><ul><li>Tipe data yang didefinisikan sendiri </li></ul></ul><ul><li>Memiliki visibility yang berbeda, yaitu </li></ul><ul><ul><li>public </li></ul></ul><ul><ul><li>private </li></ul></ul>
    7. 7. <ul><li>Dapat diberikan suatu nilai default </li></ul><ul><li>Dapat diberikan nilai dalam range tertentu (enumerasi) </li></ul><ul><li>Dapat langsung diimplementasikan pada bahasa pemrograman yang mendukung object-oriented (java, c++) </li></ul>Sintak atribut : Visibility name:type=init_value{property_string}
    8. 8. Invoice + amount : real + date : date = current date + customer : string + specification : string - administrator : string = &quot;unspecified&quot; - number_of_invoices : integer + amount : real + date : date = current date + customer : string + specification : string - administrator : string = &quot;unspecified&quot; - 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&quot; + filesystem_size : integer + creation_date : date - password : string Invoice
    9. 9. Public class UNIXaccount { public string username; public string groupname = &quot;csai&quot;; 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&quot; + filesystem_size : integer + creation_date : date - password : string - no_of_accounts : integer = 0
    10. 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()
    11. 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
    12. 13. Person Car * Plates User PID Process Host IP-addr * * Item of clothing Male person 0 ..* Female person 0 ..* {or} 1 1
    13. 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 ..*
    14. 16. Host Printer 1 ..* Network Network adapter 1 * 1 Queue Adapter Print spooler Notary Client Contract Purchaser Real-estate Computer
    15. 18. Car Wheels Body Engine Wiring * * * * Note that association multiplicity is shown within the classes
    16. 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
    17. 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
    18. 22. Figure {abstract} Position: Pos Draw() {abstract} Group Draw() Polygon Draw() Canvas Consists of * Electronic * Consists of Line Draw() Circle Draw() Consists of *
    19. 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 */ } }
    20. 24. <ul><li>Rules are expressed using constraints and derivations </li></ul><ul><ul><ul><li>Constraints were mentioned earlier (e.g. or-associations, ordered associations, inheritance constraints, etc.) </li></ul></ul></ul><ul><ul><ul><li>Derivations are rules governing how entities can be derived (e.g. age = current date - DOB) </li></ul></ul></ul>
    21. 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
    22. 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 = &quot;dept&quot;)} N.B. Relation cardinality is omitted for example clarity
    23. 27. Database Organisation Employee Entry in Member of {subset} Maintains N.B. Relation cardinality is omitted for example clarity Project manager of
    24. 32. +getOrderStatus +setOrderStatus +getLineItems +setLineItems +getCreditApproved +setCreditApproved ... OrderBean {abstract} LineItem {abstract} Product 1 * 1 * <<interface>> EntityBean CreditCard {abstract} Customer MyOrder MyLineItem MyCreditCard * 1 * buyer order order item item commodity
    25. 33. <ul><li>Buat kelas diagram untuk menggambarkan interkoneksi sebenarnya dalam jaringan </li></ul><ul><li>Buat kelas diagram untuk menggambarkan sistem hirarki direktori dari OS </li></ul>
    26. 34. <ul><li>Menggambarkan penggunaan aplikasi pengolah kata : </li></ul><ul><li>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 . </li></ul><ul><li>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. </li></ul><ul><li>Tabel dibentuk dari baris dan kolom dan setiap sel nya dapat berisi teks dan gambar. User dapat menyimpan ( save ) atau mencetak ( print ) dokumen. </li></ul>
    27. 35. <ul><li>Kata benda (bergaris bawah) bisa berupa kelas atau atributnya. </li></ul><ul><li>Kata kerja (huruf miring) merupakan operasi dari kelas. </li></ul><ul><li>Entitas utama yang ditangani : do k umen </li></ul>

    ×