Presentation is loading. Please wait.

Presentation is loading. Please wait.

CPT 140 Programming Constructs1 OBJECT ORIENTED TECHNOLOGY Terminology and Basic Concepts.

Similar presentations


Presentation on theme: "CPT 140 Programming Constructs1 OBJECT ORIENTED TECHNOLOGY Terminology and Basic Concepts."— Presentation transcript:

1 CPT 140 Programming Constructs1 OBJECT ORIENTED TECHNOLOGY Terminology and Basic Concepts

2 CPT 140 Programming Constructs2 OBJECTIVES n Discuss the history of Object Oriented Technology (OT) n Describe basic concepts of OT n Define terms in Object Oriented Analysis & Design (OAD) and Programming (OOP) n Relate definitions to real-world examples n Mention some benefits of OT

3 CPT 140 Programming Constructs3 HISTORY OF OT n 1969 n Dr. Kristin Nygaard of Norway n Model fjord and movement of ships passing through it

4 CPT 140 Programming Constructs4 HISTORY OF OT n The Problem ä structured programming separates data from procedures n The Solution ä Object Oriented Programming ä model each component (data and procedure) as a single unit ä model relationships between components

5 CPT 140 Programming Constructs5 OT BASIC CONCEPTS n Objects and Classes n Operations n Requests n Attributes n Inheritance n Encapsulation n Polymorphism

6 CPT 140 Programming Constructs6 WHAT’S AN OBJECT? n Anything, real or abstract, about which we store data n Dr. Nygaard’s objects ä mathematical models of boats ä physical aspects of the fjord being analyzed n Other Examples ä an invoice, an organization, a screen with which a user interacts, a drawing, an airplane, an order-filling process...

7 CPT 140 Programming Constructs7 WHAT’S AN OPERATION? n An activity that reads or manipulates data of an object n Dr. Nygaard’s operations ä boats float, sink, move etc. n Other Examples ä calculating a total, checking a balance, adding a new employee, changing an address, deleting a customer...

8 CPT 140 Programming Constructs8 HOW OBJECTS COMMUNICATE n An object is sent a message, which in turn causes an operation to be invoked n Sometimes the operation returns a response

9 CPT 140 Programming Constructs9 WHAT’S AN ATTRIBUTE? n Characteristics that add detail to an object n Dr. Nygaard’s attributes ä color, weight, size, etc. n Other Examples ä someone’s name or address, an employee’s title, a book’s author, a part number, a room’s dimensions

10 CPT 140 Programming Constructs10 INHERITING ATTRIBUTES n Objects can be decomposed into other objects n Generalization hierarchy n Supertype versus subtype n An object inherits the attributes in its parent class

11 CPT 140 Programming Constructs11 SAMPLE GENERALIZATION HIERARCHY

12 CPT 140 Programming Constructs12 OBJECT ORIENTED ANALYSIS & DESIGN (OAD) n The steps Ê Find Classes and Objects Ë Define Attributes Ì Define Services n Confused? Welcome to the OO Paradigm!

13 CPT 140 Programming Constructs13 WHAT ARE CLASSES OF OBJECTS? n An object type or object class is a category of an object that has similar characteristics and behavior n Examples ä employee or student n Aha! ä An object type is found in the generalization hierarchy

14 CPT 140 Programming Constructs14 OBJECT INSTANCES n An object instance is an example of an object type n Examples ä John P. Smith, Invoice #12356 n And just to make it all really confusing, object instances are sometimes called objects!

15 CPT 140 Programming Constructs15 OBJECT ORIENTED PROGRAMMING (OOP) n More synonyms: ä operations are called methods ä messages are called requests or events n An event contains the object name, the method, and maybe a group of parameters n Once an object receives an event, it runs a script (program) that may modify its state or send messages to other objects

16 CPT 140 Programming Constructs16 ENCAPSULATION n The process of making implementation details of an object transparent to a user n Packaging data and operations together n Also called information hiding n The black box

17 CPT 140 Programming Constructs17 POLY-WHAT? n Polymorphism ä allows an instruction to be given to an object in the form of a generalized, rather than specific, detailed command ä while specific actions would be different, results are the same

18 CPT 140 Programming Constructs18 COMPARING SYNONYMS

19 CPT 140 Programming Constructs19 SOME BENEFITS OF OT n Reusability ä classes can be reused or inherited n Stability ä over time, classes become more stable n Easier Design ä black box concept n Faster Design ä create applications from existing components

20 CPT 140 Programming Constructs20 SUMMARY BY EXAMPLE n A VCR IS an object n A Sony VCR is an object type n Serial #9234 of Sony VCR is an object instance n Playback, record, and audio dubbing are examples of VCR operations n The concept that the VCR contains complex components you assume work is encapsulation n When you use a remote control, you are sending requests to the VCR


Download ppt "CPT 140 Programming Constructs1 OBJECT ORIENTED TECHNOLOGY Terminology and Basic Concepts."

Similar presentations


Ads by Google