Presentation on theme: "OBJECT ORIENTED PROGRAMMING Using C++"— Presentation transcript:
1OBJECT ORIENTED PROGRAMMING Using C++ BAHASA PEMROGRAMAN 2OBJECT ORIENTED PROGRAMMINGUsing C++
2Tentang saya Wahyu S. J. Saputra, S.Kom S1 Teknik Informatika UPN “Veteran” JatimTugas:
3TujuanUmumMahasiswa memahami paradigma pemrograman berorientasi objek dalam lingkungan bahasa C++.KhususMahasiswa memahami konsep class dan object.Mahasiswa memahami konsep constructor dan destructor.Mahasiswa memahami konsep polymorphism.Mahasiswa memahami konsep inheritance.
4Buku ReferensiObject Oriented Programming with C++, E. Balagurusamy, Tata McGraw-Hill, 1995.Internet.Bahan Kuliah : map ke server LAN\\ \kuliah
6Satuan Acara Perkuliahan Kontrak Kuliah + Pengenalan Dasar OOPClass dan Object 1Class dan Object 2Class dan Object 3Constructors dan Destructors 1Constructors dan Destructors 2Demo Program/ QuizUTSPolymorphism/ OverloadingInheritance 1Inheritance 2Pointer dan Virtual FunctionOO Development + QuizDemo Program 1 Kelompok 1 – 5.Demo Program 2 Kelompok 6 – 10.UAS
7CATATAN Toleransi keterlambatan hadir adalah 30 menit. Mahasiswa harus berpakaian rapi dengan baju berkerah dan bersepatu.Tidak ada toleransi untuk kecurangan selama ujian tulis.Ujian/ tugas susulan akan diberikan dengan menunjukkan surat keterangan yang jelas.
8Case Studies FRS Online SIM Nilai Praktikum Penjualan Voucher HP Tarif Jasa ParkirSIM Gaji PegawaiBilling WarnetPendaftaran Mahasiswa BaruSIM Hewan di Kebun BinatangPenjualan Sepeda MotorRental VCD
10Edsger DijkstraThe machines have become several orders of magnitude more powerful!As long as there were no machines, programming was no problem at all;When we had a few weak computers, programming became a mild problem, andNow we have gigantic computers, programming has become an equally gigantic problem.
11SOFTWARE CRISIS 60% projects had schedule overruns, 50% projects had cost overruns,45% projects could not be used,29% projects was never delivered, and19% projects had to be reworked to be used.*USA contractors surveyed
12Object-oriented programming addresses those problem by strongly emphasizing modularity in software. Modul is a component of a larger system, and operate within that system independently from the operations of the other components.
14A LOOK AT PROCEDURE-ORIENTED PROGRAMMING Main ProgramFunction 1Function 8Function 6Function 4Function 5Function 3Function 2Function 7
15Global DataFunction 1Local DataSome characteristics:Emphasis is on doing things (algorithms)Large programs are devided into smaller programsknown as function/ subrutinMost of the function share global dataData move openly around the system from function to function
16OOP PARADIGMDATAFUNCTIONSOBJECT AOBJECT COBJECT B
17BASIC CONCEPTS OF OOP OBJECTS CLASSES DATA ABSTRACTION ENCAPSULATION INHERITANCEPOLYMORPHISMDYNAMIC BINDINGMESSAGE PASSING
18Some of OOP’s striking features: Emphasis is on data rather than procedure.Programs are divided into objects.Data structures are designed such that they characterize the objects.Functions are tied together in the data structures.Data is hidden and can not be accessed by external functions.
19CLASSES Is the user defined data types A collection of objects of similar typeExample:Object mango, apple, and orange is member of class fruitObject TF, TI, TK, TP is member of class JurusanObject jip, sedan, bus, truk is member of class mobil
20OBJECTS Is the variables of program Have a life cycle. They can be created and destroyed.Interacts by sending message to one anotherContains data and code/ function to manipulate the data
22DATA ABSTRACTIONThe act of representing essential features without including the background details or explanations.Defined as list of attributes and functions.Known as Abstract Data Types (ADT).
23ENCAPSULATIONWrapping up of data and functions into a single unit (called class).The data is not accessible to the outside world and only functions which are wrapped in the class can access it.Insulation of the data from direct access by the program is called data hiding
24INHERITANCEIs the process by which objects of one class acquire the properties of objects of another class.Supports the concepts of hierarchical classification.Provides the idea of reusability.Example: the bird robin is a part of the class flying bird which is again a part of the class bird.
26POLYMORPHISM The ability to take more than one form. An operation may exhibit different behaviour in different instances depends upon the data types used in the operation.Example: addition operationIf two numbers, will generate a sumIf two strings, will generate a concatenationExtensively used in implementing inheritance
28DYNAMIC BINDINGThe code asociated with a given procedure call is not known until the time of the call at run time.Associated with polymorphism and inheritance.Example: (above diagram) Unique to each object and so the draw procedure will be redefined in each class that defines the object.At run-time, the code matching the object under current reference will be called.
29MESSAGE PASSINGObject oriented program consist of a set of objects communicate with each.Steps:Creating classes that define objects and their behaviour.Creating objects from class definitions.Establishing communication among objects.Objects communicate with one another by sending and receiving information.Message passing involves: object’s name, function’s name (message) and information
30BENEFITS OF OOPThrough inheritance, we can eliminate redundant code and extend the use of existing classes.The principle of data hiding helps the programmer to build secure programs.Can be easily upgraded from small to large systems.Software complexity can be easily managed.