TOGAF 9 Fundamental: 6. UML Introduction Romi Satria Wahono romi@romisatriawahono.net http://romisatriawahono.net Romi Satria Wahono • • • • • • • • SD Sompok Semarang (1987) SMPN 8 Semarang (1990) SMA Taruna Nusantara Magelang (1993) B.Eng, M.Eng and Dr.Eng (on-leave) Department of Computer Science Saitama University, Japan (1994-2004) Research Interests: Software Engineering and Intelligent Systems Founder IlmuKomputer.Com LIPI Researcher (2004-2007) Founder and CEO PT Brainmatics Cipta Informatika 2 Course Outline 1. 2. 3. 4. 5. 6. 7. Introduction Basic Concepts Core Concepts Key Terminology ADM Introduction UML Introduction TOGAF Case Study 3 6. UML Introduction 4 The Nature of Software Development 5 Is it Possible? Systems Analysis and Design with UML 8 System Analysis and Design with UML 1. System Analysis 1. Business Process Identification 2. Use Case Diagram Business Process Modeling 3. Activity Diagram or Business Process Modeling Notation (BPMN) Business Process Realization Sequence Diagram (Buat untuk setiap use case dengan menggunakan pola Boundary-Control-Entity) 2. System Design 1. Program Design 1. 2. 3. 2. 3. Class Diagram (Gabungkan Boundary-Control-Entity Class dan susun story dari sistem yang dibangun) Package Diagram (Gabungan class yang sesuai, boleh menggunakan pola B-C-E) Deployment Diagram (arsitektur software dari sistem yang dibangun) User Interface Design (Buat UI design dari Boundary Class) Entity-Relationship Model (Buat ER diagram dari Entity Class) 1. Business Process Identification: Use Case Diagram 10 Use Case Diagrams • Summarized into a single picture • All of the use cases for the part of the system being modeled • Use case represents the discrete activities performed by the user • Use Case Diagram tells what the system will do • Good for communicating with users Use Case Diagram Syntax • Actor • person or system that derives benefit from and is external to the subject • Use Case • Represents a major piece of system functionality • Association Relationship • Include Relationship • Extend Relationship • Generalization Relationship <<includes>> <<extends>> Use Case • A major piece of system functionality Use Case • Can extend other Use Cases • Placed inside system boundary • Labeled with descriptive verb - noun phrase System Boundary • Includes the name Boundary of the system inside or on top • Represents the scope of the system • Actors are outside the scope of the system Actor • A person or another system that interacts with the current system • A role, not a specific user • Provides input, receives output, or both actor Actor/Role Association Relationship • Links actor and the Use Case • Shows two-way communication • If one-way, arrows are used • * is for "multiplicity of the Association" * * Extends Relationship • Extends Use Case to include Optional behavior • Arrow points from the extension Use Case to the base Use Case extend Make Payment Arrangement extend Make Appointment Include Relationship • Include one Use Case from within another • Arrow points from base Use Case to the included Use Case include Make New Patient Appointment include Create New Patient Generalization Relationship • A specialized Use Case to a more generalized Use Case • Arrow points from specialized to general Use Case Make Old Appointment Make Appointment Use Case Diagram for Appointment System Use Case Diagram with Specialized Actor Extend and Include Relationships Studi Kasus: ATM System 23 ATM System ATM System Layar Kotak Uang Kotak Kartu Kotak Kuitansi Masukkan PIN: Kotak Uang Kotak Kartu Kotak Kuitansi Menu Utama 1. Melihat Saldo 2. Mentransfer Uang 3. Mengambil Uang 4. Logout Kotak Uang Kotak Kartu Kotak Kuitansi Menu Melihat Saldo 1. Saldo anda adalah …. Kotak Uang Kotak Kartu Kotak Kuitansi Menu Mentransfer Uang 1. No Account Penerima: Kotak Uang Kotak Kartu Kotak Kuitansi Menu Mentransfer Uang 1. Jumlah uang yang dikirim: Kotak Uang Kotak Kartu Kotak Kuitansi Menu Mentransfer Uang 1. Uang berhasil terkirim Kotak Uang Kotak Kartu Kotak Kuitansi Menu Mengambil Uang 1. Jumlah uang yang diambil: Kotak Uang Kotak Kartu Kotak Kuitansi Menu Mengambil Uang Uang berhasil diambil Kotak Uang Kotak Kartu Kotak Kuitansi Use Case Diagram uc UCD - Sistem ATM Sistem ATM Memasukkan Kartu «include» Mengecek Saldo Pengguna Mentransfer Uang Melakukan Logout Mengambil Uang Memasukkan PIN Use Case Diagram (Alternatif) uc Sistem ATM Sistem ATM Memasukkan Kartu Memasukkan PIN «include» Melihat Saldo «extend» Mengirim Uang Pengguna «extend» Admin Memilih Transaksi «extend» Mengambil Uang Melakukan Logout Mengganti Kotak Deposit 2. Business Process Modeling 36 System Analysis and Design with UML 1. System Analysis 1. Business Process Identification 2. Use Case Diagram Business Process Modeling 3. Activity Diagram or Business Process Modeling Notation (BPMN) Business Process Realization Sequence Diagram (Buat untuk setiap use case dengan menggunakan pola Boundary-Control-Entity) 2. System Design 1. Program Design 1. 2. 3. 2. 3. Class Diagram (Gabungkan Boundary-Control-Entity Class dan susun story dari sistem yang dibangun) Package Diagram (Gabungan class yang sesuai, boleh menggunakan pola B-C-E) Deployment Diagram (arsitektur software dari sistem yang dibangun) User Interface Design (Buat UI design dari Boundary Class) Entity-Relationship Model (Buat ER diagram dari Entity Class) 2.1 Business Process Modeling: Activity Diagram 38 BPM With Activity Diagrams • A number of activities support a business process across several departments • Activity diagrams model the behavior in a business process Actions and Activities • Performed for a specific business reason • Names begin with a verb and end with a noun • “Make Appointment” • Each activity normally associated with a use case Object Nodes • Activity and Actions usually modify objects • Object nodes model these objects • Objects represent a flow of information from between activities or actions Control & Object Flows • Control Flows (solid line) • Paths of execution through the business process • Can only be attached to actions or activities • Object Flows (dashed line) • Model the flow of objects through a business process • Show actual objects entering and exiting the system • An object is on one end, an action or activity is on the other end Control Nodes 1. 2. 3. 4. 5. 6. 7. Initial – Only one, at top left Final Activity – Stop the process Final Flow – Stop this flow only Decision – Guarded test conditions Merge – Following decisions Fork – Split parallel execution Join – Join parallel execution Swimlanes • The business process may be broken into persons of responsibility • Identify this with swimlanes Activity Diagram Example Creating Activity Diagrams 1. Set the context or scope of the activity being modeled 2. Identify the activities and control/object flows between activities 3. Identify any decisions made 4. Look for opportunities for parallelism 5. Draw the diagram 2.2 Business Process Modeling: Business Process Modeling Notation 47 Credit Application Purchase Request Shipment Process of a Hardware Retailer The Pizza Collaboration Order Fulfillment and Procurement Studi Kasus: ATM System 57 Activity Diagram: Memasukkan Kartu act AD1 - Memasukkan Kartu Pengguna Sistem ATM Mulai Menyiapkan Kartu Memasukkan Kartu Memv alidasi Kartu kartu valid? tidak Mengeluarkan Kartu ya Menampilkan MenuPIN Selesai Activity Diagram: Memasukkan PIN act AD2 - Memasukkan PIN Pengguna Sistem ATM Mulai tidak Memasukkan PIN Memv alidasi Account pin valid? lebih dari 3x? tidak ya ya Memblokkir Kartu Menampilkan MenuUtama Selesai Activity Diagram: Mengecek Saldo act AD3 - Mengecek Saldo Pengguna Sistem ATM Mulai Memilih Mengecek Saldo di Menu Utama Memproses Pengecekan Saldo Menampilkan Saldo di Menu Saldo Selesai Activity Diagram: Mentransfer Uang act AD4 - Mentransfer Uang Pengguna Sistem ATM Mulai Memilih Mentransfer Uang di Menu Utama tidak Memasukkan Account Tuj uan Memasukkan Jumlah Uang yang dikirim Memv alidasi Account Tuj uan Account Tujuan Valid? ya tidak Menghitung Kecukupan Saldo Pengirim Saldo Cukup? ya Mentransfer Uang Selesai Activity Diagram: Mengambil Uang act AD5 - Mengambil Uang Pengguna Sistem ATM Mulai Memilih Menu Mengambil Uang di Menu Utama tidak Memasukkan Jumlah Uang Mengecek Ketercukupan Saldo Saldo Cukup? ya Memproses Pengambilan Uang Mengambil Uang di Kotak Uang Selesai Mengeluarkan Uang di Kotak Uang Activity Diagram: Melakukan Logout act AD6 - Melakukan Logout Pengguna Sistem ATM Mulai Memilih Keluar di Menu Utama Memproses Logout Mengeluarkan Kuitansi Mengambil Kuitansi Mengambil Kartu Selesai Mengeluarkan Kartu 3. Business Process Realization: Sequence Diagram 64 System Analysis and Design with UML 1. System Analysis 1. Business Process Identification 2. Use Case Diagram Business Process Modeling 3. Activity Diagram or Business Process Modeling Notation (BPMN) Business Process Realization Sequence Diagram (Buat untuk setiap use case dengan menggunakan pola Boundary-Control-Entity) 2. System Design 1. Program Design 1. 2. 3. 2. 3. Class Diagram (Gabungkan Boundary-Control-Entity Class dan susun story dari sistem yang dibangun) Package Diagram (Gabungan class yang sesuai, boleh menggunakan pola B-C-E) Deployment Diagram (arsitektur software dari sistem yang dibangun) User Interface Design (Buat UI design dari Boundary Class) Entity-Relationship Model (Buat ER diagram dari Entity Class) Sequence Diagrams • Illustrate the objects that participate in a use case • Show the messages that pass between objects for a particular use-case over time Sequence Diagram Syntax AN ACTOR AN OBJECT anObject:aClass A LIFELINE A FOCUS OF CONTROL A MESSAGE OBJECT DESTRUCTION aMessage() x Sequence Diagram 1. Susun Sequence Diagram untuk setiap Use Case yang dibuat 2. Mulai dari menarik Actor yang ada di Use Case Diagram, lanjutkan dengan membuat sequence detail dari berjalannya Use Case Catatan: Objek dari Lifeline di Sequence Diagram akan menjadi kandidat Class Jenis Class 1. Boundary Class: 1. Class yang berinteraksi dengan aktor langsung (user interface) 2. Form, input, UI ini masuk di sini 2. Control Class: 1. Class yang berhubungan dengan pemrosesan, penghitungan, kalkulasi, komputasi, query, dst 3. Entity Class: 1. Class yang berhubungan dengan data, penyimpanan data/file Studi Kasus: ATM System 70 Sequence Diagram: Memasukkan Kartu sd SD1 - Memasukkan Kartu Pengguna KotakKartu ProsesValidasiKartu memasukanKartu() validasiKartu() alt kartu v alid? tampilkan() [ya] [tidak] mengeluarkanKartu() (from 1 Use Case Diagram) MenuPIN Sequence Diagram: Memasukkan PIN sd SD2 - Memasukkan PIN Pengguna MenuPIN ProsesValidasiAccount Account memasukkanPIN() validasi(id, pin) getIDLogin() getPIN() alt PIN v alid? tampilkan() [ya] [tidak] alt lebih dari 3x? tampilkan() [tidak] [ya] blokirAccount() errorKartuDiblokir() (from 1 Use Case Diagram) Login MenuUtama Sequence Diagram: Mengecek Saldo sd SD3 - Mengecek Saldo Pengguna MenuUtama ProsesMengecekSaldo Account Balance memilihMengecekSaldo() lihatSaldo(id) getIDBalance() getSaldo() setTransaksi(tgl, jenis) tampilkanHasil(saldo) (from 1 Use Case Diagram) Transaksi MenuMengecekSaldo Sequence Diagram: Mentransfer Uang sd SD4 - Mentransfer Uang Pengguna MenuUtama MenuMentransferUang ProsesMentransferUang Account pengirim:Balance penerima:Balance Transaksi memilihMentransferUang() tampilkan() memasukkanJumlahUang() memasukkanAccountTujuan() transferUang(id, jumlah) getIDBalance() getSaldo() alt saldo cukup? setSaldo(saldo) [ya] setSaldo(saldo) setTransaksi(tgl, jenis) tampilkanUangBerhasilDikirim() [tidak] tampilkanErrorSaldoTidakCukup() (from 1 Use Case Diagram) Sequence Diagram: Mengambil Uang d SD5 - Mengambil Uang Pengguna MenuUtama MenuMengambilUang ProsesMengambilUang Account Balance memilihMengambilUang() (from 1 Use Case Diagram) tampilkan() memasukkanJumlah() ambilUang(id, jumlah) getIDBalance() getSaldo() alt saldo cukup? setSaldo(saldo) [ya] keluarkanUang(jumlah) setTransaksi(tgl, jenis) TampilkanUangBerhasilDiambil() [tidak] TampilkanErrorSaldoTidakCukup() Transaksi KotakUang Sequence Diagram: Melakukan Logout sd SD6 - Melakukan Logout Pengguna MenuUtama MenuLogout ProsesLogout KotakKuitansi KotakKartu memilihKeluar() tampilkan() logout() keluarkanKuitansi() keluarkanKartu() tampilkanTelahKeluar() (from 1 Use Case Diagram) Estimating Project Size with Use Case Points 77 Use Case Points • Alternative to Function Point Approach • Classify actors and use cases as: 1. Simple 2. Average 3. Complex (Gustav Karner, 1993) Actor and Use Case Weighting Tables Unadjusted Actor Weighting (UAW) Actor Type Description Weighting Factor Simple External System with well-defined API 1 Average External System using a protocolbased interface, e.g., HTTP, TCT/IP, SQL 2 Complex Human 3 Unadjusted Use Case Weighting (UUCW) Use-Case Type Description Weighting Factor Simple 1-3 transactions 5 Average 4-7 transactions 10 Complex More than 7 transactions 15 Unadjusted Use Case Points (UUCP) = UAW + UUCW Technical Complexity Factors Factor Number Description Weight T1 Distributed system 2.0 T2 Response time or throughput performance objectives 1.0 T3 End-user online efficiency 1.0 T4 Complex internal processing 1.0 T5 Reusability of code 1.0 T6 Easy to install 0.5 T7 Ease of use 0.5 T8 Portability 2.0 T9 Ease of change 1.0 Technical Complexity Factor (TCF) = 0.6 + (0.01 * TFactor) Environmental Complexity Factors Factor Number Description Weight E1 Familiarity with system development process in use 1.5 E2 Application experience 0.5 E3 Object-oriented experience 1.0 E4 Lead analyst capability 0.5 E5 Motivation 1.0 E6 Requirements stability 2.0 E7 Part time staff -1.0 E8 Difficulty of programming language -1.0 Environmental Factor (EF) = 1.4 + (-0.03 * EFactor) Computing Use Case Points • Adjusted Use Case Points (UCP) = UUCP * TCF * ECF • Effort in Person Hours = UCP * PHM Person Hour Multiplier (PHM) If the sum of (number of Efactors E1 through E6 assigned value < 3) and (number of Efactors E7 and E8 assigned value > 3) ≤ 2 PHM = 20 Else If the sum of (number of Efactors E1 through E6 assigned value < 3) and (number of Efactors E7 and E8 assigned value > 3) = 3 or 4 PHM 28 Else Rethink project; it has too high of a risk for failure Person Hour Multiplier (PHM) • Now it’s time to compute effort • Let F1 = Number of E1 to E6 that are < 3 • Let F2 = Number of E7 and E8 that are > 3 • If F1 + F2 <= 2 PHM = 20 Else if F1 + F2 = 3 or 4 PHM = 28 Else Scrap the project Person Month • UCP = 42 • PH = 20 * UCP = 20*42 = 840 • PM = 840/8/22 = 4.7 (5 P/M) 85 Effort Estimation from PM Defined PM TIME TIME TIME TIME = 840/8/22 = 4.7 P/M = 3.0 * PM 1/3 = 3.0 * 4.7 1/3 = 3.0 * 1.68 = 5 month Effort Estimation from PM Defined PM TIME TIME TIME TIME = 840/12/28 = 2.5 P/M = 3.0 * PM 1/3 = 3.0 * 2.5 1/3 = 3.0 * 1.3 = 4 month Time 88 Use Case Points in EA Effort Estimation from PM Defined PM = 520/8/22 = 2.95 P/M TIME = 3.0 * PM 1/3 TIME = 3.0 * 2.95 1/3 TIME = 3.0 * 1.43 TIME = 4.3 month Budget (Custom Software) Pekerjaan Man-Month Month Budget Total Planning 1 1 5000.000 10.000.000 Analysis 2 1 10.000.000 20.000.000 Design 2 1 4000.000 32.000.000 Implementation 4 2 3000.000 24.000.000 Training 2 1 4000.000 8000.000 94.000.000 Budget (Generic Software) Product Total LMS 10.000.000 Teleconference 2.000.000 Chatting 4.000.000 eLibrary 20.000.000 4. Class Diagram 94 System Analysis and Design with UML 1. System Analysis 1. Business Process Identification 2. Use Case Diagram Business Process Modeling 3. Activity Diagram or Business Process Modeling Notation (BPMN) Business Process Realization Sequence Diagram (Buat untuk setiap use case dengan menggunakan pola Boundary-Control-Entity) 2. System Design 1. Program Design 1. 2. 3. 2. 3. Class Diagram (Gabungkan Boundary-Control-Entity Class dan susun story dari sistem yang dibangun) Package Diagram (Gabungan class yang sesuai, boleh menggunakan pola B-C-E) Deployment Diagram (arsitektur software dari sistem yang dibangun) User Interface Design (Buat UI design dari Boundary Class) Entity-Relationship Model (Buat ER diagram dari Entity Class) Class Diagram Elements 1. 2. 3. 4. Classes Attributes Operations Relationships Classes • Templates for creating instances or objects • All objects of a class have same structure and behavior, but contain different attributes 1. Concrete: used to create actual objects 2. Abstract: extended to create other classes Attributes • Units of information relevant to the description of the class • Only attributes important to the task should be included • Attributes should be primitive types (integers, strings, doubles, date, time, Boolean, etc.) Operations (Methods) • Defines the behavior of the class • Action that instances/objects can take • Focus on relevant problem-specific operations (at this point) Relationships • Generalization • “Is-A” relationship • Enables inheritance of attributes & oper's • Subclasses and superclasses • Principle of substitutability • Subclass be substituted for superclass • Aggregation • “Has-A” relationship • Relates parts to wholes • Uses decomposition Relationships • Association • Relationships that don't fit “Is-A” or “Has-A” • Often a weaker form of “Has-A” • Miscellaneous relationships between classes • Example: • Patient schedules an appointment • So the appointment has a patient • This is weak Example Class Diagram More on Attributes • Derived attributes • /age, for example can be calculated from birth date and current date • Visibility of attributes • +Public: not hidden from any object • #Protected: hidden from all but immediate subclasses • –Private: hidden from all other classes • Default is private More on Operations • Constructor: creates object • Query: see class state • Update: change attribute values • Operations can also be public, protected, or private • Default for operations is public More on Relationships • A primary purpose of class diagrams is to show relationships, or associations, between classes • Class can be related to itself (role) • Use a "+" sign to show it's a role and not the name of a relationship Relationship Multiplicity Exactly one 1 Boss Employee 0..* Child Boss 1..* Employee Employee 0..1 Spouse Specified range Employee 2..4 Vacation Disjoint ranges Employee 1..3, 5 Zero or more One or more Zero or one Dept 106 Committee Class Diagram: Internet Order Project Class Diagram: Sistem ATM class CD - Sistem ATM ProsesValidasiAccount KotakUang Login mengakses KotakKuitansi mengakses memiliki melakukan memiliki ProsesMengecekSaldo MenuMengecekSaldo melakukan MenuPIN SistemATM + Account lihatSaldo() : void memiliki mewarisi menampilkan Balance MenuMentransferUang ProsesMentransferUang memiliki melakukan+ + + mewarisi MenuUtama m_Account: Account m_Balance: Balance m_Transaksi: Transaksi KotakKartu mewarisi MenuMengambilUang melakukan + + ProsesMentransferUang() transferUang() : void mewarisi melakukan ProsesValidasiKartu ProsesMengambilUang MenuLogout melakukan ProsesLogout + + + m_Account: Account m_Balance: Balance m_Transaksi: Transaksi + + ambilUang() : void ProsesMengambilUang() Transaksi 5. Deployment Diagram 109 System Analysis and Design with UML 1. System Analysis 1. Business Process Identification 2. Use Case Diagram Business Process Modeling 3. Activity Diagram or Business Process Modeling Notation (BPMN) Business Process Realization Sequence Diagram (Buat untuk setiap use case dengan menggunakan pola Boundary-Control-Entity) 2. System Design 1. Program Design 1. 2. 3. 2. 3. Class Diagram (Gabungkan Boundary-Control-Entity Class dan susun story dari sistem yang dibangun) Package Diagram (Gabungan class yang sesuai, boleh menggunakan pola B-C-E) Deployment Diagram (arsitektur software dari sistem yang dibangun) User Interface Design (Buat UI design dari Boundary Class) Entity-Relationship Model (Buat ER diagram dari Entity Class) System Architectures Components • Servers • Mainframes, Minis, Micros • Clients • Input/Output HW used by users • Terminals, PCs, special purpose HW • Network • HW and SW to connect clients to servers Deployment Diagram Components • Nodes • Any piece of hardware in the model • A computational resource • Labeled by its name • Stereotype to label the type of node • Artifacts • Piece of the information system • Such as software or a database table Deployment Diagram Components • Node with Deployed Artifact • Shows artifact placed on a physical node • Good for showing distribution data or software • Communication paths • Links between nodes of the network Deployment Diagram Node Node with Deployment Artifact Artifact Communication Path Deployment Diagram Examples Deployment Diagram (2 Tier) deployment 5. Deployment Diagram «device» Sistem ATM (Client) Kotak Kartu «device» Database Serv er Layar «TCP/IP» Kotak Uang Kotak Kuitansi «interface» Database Serv er:: Account 6. Data Model 117 System Analysis and Design with UML 1. System Analysis 1. Business Process Identification 2. Use Case Diagram Business Process Modeling 3. Activity Diagram or Business Process Modeling Notation (BPMN) Business Process Realization Sequence Diagram (Buat untuk setiap use case dengan menggunakan pola Boundary-Control-Entity) 2. System Design 1. Program Design 1. 2. 3. 2. 3. Class Diagram (Gabungkan Boundary-Control-Entity Class dan susun story dari sistem yang dibangun) Package Diagram (Gabungan class yang sesuai, boleh menggunakan pola B-C-E) Deployment Diagram (arsitektur software dari sistem yang dibangun) User Interface Design (Buat UI design dari Boundary Class) Entity-Relationship Model (Buat ER diagram dari Entity Class) Data Model References 1. 2. 3. 4. 5. 6. 7. Rachel Harrison, Study Guide TOGAF® 9 Foundation 2nd Edition, The Open Group, 2011 Rachel Harrison, Study Guide TOGAF® 9 Certified 2nd Edition, The Open Group, 2011 Open Group Standard, TOGAF® Version 9.1 (G116), The Open Group, 2011 Open Group Standard, TOGAF® Version 9.1 – A Pocket Guide (G117), The Open Group, 2011 Daniel Minoli, Enterprise Architecture A to Z: Frameworks, Business Process Modeling, SOA, and Infrastructure Technology, Taylor & Francis, 2008 Jon Holt and Simon Perry, Modelling Enterprise Architectures, The Institution of Engineering and Technology, 2010 Alan Dennis et al, Systems Analysis and Design with UML 4th Edition, John Wiley and Sons, 2013 120