16
System Analysis and Design Class Diagram

System Analysis and Design - whyphi.staff.telkomuniversity ... · nomor account. Account di Bank dapat berupa Tabungan dan Deposito. •Setiap account dapat melakukan transaksi yang

  • Upload
    others

  • View
    1

  • Download
    1

Embed Size (px)

Citation preview

Page 1: System Analysis and Design - whyphi.staff.telkomuniversity ... · nomor account. Account di Bank dapat berupa Tabungan dan Deposito. •Setiap account dapat melakukan transaksi yang

System Analysis and Design

Class Diagram

Page 2: System Analysis and Design - whyphi.staff.telkomuniversity ... · nomor account. Account di Bank dapat berupa Tabungan dan Deposito. •Setiap account dapat melakukan transaksi yang

Class Diagram Component

• Class & Object• Attributes & Operation

• Associations• Association Class

• Aggregation & Composition

• Generalization

Page 3: System Analysis and Design - whyphi.staff.telkomuniversity ... · nomor account. Account di Bank dapat berupa Tabungan dan Deposito. •Setiap account dapat melakukan transaksi yang

Class Diagram Syntax

A CLASS

AN ATTRIBUTE

AN OPERATION

AN ASSOCIATION

Class 1

-attribute

+operation ()

Attribute name/derived attribute name

operation name ()

1..* 0..1______verb phrase____

Page 4: System Analysis and Design - whyphi.staff.telkomuniversity ... · nomor account. Account di Bank dapat berupa Tabungan dan Deposito. •Setiap account dapat melakukan transaksi yang

Classes• Templates for creating instances or objects

• Types of class• Concrete (has objects)

• Abstract

• Another types: the type of real-world thing that it represents• Application domain, user interface, data structure, file

structure, operating environment, document, and multimedia classes

Page 5: System Analysis and Design - whyphi.staff.telkomuniversity ... · nomor account. Account di Bank dapat berupa Tabungan dan Deposito. •Setiap account dapat melakukan transaksi yang

Attributes

• Units of information relevant to the description of the class

• Only attributes important to the task should be included

• include only those attributes that are relevant to the current application

• “size” for a TV object is not necessary if the application is concerned only with connections between TV and other objects

• do not attempt to include every attribute at the beginning• more attributes can be added when the model is iterated

• iteration of the model occurs almost at all times, particularly for large projects

Page 6: System Analysis and Design - whyphi.staff.telkomuniversity ... · nomor account. Account di Bank dapat berupa Tabungan dan Deposito. •Setiap account dapat melakukan transaksi yang

Attributes (Cont)

• Avoid derivable attributes; instead, create a function to derive each such attribute• “age” can be derived from “birthday” and “current-date”

• “total” of all transactions can be dynamically computed when necessary, rather than storing it somewhere

• “discount price” can be computed using current-price and discount factor

Page 7: System Analysis and Design - whyphi.staff.telkomuniversity ... · nomor account. Account di Bank dapat berupa Tabungan dan Deposito. •Setiap account dapat melakukan transaksi yang

Operations

• Action that instances/objects can take

• Focus on relevant problem-specific operations (at this point)

Page 8: System Analysis and Design - whyphi.staff.telkomuniversity ... · nomor account. Account di Bank dapat berupa Tabungan dan Deposito. •Setiap account dapat melakukan transaksi yang

Association Classes

Miscellaneous relationships between classesA patient – an appointment

Page 9: System Analysis and Design - whyphi.staff.telkomuniversity ... · nomor account. Account di Bank dapat berupa Tabungan dan Deposito. •Setiap account dapat melakukan transaksi yang

Generalization

• Enables inheritance of attributes and operations

• Ex:• A CUSTOMER class and an

EMPLOYEE class can be generalized into a PERSON class by extracting the attributes and operations in common

• It is represented with the a-kind-of relationship

Page 10: System Analysis and Design - whyphi.staff.telkomuniversity ... · nomor account. Account di Bank dapat berupa Tabungan dan Deposito. •Setiap account dapat melakukan transaksi yang

Composition & Aggregation

Relates parts to wholesA part of or has parts

A door is a part of a carAn employee is a-part of a department

Page 11: System Analysis and Design - whyphi.staff.telkomuniversity ... · nomor account. Account di Bank dapat berupa Tabungan dan Deposito. •Setiap account dapat melakukan transaksi yang

Identify as association if it is not clear whether it is association or aggregation

• “Mail” has “Address” (aggregation)

• “Mail” uses “Address” for delivery (association)

• “Customer” has “Address” (aggregation)

• “Customer” resides at “Address” (association)

• “TV” includes “Screen” (aggregation)

• “TV” sends information to “Screen” (association)

• “Customer” is a “Users” (generalization/specialization)

Page 12: System Analysis and Design - whyphi.staff.telkomuniversity ... · nomor account. Account di Bank dapat berupa Tabungan dan Deposito. •Setiap account dapat melakukan transaksi yang

Multiplicity of relationship

Page 13: System Analysis and Design - whyphi.staff.telkomuniversity ... · nomor account. Account di Bank dapat berupa Tabungan dan Deposito. •Setiap account dapat melakukan transaksi yang

Example - Online shop

Page 14: System Analysis and Design - whyphi.staff.telkomuniversity ... · nomor account. Account di Bank dapat berupa Tabungan dan Deposito. •Setiap account dapat melakukan transaksi yang

CASE 1

Give explanation for this class diagram

Page 15: System Analysis and Design - whyphi.staff.telkomuniversity ... · nomor account. Account di Bank dapat berupa Tabungan dan Deposito. •Setiap account dapat melakukan transaksi yang

Case 2

Buatlah sebuah class diagram untuk sebuah Bank berdasarkan deskripsiberikut:

• Bank memiliki banyak cabang yang dapat diidentifikasi berdasarkan kodedan alamatnya

• Di setiap cabang memiliki account yang menyimpan informasi saldo dannomor account. Account di Bank dapat berupa Tabungan dan Deposito.

• Setiap account dapat melakukan transaksi yang memiliki ID trans, tanggal, tipe, jumlah, dan saldo setelah transaksi.

• Satu nasabah dapat memiliki satu atau lebih account di cabang. Seorangnasabah memiliki informasi nama, alamat, tanggal lahir.

• NOTE: identifikasi operation/method yang dapat dimiliki oleh masing2 class

Page 16: System Analysis and Design - whyphi.staff.telkomuniversity ... · nomor account. Account di Bank dapat berupa Tabungan dan Deposito. •Setiap account dapat melakukan transaksi yang

Case 3

• Create Use Case Diagram from iGracias case study• Write additional assumption (if any)