This is an old revision of the document!
Table of Contents
Object-Oriented Programming (OOP)
This module on object-oriented programming is intended for engineering degree students.
To go through this course, you're expected to have some basic computer programming knowledge (preferably C).
Object-oriented programming (OOP) is a programming technique that evolves from the more common procedural/modular programming. In procedural programming a solution usually revolves around breaking down a task into smaller ones and writing a function (or procedure - hence the word procedural) specifically to deal with each of that (usually single) small task. Thus, you see a lot of functions that takes data structure (usually in form of a pointer) as an argument. In contrast, object-oriented programming focus more on modelling a solution as an object - which can be an instance of a more generic category. As an object, the solution would have properties (merely a variable in procedural programming) that describes the object, and methods (functions in procedural programming) which are processes used to model how an object acts/reacts. Based on this, it is clear that object-oriented programming is a technique and not just language. So, writing a program in C(or using a C++ compiler) still doesn't qualify as implementing object oriented programming - it is still possible to write a solution purely based on modular programming using C++ (especially when the all classes have public members only). The main features of OOP are encapsulation, inheritance and polymorphism. The page on [[wp>object-oriented programming and Java are the early popular implementations (Cbecause of its roots in C and Java because.... well, it's Java! Maybe also because it's among the first to promote cross platform implementation). //To be continued...// [[wp>object-oriented programming will be demonstrated.
What is OOP?
It is a programming paradigm (or programming style, if you please) that focuses on modelling solution components as objects, rather than concentrating on the solution procedures. Obviously, it is not a new language - but it does need proper language support (i.e. constructs) in order to implement the concept. Some may use a language that supports OOP but still use modular or simply procedural programming.
to be continued…
Why OOP?
- (lec) course briefing and refresh basic programming
- (lec) implementation platform revised (c++ instead of java)
- (lab) development environment (using mingw)
- (lab) refresh basic programming
- modular/procedural programming vs object-oriented programming
- from c to c++
- basic overview of c++
- keyword(s): structs, classes
- basic phonebook application
- compare modular/procedural vs object-oriented
- encapsulation
- keyword(s): private, protected, publid
- member functions
- constructor, destructor (actually part of dynamic dispatch?)
- dynamic dispatch
- intro to inheritence
- lab assessment 1
- access for inherited properties/methods
- more inheritence… multiple?
- keyword(s): virtual