6 ADSI Pemodelan Kebutuhan OO
6 ADSI Pemodelan Kebutuhan OO
Atribut2
Operasi2
Object, Class – Apa Itu ?
• Klas (Class) :
▪ A description of one or more objects with a uniform set of attributes
and services, including a description of how to create new objects in
the class [Yourdon]
▪ Gambaran umum (template, blue-print) yang menjelaskan
sekumpulan objek yang memiliki kesamaan karakteristik (atribut dan
operasi)
▪ Merupakan cetakan dari objek
▪ Digunakan untuk menginstansiasi objek yang memiliki identitas yang
berbeda
▪ Contoh : Klas Mahasiswa objek Andi, Eko, Susi
▪ Abstract & concrete class
Object, Class – Apa Itu ?
Mahasiswa
- NIM
Instansiasi : - Nama
penciptaan objek
- Buat skripsi
- Ujian
Enter object
Select product
Customer
Actors Customer
Alternative flows 1. If the selected product is not available, the system will display
a message “Your selected product is not available”.
2. If the selected product is available but there isn’t enough
number to order, the system will display a message “The
number isn’t enough, max. x”. X is the existing number of the
product.
<<include>>
OpenIncident
ViewMap
Base Use
Case <<include>>
Supplier
AllocateResources
Use Case
Base Use
Case B
Help
A <<extend>>
ReportEmergency
Actor-generalization
• Two/more sub-actors generalized into a super-actor
• Have both behavior and attributes in common – described under
the super-actor
• Super-actor should interact with use cases when ALL of its sub-
actors interact in the same way
• Sub-actors should interact with use cases when their individual
interactions differ from that of the super-actor
Actor-generalization
Class diagram
• Menggambarkan struktur statis dari sistem
• Terdiri dari node (klas) dan relasi
• Jenis relasi
▪ Generalization (‘is a’ – inheritance)
▪ Association
▪ Aggregation (‘part-of’)
▪ Composition
Association
• For “real-world objects” is there an association between classes?
• Classes A and B are associated if:
▪ An object of class A sends a message to an object of B
▪ An object of class A creates an instance of class B
▪ An object of class A has an attribute of type B or collections of
objects of type B
▪ An object of class A receives a message with an argument that is an
instance of B (maybe…) will it “use” that argument?
• Does an object of class A need to know about some object of class
B?
Aggregation – composition
• Aggregation represents a part-whole or part-of relationship
• Aggregation can occur when a class is a collection or container of
other classes, but where the contained classes do not have a
strong life cycle dependency on the container – essentially, if the
container is destroyed, its contents are not
• Composition is more specific than aggregation
• Composition usually has a strong life cycle dependency between
instances of the container class and instances of the contained
class(es) if the container is destroyed, normally every instance
that it contains is destroyed as well
Class relationships – examples
Class stereotypes
• Boundary classes
▪ model the interaction and manage communication between the
computer system and its actors, but don’t directly represent the
specific interface object in the implementation
▪ used to identify the main logical interfaces with users and other
systems (including e.g. other software packages, printers)
▪ main task is to translate information across system boundaries
▪ partition the system so that interface is kept separate from business
logic
Class stereotypes
• Entity classes
▪ used to model data and behavior of some real life system concept or
entity e.g. member, bank account, order, employee
▪ these will sometimes require more persistent storage of information
e.g. a student’s details are ultimately stored as a student record
• Control classes
▪ represent coordination, sequencing, transactions and control of other
objects
▪ glue between boundary elements and entity elements, describing the
logic required to manage the various elements and their interactions
▪ roughly one per use case
Class stereotypes
<<control>>
<<boundary>> <<boundary>>
Actor 1 Actor 2
<<entity>> <<entity>>
: Products :
: Customer : SelectionScreen : SelectionController
DispenserProduct
selectProduct( )
getValidSelection(String)
isProductAvailable(String)
dispenseProduct(String, int)
Statechart diagram
• A statechart diagram shows the behavior of classes in response to
external stimuli
• This diagram models the dynamic flow of control from state to
state within a system
Statechart diagram – example
initial
accept new coin
Waiting for a
coin payment returned
accept new coin
coin detected
accept customer coin return request
request return payment
product dispensed
Waiting for Returning
accept new coin
selection payment
product
sufficient payment available=FALSE
dispense product return payment
Dispensing
product
Alat Bantu
• Structured Analysis :
▪ Aplikasi pengolah model : Visio, dll.
▪ Aplikasi pengolah kata : MS Word, dll.
▪ CASE Tool : StP (Software through Picture), PSL/PSA (Problem
Statement Language/Problem Statement Anaylzer), ILeaf, SPMS, dll.
• OO Analysis :
▪ Aplikasi pengolah model : Visio, dll.
▪ Aplikasi pengolah kata : MS Word, dll.
▪ CASE Tool : Rational RequisitePro, Rational Soda for Word, Rational
Rose, ArgoUML, dll.
Dokumentasi
• Introduction
▪ 1.1. Purpose of the requirements document
▪ 1.2. Scope of the product
▪ 1.3. Definition, acronyms and abbreviations
▪ 1.4. References
• General Description
▪ 2.1. Product perspective
▪ 2.2. Product functions
▪ 2.3. User characteristics
▪ 2.4. General constraints
• Specific Requirements
▪ All functional and non-functional requirements, system models (eg. DFD/CFD, ERD, STD,
Use-Case, Class, Sequence, Statechart diagrams), performance, database requirements,
design constraints, security.
• Qualification/Validation Requirements
• Appendices/Bibliography
Summary
• Pemodelan berorientasi objek meliputi use-case, class, sequence
dan state dari sistem yang sedang dikembangkan
• Alat bantu yang digunakan dalam pemodelan terstruktur dan
berorientasi objek terdapat perbedaan
• Dokumentasi yang dihasilkan dari RE terdiri IRS dan SRS
Terima Kasih
Ada Pertanyaan