Presentation is loading. Please wait.

Presentation is loading. Please wait.

Object-Oriented Concepts Overview. Florida Community College at Jacksonville COP 2551 Object-Oriented Programming OO Concepts Overview Objective Overview.

Similar presentations


Presentation on theme: "Object-Oriented Concepts Overview. Florida Community College at Jacksonville COP 2551 Object-Oriented Programming OO Concepts Overview Objective Overview."— Presentation transcript:

1 Object-Oriented Concepts Overview

2 Florida Community College at Jacksonville COP 2551 Object-Oriented Programming OO Concepts Overview Objective Overview of Object Orientation Object Attributes and Operations Difference between an object and a class 3 basic Object-oriented principles (Encapsulation, Inheritance and Polymorphism) Reference: Thinking in Java (Bruce Eckel) Free download @http://www.BruceEckel.com 2 of 10 slides

3 Florida Community College at Jacksonville Examples of Objects Use an online store (such as amazon.com) as an example, the following things may consider as Objects: Book Customer Order 3 of 10 slides COP 2551 Object-Oriented Programming OO Concepts Overview

4 Florida Community College at Jacksonville Object Attributes and Operations Attributes know something (Attributes are often data, like order ID and customer ID for an Order object. Attributes can also be another object, such as the entire Customer object rather than just the customer ID. Operations do something with what the attributes know, (Operations can be actions that the object does, often affecting its attributes.) 4 of 10 slides COP 2551 Object-Oriented Programming OO Concepts Overview

5 Florida Community College at Jacksonville Difference Between Object And Class A class is how you define an object. Classes are descriptive categories or templates. Book could be a class. Objects are unique instances of classes. This Java Certification book that costs $59.99 with item ID 62467-B is an object of the Book class. 5 of 10 slides COP 2551 Object-Oriented Programming OO Concepts Overview

6 Florida Community College at Jacksonville Difference Between Object And Class (continue) The attributes and operations defined by a class are for its objects, not for itself. There is no concrete realization of the class Book, but there are Book objects, i.e. a class is a logical construct, an object has physical reality. A class can be compared to a blueprint. Imagine you are in charge of building a housing development, with one housing blueprint. Each house in a development is shaped the same way, but some have brick or aluminum siding, some have custom paint colors inside and some are just white, and so on. 6 of 10 slides COP 2551 Object-Oriented Programming OO Concepts Overview

7 Florida Community College at Jacksonville Object-oriented Principle – Encapsulation Encapsulation is the mechanism that binds together the code and the data it manipulates, and keeps both safe from outside interference and misuse. 7 of 10 slides A Class Private variables and methods Public variables and methods Public variables is not recommended COP 2551 Object-Oriented Programming OO Concepts Overview

8 Florida Community College at Jacksonville Object-oriented Principle - Inheritance Inheritance is the process by which one object acquires the properties of another object. By use of inheritance, an object need only define all of its characteristics that make it unique within its class, it can inherit its general attributes from its parent. 8 of 10 slides Account CheckingMortgageLoan COP 2551 Object-Oriented Programming OO Concepts Overview

9 Florida Community College at Jacksonville Object-oriented Principle – Polymorphism Polymorphism(from Greek, meaning“many forms”) is a feature that allows one interface to be used for a general class of actions, i.e. one interface, multiple methods. Example: Account.calculateInterest() 9 of 10 slides COP 2551 Object-Oriented Programming OO Concepts Overview


Download ppt "Object-Oriented Concepts Overview. Florida Community College at Jacksonville COP 2551 Object-Oriented Programming OO Concepts Overview Objective Overview."

Similar presentations


Ads by Google