際際滷

際際滷Share a Scribd company logo
Pemodelan Perangkat Lunak
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)
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
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
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
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
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}
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
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
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()
油
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
Person Car * Plates User PID Process Host IP-addr * * Item of clothing Male person 0 ..* Female person 0 ..* {or} 1 1
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 ..*
油
Host Printer 1 ..* Network Network adapter 1 * 1 Queue Adapter Print spooler Notary Client Contract Purchaser Real-estate Computer
油
Car Wheels Body Engine Wiring * * * * Note that association  multiplicity is shown  within the classes
油
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
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
Figure {abstract} Position: Pos Draw()  {abstract} Group Draw() Polygon Draw() Canvas Consists of * Electronic * Consists of Line Draw() Circle Draw() Consists of *
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 */ } }
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)
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
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
Database Organisation Employee Entry in Member of {subset} Maintains N.B. Relation cardinality is omitted for example clarity Project manager of
油
油
油
油
+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
Buat kelas diagram untuk menggambarkan interkoneksi sebenarnya dalam jaringan  Buat kelas diagram untuk menggambarkan sistem hirarki direktori dari OS
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.
Kata benda (bergaris bawah) bisa berupa kelas atau atributnya.   Kata kerja (huruf miring) merupakan operasi dari kelas. Entitas utama yang ditangani : do k umen
油

More Related Content

Pemodelan Perangkat Lunak UML

  • 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 = &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. 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. 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
  • 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 ..*
  • 15.
  • 16. Host Printer 1 ..* Network Network adapter 1 * 1 Queue Adapter Print spooler Notary Client Contract Purchaser Real-estate Computer
  • 17.
  • 18. Car Wheels Body Engine Wiring * * * * Note that association multiplicity is shown within the classes
  • 19.
  • 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 = &quot;dept&quot;)} 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
  • 28.
  • 29.
  • 30.
  • 31.
  • 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
  • 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
  • 36.

Editor's Notes

  1. 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
  2. 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.
  3. A derived association is an association made starting from another association.
  4. 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&apos;s relationship to a Company, which will change should the person&apos;s employer change.