if2036 class based-modeling

33
IF2036 Rekayasa Perangkat Lunak Class-based Modeling Sem II 2012/2013

Upload: metciankcemuah

Post on 17-Dec-2014

126 views

Category:

Documents


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: If2036 class based-modeling

IF2036 Rekayasa Perangkat LunakClass-based Modeling

Sem II 2012/2013

Page 2: If2036 class based-modeling

Apa yang dimodelkan? Apa saja elemen class model? Bagaimana cara membuatnya? Apa tahapannya?

Class-based Modeling

2 IF2036 RPL - Class-based Modeling

Page 3: If2036 class based-modeling

Represents objects system manipulates, operations applied to objects, and collaborations occurring between classes

Elements of class model include: classes, objects, attributes, operations, CRC models, collaboration diagrams, and packages

Class-based Modeling

3 IF2036 RPL - Class-based Modeling

Page 4: If2036 class based-modeling

Identifikasi Kelas Menentukan Atribut Menentukan Operasi Menentukan Hubungan Antar Kelas Membuat Diagram Kelas Membuat Diagram Paket (jika perlu)

Tahapannya:

4 IF2036 RPL - Class-based Modeling

Page 5: If2036 class based-modeling

Examine the problem statement and try to find nouns that fit the following categories and produce or consume information (i.e. grammatical parse) External entities (systems, devices, people) Things (e.g. reports, displays, letters, signals) Events occurring during system operation Roles (e.g. manager, engineer, salesperson) Organizational units (e.g. division, group, team) Places Structures (e.g. sensors, vehicles, computers)

Identifying Analysis Classes

5 IF2036 RPL - Class-based Modeling

Page 6: If2036 class based-modeling

Contains information that should be retained Provides needed services Contains multiple attributes Has common set of attributes that apply to all

class instances Has common set of operations that apply to all

object instances Represents external entity that produces or

consumes information

Class Selection Criteria

6 IF2036 RPL - Class-based Modeling

Page 7: If2036 class based-modeling

Entity classes extracted directly from problem statement (things stored in a database and persist throughout application)

Boundary classes used to create the interface that user sees and interacts with as software is used

Controller classes manage unit of work from start to finish Create or update entity objects Instantiate boundary objects Complex communication between sets of objects Validation of data communicated between actors

Analysis Classes

7 IF2036 RPL - Class-based Modeling

Page 8: If2036 class based-modeling

Examine the processing narrative or use-case and select the things that reasonably can belong to each class

Ask what data items (either composite or elementary) fully define this class in the context of the problem at hand?

Specifying Class Attributes

8 IF2036 RPL - Class-based Modeling

Page 9: If2036 class based-modeling

 Look at the verbs in the processing narrative and identify operations reasonably belonging to each class that (i.e. grammatical parse) manipulate data perform computation inquire about the state of an object monitor object for occurrence of controlling event

Divide operations into sub-operations as needed Also consider communications that need to occur

between objects and define operations as needed

Defining Operations

9 IF2036 RPL - Class-based Modeling

Page 10: If2036 class based-modeling

IF2036 RPL - Class-based Modeling10

Class

System

program() display() reset() query() modify() call()

systemID verificationPhoneNumber systemStatus delayTime telephoneNumber masterPassword temporaryPassword numberTries

Class name

attributes

operations

Page 11: If2036 class based-modeling

IF2036 RPL - Class-based Modeling11

Class Diagram FloorPlan

determineType () positionFloorplan scale() change color()

type name outsideDimensions

Camera

determineType () translateLocation () displayID() displayView() displayZoom()

type ID location fieldView panAngle ZoomSetting

WallSegment

type startCoordinates stopCoordinates nextWallSement

determineType () draw()

Window

type startCoordinates stopCoordinates nextWindow

determineType () draw()

is placed within

Wall

type wallDimensions

determineType () computeDimensions ()

Door

type startCoordinates stopCoordinates nextDoor

determineType () draw()

is part of

is used to buildis used to build

is used to build

Page 12: If2036 class based-modeling

Apakah itu? Untuk apa? Apa isinya?

CRC

12 IF2036 RPL - Class-based Modeling

Page 13: If2036 class based-modeling

Develop a set of index cards that represent the system classes

One class per card Cards are divide into three sections (class name,

class responsibilities, class collaborators) Once a complete CRC card set is developed it is

reviewed examining the usage scenarios

Class-Responsibility-Collaborator (CRC) Modeling

13 IF2036 RPL - Class-based Modeling

Page 14: If2036 class based-modeling

IF2036 RPL - Class-based Modeling14

CRC Modeling

Class:

Description:

Responsibility: Collaborator:

Class:

Description:

Responsibility: Collaborator:

Class:

Description:

Responsibility: Collaborator:

Class: FloorPlan

Description:

Responsibility: Collaborator:

incorporates walls, doors and windows

shows position of video cameras

defines floor plan name/type

manages floor plan positioning

scales floor plan for display

scales floor plan for display

Wall

Camera

Page 15: If2036 class based-modeling

Distribute system intelligence evenly State each responsibility as generally as possible Information and its related behaviors should

reside within the same class Localize all information about one thing in a single

class Share responsibilities among related classes when

appropriate

Allocating Responsibilities to Classes

15 IF2036 RPL - Class-based Modeling

Page 16: If2036 class based-modeling

Any time a class cannot fulfill a responsibility on its own it needs to interact with another class

A server object interacts with a client object to fulfill some responsibility

Collaborations

16 IF2036 RPL - Class-based Modeling

Page 17: If2036 class based-modeling

IF2036 RPL - Class-based Modeling17

Collaborations (2) Classes fulfill their responsibilities in one of two ways:

A class can use its own operations to manipulate its own attributes, thereby fulfilling a particular responsibility, or

a class can collaborate with other classes.

Collaborations identify relationships between classes Collaborations are identified by determining whether a class can fulfill

each responsibility itself three different generic relationships between classes [WIR90]:

the is-part-of relationship the has-knowledge-of relationship the depends-upon relationship

Page 18: If2036 class based-modeling

IF2036 RPL - Class-based Modeling18

Composite Aggregate Class

Player

PlayerHead PlayerArms PlayerLegsPlayerBody

Page 19: If2036 class based-modeling

IF2036 RPL - Class-based Modeling19

Associations and Dependencies Two analysis classes are often related to one

another in some fashion In UML these relationships are called associations Associations can be refined by indicating multiplicity

(the term cardinality is used in data modeling In many instances, a client-server relationship

exists between two analysis classes. In such cases, a client-class depends on the server-

class in some way and a dependency relationship is established

Page 20: If2036 class based-modeling

IF2036 RPL - Class-based Modeling20

Multiplicity

WallSegment Window Door

Wall

is used to buildis used to build

is used to build1..*

1 1 1

0..* 0..*

Page 21: If2036 class based-modeling

IF2036 RPL - Class-based Modeling21

Dependencies

CameraDisplayWindow

{password}

<<access>>

Page 22: If2036 class based-modeling

 Each review participant is given a subset of the CRC cards (collaborating cards must be separated)

All use-case scenarios and use-case diagrams should be organized into categories

Review leader chooses a use-case scenario and begins reading it out loud

Each time a named object is read a token is passed to the reviewer holding the object's card

When the reviewer receives the token, he or she is asked to describe the responsibilities listed on the card

The group determines whether one of the responsibilities on the card satisfy the use-case requirement or not

If the responsibilities and collaborations on the index card cannot accommodate the use-case requirements then modifications need to be made to the card set

Reviewing CRC Models

22 IF2036 RPL - Class-based Modeling

Page 23: If2036 class based-modeling

Categorization is an important part of analysis modeling

Analysis packages are made up of classes having the same categorization

In class diagrams visibility of class elements can be indicated using a + (public), - (private), # (package)

Analysis Packages

23 IF2036 RPL - Class-based Modeling

Page 24: If2036 class based-modeling

IF2036 RPL - Class-based Modeling24

Analysis Packages

Environment

+Tree+Landscape+Road+Wall+Bridge+Building+VisualEffect+Scene

Characters

+Player+Protagonist+Antagonist+SupportingRole

RulesOfTheGame

+RulesOfMovement+ConstraintsOnAction

package name

Page 25: If2036 class based-modeling

Akan dibangun sebuah perangkat lunak untuk mendukung proses pendaftaran ulang mahasiswa secara online. Melalui aplikasi tersebut, mahasiswa dapat mengajukan usulan pengambilan matakuliah. Selanjutnya, dosen wali dapat melihat usulan pengambilan matakuliah untuk disetujui/ditolak. Usulan yang ditolak dapat direvisi kembali oleh mahasiswa. Usulan yang telah disetujui wali dapat langsung diproses oleh Petugas Administrasi untuk pencetakan KSM. KSM hanya bisa dicetak apabila status pembayaran SPP mahasiswa sudah beres. Informasi status pembayaran SPP diperoleh dari perangkat lunak lain yaitu SISKEU (Sistem Informasi Keuangan). Perangkat lunak ini juga akan berhubungan dengan perangkat lunak SIKAD (Sistem Informasi Akademik) untuk mendapatkan informasi tentang matakuliah yang ditawarkan pada semester tersebut, serta informasi transkrip nilai mahasiswa, agar dosen wali mendapatkan referensi untuk menyetujui/menolak usulan pengambilan matakuliah.

Latihan

25 IF2036 RPL - Class-based Modeling

Page 26: If2036 class based-modeling

Akan dibangun sebuah perangkat lunak untuk mendukung proses pendaftaran ulang mahasiswa secara online. Melalui aplikasi tersebut, mahasiswa dapat mengajukan usulan pengambilan matakuliah. Selanjutnya, dosen wali dapat melihat usulan pengambilan matakuliah untuk disetujui/ditolak. Usulan yang ditolak dapat direvisi kembali oleh mahasiswa. Usulan yang telah disetujui wali dapat langsung diproses oleh Petugas Administrasi untuk pencetakan KSM. KSM hanya bisa dicetak apabila status pembayaran SPP mahasiswa sudah beres. Informasi status pembayaran SPP diperoleh dari perangkat lunak lain yaitu SISKEU (Sistem Informasi Keuangan). Perangkat lunak ini juga akan berhubungan dengan perangkat lunak SIKAD (Sistem Informasi Akademik) untuk mendapatkan informasi tentang matakuliah yang ditawarkan pada semester tersebut, serta informasi transkrip nilai mahasiswa, agar dosen wali mendapatkan referensi untuk menyetujui/menolak usulan pengambilan matakuliah.

Kandidat Kelas ?

26 IF2036 RPL - Class-based Modeling

Page 27: If2036 class based-modeling

Akan dibangun sebuah perangkat lunak untuk mendukung proses pendaftaran ulang mahasiswa secara online. Melalui aplikasi tersebut, mahasiswa dapat mengajukan usulan pengambilan matakuliah. Selanjutnya, dosen wali dapat melihat usulan pengambilan matakuliah untuk disetujui/ditolak. Usulan yang ditolak dapat direvisi kembali oleh mahasiswa. Usulan yang telah disetujui wali dapat langsung diproses oleh Petugas Administrasi untuk pencetakan KSM. KSM hanya bisa dicetak apabila status pembayaran SPP mahasiswa sudah beres. Informasi status pembayaran SPP diperoleh dari perangkat lunak lain yaitu SISKEU (Sistem Informasi Keuangan). Perangkat lunak ini juga akan berhubungan dengan perangkat lunak SIKAD (Sistem Informasi Akademik) untuk mendapatkan informasi tentang matakuliah yang ditawarkan pada semester tersebut, serta informasi transkrip nilai mahasiswa, agar dosen wali mendapatkan referensi untuk menyetujui/menolak usulan pengambilan matakuliah.

Kandidat Kelas

27 IF2036 RPL - Class-based Modeling

Page 28: If2036 class based-modeling

Pendaftaran bisa jadi atribut Mahasiswa Mahasiswa Usulan pengambilan FRS Matakuliah Wali Petugas Adm di luar sistem Pencetakan KSM sama dg FRS tetapi statusnya beda Status Pembayaran jadi atribut Kelas dibuka SIKAD di luar sistem SISKEU di luar sistem Transkrip Kumpulan Nilai

Kandidat Kelas

28 IF2036 RPL - Class-based Modeling

Page 29: If2036 class based-modeling

Entity Classes: Mahasiswa Wali Matakuliah Kelas_dibuka Usulan FRS KSM

Controller Classes: PendaftaranController TranskripManager ...

Boundary Classes: FormEntriFRS TranskripDisplay ....

Kandidat Kelas

29 IF2036 RPL - Class-based Modeling

Page 30: If2036 class based-modeling

Hubungan antar kelas – Diagram Kelas(potongan)

Mahasiswa Wali

PendaftaranController

MataKuliah

FormEntriFRS

FRS

30 IF2036 RPL - Class-based Modeling

Page 31: If2036 class based-modeling

Mahasiswa: NIM Nama Alamat Tgl_Lahir Status_Daftar

FRS Sem Tahun Kd_kul1 Kelas1 Kd_kul2 Kelas2 ...

Atribut

31 IF2036 RPL - Class-based Modeling

Page 32: If2036 class based-modeling

Mahasiswa DaftarUlang() Cuti() GantiAlamat()

FRS TambahUsulan() HapusUsulan() UbahUsulan() MintaPersetujuan()

Operasi

32 IF2036 RPL - Class-based Modeling

Page 33: If2036 class based-modeling

Identifikasi kelas-kelas analisisnya Lengkapi dengan atribut dan operasinya Gambarkan diagram kelasnya Gambarkan diagram package-nya (jika perlu)

Tugas Lanjutan PL Kantin ITB (Selasa 5 Maret 2013)

33 IF2036 RPL - Class-based Modeling