UT Dallas CS 4337 - #Sebesta ch12 oop - shorter to use (53 pages)

Previewing pages 1, 2, 3, 4, 24, 25, 26, 50, 51, 52, 53 of 53 page document View the full content.
View Full Document

#Sebesta ch12 oop - shorter to use



Previewing pages 1, 2, 3, 4, 24, 25, 26, 50, 51, 52, 53 of actual document.

View the full content.
View Full Document
View Full Document

#Sebesta ch12 oop - shorter to use

30 views


Pages:
53
School:
University of Texas at Dallas
Course:
Cs 4337 - Organization of Programming Languages

Unformatted text preview:

Chapter 12 Support for Object Oriented Programming Chapter 12 Topics Introduction Object Oriented Programming Design Issues for Object Oriented Languages Support for Object Oriented Programming in C Support for Object Oriented Programming in Java Implementation of Object Oriented Constructs Copyright 2012 Addison Wesley All rights reserved 1 2 Introduction Many object oriented programming OOP languages Some support procedural and data oriented programming e g Ada 95 and C Some support functional program e g CLOS Newer languages do not support other paradigms but use their imperative structures e g Java and C Some are pure OOP language e g Smalltalk Ruby Some functional languages support OOP but they are not discussed in this chapter Copyright 2012 Addison Wesley All rights reserved 1 3 Object Oriented Programming Three major language features Abstract data types Chapter 11 Inheritance Inheritance is the central theme in OOP and languages that support it Polymorphism Copyright 2012 Addison Wesley All rights reserved 1 4 Inheritance Productivity increases can come from reuse ADTs are difficult to reuse always need changes All ADTs are independent and at the same level Inheritance allows new classes defined in terms of existing ones i e by allowing them to inherit common parts Inheritance addresses both of the above concerns reuse ADTs after minor changes and define classes in a hierarchy Copyright 2012 Addison Wesley All rights reserved 1 5 Object Oriented Concepts ADTs are usually called classes Class instances are called objects A class that inherits is a derived class or a subclass The class from which another class inherits is a parent class or superclass Subprograms that define operations on objects are called methods Copyright 2012 Addison Wesley All rights reserved 1 6 Object Oriented Concepts continued Calls to methods are called messages The entire collection of methods of an object is called its message protocol or message interface Messages have two parts a method name and the destination object In the simplest case a class inherits all of the entities of its parent Copyright 2012 Addison Wesley All rights reserved 1 7 Object Oriented Concepts continued Inheritance can be complicated by access controls to encapsulated entities A class can hide entities from its subclasses A class can hide entities from its clients A class can also hide entities for its clients while allowing its subclasses to see them Besides inheriting methods as is a class can modify an inherited method The new one overrides the inherited one The method in the parent is overriden Copyright 2012 Addison Wesley All rights reserved 1 8 Object Oriented Concepts continued Three ways a class can differ from its parent 1 The parent class can define some of its variables or methods to have private access which means they will not be visible in the subclass 2 The subclass can add variables and or methods to those inherited from the parent 3 The subclass can modify the behavior



View Full Document

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...
Login

Join to view #Sebesta ch12 oop - shorter to use and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view #Sebesta ch12 oop - shorter to use and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?