Hanya digunakan di lingkungan Universtias Catatan Kuliah Rekayasa Perangkat Lunak (Software Engineering) Bagian 2 copyright © 2006 R.S. Pressman & Associates, Inc M. Idham Ananta Timur, S.T., M.Kom. Hanya digunakan di lingkungan Universtias Hanya boleh digandakan untuk mahasiswa di lingkungan universitas yang menggunakan buku Software Engineering: A Practitioner's Approach. Selain itu dilarang keras menggandakan. Presentasi, slide atau hardcopy tidak boleh digunakan untuk short courses, seminar industri, atau kepentingan konsultasi. These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Software Engineering: A Practitioner’s Approach, 6/e Bab 11 Desain Level Komponen copyright © 1996, 2001, 2005 R.S. Pressman & Associates, Inc. For University Use Only May be reproduced ONLY for student use at the university level when used in conjunction with Software Engineering: A Practitioner's Approach. Any other reproduction or use is expressly prohibited. These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Apakah Komponen ? OMG Unified Modeling Language Specification [OMG01] mendefinisikan komponen sebagai “… a modular, deployable, and replaceable part of a system that encapsulates implementation and exposes a set of interfaces.” Pandangan OO : Sebuah komponen terdiri dari sekumpulan class2x yang berkolaborasi Pandangan Konvensional: logika, struktur data internal yang dibutuhkan untuk mengimplementasi logika proses dan sebuah interface yang memungkinkan komponen untuk dipanggil sehingga data dapat dimasukkan ke dalamnya. These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Komponen OO These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Komponen Konvensional These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Prinsip2x Desain Dasar The Open-Closed Principle (OCP). “sebuah modul[komponen] harus terbuka untuk ekstensi, namun tertutup untuk modifikasi. The Liskov Substitution Principle (LSP). “Subclass harus dapat disubstitusi oleh basis class nya. Dependency Inversion Principle (DIP). “Tergantung pada abstraksi, tidak tergantung pada konkret.” The Interface Segregation Principle (ISP). “banyak interface spesifik client lebih baik daripada satu interface general purpose. The Release Reuse Equivalency Principle (REP). “Bagian-bagian kecil yang dapat digunakan kembali adalah bagian-bagian kecil yang akan direlease.” The Common Closure Principle (CCP). “Class2x yang berubah bersama-sama adalah milik bersama.” The Common Reuse Principle (CRP). “Class2x yang tidak digunakan kembali bersama-sama tidak dikelompokkan bersama.” Source: Martin, R., “Design Principles and Design Patterns,” downloaded from http:www.objectmentor.com, 2000. These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Panduan Desain Komponen Interfaces Dependencies dan Inheritance Konvensi penyebutan nama harus ditentukan untuk komponen2x yang menjadi bagian dari model arsitektur dan kemudian disempurnakan dan diuraikan sebagai bagian dari model level komponen Interfaces Interface menyediakan informasi penting mengenai komunikasi dan kolaborasi (yang akan membantuk kita mendapatkan OCP) Dependencies dan Inheritance Adalah ide yang bagus untuk membuat model dependency dari kiri ke kanan dan intheritance dari bawah ke atas. These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Kohesi Pandangan konvensional: OO view: Level kohesi Sebuah modul tunggal OO view: cohesion menyatakan bahwa sebuah komponen atau class melakukan enkapsulasi hanya atribut2x dan operasi2x yang punya kaitan erat dengan yang satu yang lain dan dengan class atau komponen itu sendiri. Level kohesi Fungsional Lapisan/Layer Komunikasi Sekuensial Prosedural Temporal utility These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Coupling Pandangan Konvensional: Pandangan OO : Level coupling Derajat dimana sebuah komponen terhubung dengan komponen lain dan dengan dunia eksternal Pandangan OO : Pengukuran kualitatif terhadap derajat dimana class2x saling terkait satu dengan yang lain Level coupling Content Common Control Stamp Data Routine call Type use Inclusion or import External These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Component Level Design-I Langkah 1. Identifikasi semua class2x desain yang berkaitan dengan domain permasalahan. Langkah 2. Identifikasi semua class2x desain yang berkaitan dengan domain infrastruktur. Langkah 3. teliti semua class2x desain yang tidak dikenali sebagai komponen yang dapat digunaka kembali. Langkah 3a. Tentukan detail pesan ketika class2x atau komponen berkolaborasi. Step 3b. Identifikasi interface yang tepat untuk setiap komponen. These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Component-Level Design-II Langkah 3c. Teliti atribut2x dan tentukan tipe2x data dan struktur data yang dibutuhkan untuk mengimplementasi mereka. Langkah 3d. Gambarkan aliran proses di setiap operasi secara detail. Langkah 4. Gambarkan sumber data persistence (database dan file) dan identifikasi class2x yang diminta untuk mengelolanya. Langkah 5. Kembangkan dan perinci representasi perilaku untuk class atau komponen. Langkah 6. Teliti diagram deployment untuk menyediakan detail implementasi tambahan. Step 7. Faktorkan setiap representasi desain level komponen dan selalu perhatikan alternatif2x. These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Collaboration Diagram These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Refactoring These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Activity Diagram These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Statechart These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Object Constraint Language (OCL) Melengkapi UML dengan memungkin software engineer menggunakan grammar dan syntax formal untuk membangun penyataan yang tidak ambigu tanpa elemen2x model desain Pernyataan bahasa OCL yang paling sederhana dibangun dengan 4 bagian :: (1) sebuah context yang menyatakan situasi terbatas dimana statemen tersebut valid; (2) sebuah property yang menampilkan beberapa karakterstik dari konteks(mis jika context adalah class, properti adalah atribut) (3) sebuah operation (mis aritmetika) yang memanipulasi atau menentukan properti, dan (4) keywords (mis if, then, else, and, or, not, implies) yang digunakan untuk ekspresi kondisional. These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Contoh OCL context PrintJob::validate(upperCostBound : Integer, custDeliveryReq : Integer) pre: upperCostBound > 0 and custDeliveryReq > 0 and self.jobAuthorization = 'no' post: if self.totalJobCost <= upperCostBound and self.deliveryDate <= custDeliveryReq then self.jobAuthorization = 'yes' endif These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Desain Algoritma Aktivitas desain paling dekat dengan coding pendekatan: review gambaran desain untuk komponen Gunakan langkah-langkah penyempurnaan untuk mengembangkan algoritma Gunakan pemrograman terstruktur untuk implementasi logika prosedural Gunakan ‘formal methods’ untuk membuktikan logika These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Langkah2x Penyempurnaan open walk to door; reach for knob; open door; repeat until door opens turn knob clockwise; walk through; if knob doesn't turn, then close door. take key out; find correct key; insert in lock; endif pull/push door move out of way; end repeat These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Model Desain Algoritma Menampilkan algoritma pada level detail yang dapat direview kualitasnya pilihan2x: grafis (mis flowchart, box diagram) pseudocode (mis PDL) ... choice of many Bahasa pemrograman Tabel Keputusan Lakukan penelusuran untuk menilai kualitas These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Pemrograman Terstruktur untuk desain prosedural Gunakan sejumlah konstruksi logika sequence conditional — if-then-else, select-case loops — do-while, repeat until Mengarah pada kode yang mudah dibaca dan diuji Dapat digunakan untuk membantu koreksi Penting untuk memperoleh kualitas tinggi Tapi tidak cukup These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Desain prosedur terstruktur These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Tabel Keputusan These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Program Design Language (PDL) These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Why Design Language? These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005
Tugas Akhir Semester Buat Model Analisis dari SRS yang anda buat sebelumnya. Model analisis berisi diagram : Use Case Diagram ERD (pendekatan konvensional) DFD (pendekatan konvensional) Activity/Sequence Diagram (Pendekatan OO) Class Diagram (Pendekatan OO) Buat Model Desain dari model analisis yang anda buat Rancangan User Interface Dinilai dari keterpaduan, kelengkapan, dan alur logika Dikumpulkan ketika ujian akhir semester Kelas A disampul mika warna merah Kelas B disampul mika warna kuning These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005