Presentation is loading. Please wait.

Presentation is loading. Please wait.

Object-Oriented Programming

Similar presentations


Presentation on theme: "Object-Oriented Programming"— Presentation transcript:

1 Object-Oriented Programming
Also known as OOP Based upon the classification model used by people Things are objects that belong to classes Related objects can share attributes (properties) and behavior Tables and desks belong to a class of furniture They share common attributes in that both generally have 4 legs and a large, flat surface on top True OOP languages support Encapsulation Polymorphism Inheritance VB Object-based since it does not support inheritance Regardless, many OOP concepts can still be applied

2 Classes without Inheritance
What do we do if we now provide our employees with ? We need to add that to both classes

3 Classes with Inheritance
What do we do if we now provide our employees with ? We add to the base class & manager and laborer inherit that attribute

4 Classes with Multiple Levels of Inheritance

5 Defining User Objects Add a Class to a Project
Add Properties to a Class Create Objects using Instances of a Class Object References Class Events Initialize Event Terminate Event Add Methods

6 Adding a Class to a Project
Add a Class module (different from a module that we used for global declarations and procedures)

7 Collections vs Arrays A list of objects An array of objects
Allows objects to be added at any position Allow objects to be deleted from the middle Objects may be retrieved using a key value more power, more flexible, less efficient An array of objects New objects added to end of array No easy way to allow removal of objects Search code is required to retrieve objects less power, less flexible, more efficient Collections result in simpler, easier-to-read, easier-to-maintain code than object arrays

8 Collections Processing
Create a Collection Retrieve an Object Reference from a Collection Iterate through a Collection Delete an Object Reference from a Collection Delete a Collection


Download ppt "Object-Oriented Programming"

Similar presentations


Ads by Google