Pemrograman Berorientasi Objek (Object Oriented Programming)
Adam Hendra Brata · •Berorientasi pada objek / data •Booch (1994), Meyer ... • OOP is...
-
Upload
nguyennhan -
Category
Documents
-
view
214 -
download
0
Transcript of Adam Hendra Brata · •Berorientasi pada objek / data •Booch (1994), Meyer ... • OOP is...
TUJUAN PERKULIAHAN
• Memahami pemodelan perancangan dengan pendekatan
berorientasi objek
T E K N I K I N FO R M AT I K A F I L KO M U B
S E M E S T E R G E N A P 2 0 1 5 / 2 01 6
APS
AGENDA PERKULIAHAN
• Pemodelan perancangan berorientasi objek
T E K N I K I N FO R M AT I K A F I L KO M U B
S E M E S T E R G E N A P 2 0 1 5 / 2 01 6
APS
METODE PEMODELAN PERANCANGAN TERSTRUKTUR
T E K N I K I N FO R M AT I K A F I L KO M U B
S E M E S T E R G E N A P 2 0 1 5 / 2 01 6
APS
• Object Oriented Design
• Berorientasi pada objek / data
• Booch (1994), Meyer (1988), Jacobson et all (1993), dll.
OOA, OOD, OOP
T E K N I K I N FO R M AT I K A F I L KO M U B
S E M E S T E R G E N A P 2 0 1 5 / 2 01 6
APS
• Object-oriented analysis, design and programming are
related but distinct
• OOA is concerned with developing an object model of the
application domain
• OOD is concerned with developing an object-oriented
system model to implement requirements
• OOP is concerned with realising an OOD using an OO
programming language such as Java or C++
KONSEP
T E K N I K I N FO R M AT I K A F I L KO M U B
S E M E S T E R G E N A P 2 0 1 5 / 2 01 6
APS
• Metode untuk melakukan dekomposisi arsitektur sistemberdasarkan objek-objek yang dimanipulasi oleh sistemyang sedang dibangun
• Identifikasi dan mendefinisikan klas-klas tambahan ygmerefleksikan implementasi dari kebutuhan-kebutuhanhasil analisis
• Notasi = OOA
• Proses
• Perancangan sistem : struktur klas, user interface, data management
• Perancangan objek : atribut/struktur data, algoritmaoperasi
STRUKTUR KLAS
T E K N I K I N FO R M AT I K A F I L KO M U B
S E M E S T E R G E N A P 2 0 1 5 / 2 01 6
APS
• Gunakan klas-klas hasil analisis dan tambahkan sesuai
dengan kebutuhan perancangan
• Reuse jika memungkinkan
• packaging : pengelompokan klas-klas yg sesuai
PACKAGE DIAGRAM
T E K N I K I N FO R M AT I K A F I L KO M U B
S E M E S T E R G E N A P 2 0 1 5 / 2 01 6
APS
MENEMUKAN KLAS
T E K N I K I N FO R M AT I K A F I L KO M U B
S E M E S T E R G E N A P 2 0 1 5 / 2 01 6
APS
• Identifying object classes is often a difficult part of object oriented design
• There is no 'magic formula' for object identification. It relies on the skill, experience and domain knowledge of system designers.
• Object identification is an iterative process. You are unlikely to get it right first time.
• Use domain analysis as before
• Use a grammatical approach based on a natural language description of the system
• Base the identification on tangible things in the application domain
MENEMUKAN KLAS
T E K N I K I N FO R M AT I K A F I L KO M U B
S E M E S T E R G E N A P 2 0 1 5 / 2 01 6
APS
• Hint
• Derive them from the use cases (descriptions/scenarios)
• Look for data which must be stored or analysed
• Are there external systems?
• Are there any devices under the control of the system?
• Are there any organisational parts?
PERANCANGAN OBJEK
T E K N I K I N FO R M AT I K A F I L KO M U B
S E M E S T E R G E N A P 2 0 1 5 / 2 01 6
APS
• Attributes
• Describe the state and characteristics of the object
• Must be typed : primitive or class
• Only name and type are mandatory
• Operations
• Operations manipulate attributes and perform other
tasks
• Scope is the class
• Operation signature is composed of name, parameters
and return type
PERANCANGAN OBJEK
T E K N I K I N FO R M AT I K A F I L KO M U B
S E M E S T E R G E N A P 2 0 1 5 / 2 01 6
APS
• Sifat akses atribut dan operasi/service :
• private (klas/objek ybs.)
• protected (klas/objek ybs. dan turunannya)
• public (semua klas/objek)
• Algoritma operasi untuk implementasi spesifikasi dari
setiap operasi
• operasi manipulasi data (set, delete, get, dll.)
• operasi komputasi
• operasi pengontrolan
OPERASI - POLIMORFISME
T E K N I K I N FO R M AT I K A F I L KO M U B
S E M E S T E R G E N A P 2 0 1 5 / 2 01 6
APS
• Polymorphism means many (poly) shapes (morph)• private (klas/objek ybs.)• protected (klas/objek ybs. dan turunannya)• public (semua klas/objek)
• There are two kinds of polymorphism
• Polymorphism means many (poly) shapes (morph)• Overloading• Two or more methods with different signatures with the
same name• They essentially do the same thing, e.g. class constructors
• Overriding• Replacing an inherited method class with another having
the same signature (no matter with different parameter’s name)
• Do different thing using the same method’s signature
PENUTUP
T E K N I K I N FO R M AT I K A F I L KO M U B
S E M E S T E R G E N A P 2 0 1 5 / 2 01 6
APS
• Pemodelan perancangan dilakukan berdasarkan hasil
pemodelan analisis kebutuhan (RE modeling)
• Transform dan transaction mapping digunakan untuk
membangun arsitektur PL berdasarkan DFD
• OOD dilakukan berdasarkan hasil OOA dengan perluasan
klas jika diperlukan untuk keperluan implementasi