180 likes | 194 Views
Explore essential concepts in object-oriented programming languages, including reusability, object types, concurrency, and more. Learn about instantiation, object classes, inheritance, polymorphism, and generic classes. Understand the significance of object management and programming environments in OO systems.
E N D
A Survey of Object-Oriented Concept Oscar Nierstrasz
1.1 What is Object-Oriented Programming Language • Restrictive – The programming language that supports both object classes and class inheritance. • Loose - Any programming language that provides mechanisms that can be used to exploit encapsulation is (at least to some degree) object-oriented.
Object models for programming languages often encapsulate objects in terms of a set of operations as a visible interface, while hiding the object’s realization.
Our Discussion will center on: • 1.1.1 Reusability • 1.1.2 Object types • 1.1.3 Concurrency
1.1.1 Reusability • Instantiation • Object Classes • Inheritance • Polymorphism • Overloading • Generic Classes
Instantiation • Instantiation is perhaps the most basic OO reusability mechanism. • There are static and dynamic instantiation. • Statically instantiated objects are allocated at compile time and exist for the duration that the program executes. • Dynamically instantiated objects require run-time support for allocation and for either explicit deallocation or some form of garbage collection.
Instantiation • One way for programmers to define and instantiate their own objects is providing the programmer with a facility to define object classes. • An alternative approach to instantiation is to use prototypical objects.
Object Classes • An object class specifies a set of visible operations, a set of hidden instance variables, and a set of hidden methods that implement the operations. • The difference between object classes and prototypical objects is brought out sharply when viewed in terms of applicable inheritance mechanisms.
Inheritance • In most cases, inheritance is strictly a reusability mechanism for sharing behavior between objects. • Inheritance can be statically or dynamically. • Class inheritance is often represented as the fundamental feature that distinguishes object-oriented from other programming languages. • Single inheritance • Multiple inheritance. • Dynamic inheritance refers to mechanisms that permit objects to alter their behaviour in the course of normal interactions between objects. • Part inheritance. • Scope inheritance.
Some interesting points concering class inheritance • Not all languages with class inheritance support multiple inheritance. • It is important to be able to override inherited methods • Subclass may or may not be permitted direct access to inherited instance variables. • The issue of name clashes in teh presence of multiple inheritance.
Polymorphism and overloading • A polymorphic function is one that can be applied uniformly to a variety of objects. • Class inheritance is closely related to polymorphism. • Polymorphism enhances software reusability by making it possible to implement generic software that will work not only for a range of existing objects, but also for objects to be added later.
Generic classes • Generic object classes achieves software reusability by partially describing a class and parameterizing the unknowns. • Two basic categories of generic object: • Container objects: arrays and lists. • Tool objects: sorters and editors. • In case of tool objects, the parameter must be constrained to indicate the required parent class of the parameter.
1.1.2 Object types • An object type is superficially the same thing as an object class. The difference is that when we manipulate typed objects, we can make static type-checking. • The declared types of a varibles and of arguments to operations serve as specification for balid bindings and invocations. • In the presence of dynamic binding, it is generally impossible to determine statically the class of a variable, but with teh appropriate type rules we can still perform type-checking.
1.1.3 Concurrency • Two ways in which programing languages have dealt with concurrency and communication. • Active entities (process)communicate indirectly through shared passive objects. • Active entities communicate directly with one another by message passing.
1.2 OO systems • Two important kinds of OO system • Those that provide run-time support for OO application. • Those that form an environment for OO software development.
1.2.1 Object Management • Object management refers to a mixed bag of run-time issues such as concurrency, distribution, version control and security. • Minimal object management support is provided for C++ objects. • Smalltalk and LISP additionally provide fro automatic garbage collection. • Object-Oriented Operating system may provide support for persistence, reliable communication, ro distributed object-naming at a low level. • OO database.
1.2.2 OO programing Environment • This is about tools and environments for application development. • First problem is how should we decompose our application into objects in such a way as to best exploit the OO pradigms available to us? (consept model techniques) • The next problem is that of selecting objects from a software base (personal expertise, software document, and browsing tools). • Third problem is to cope with evolution of software base (making interface unchanged)
Summary • The term Object-oriented is best interpreted as referring to any approach that exploits encapsulation or packaging in the process of designing and building software. • We have surveyed OO techniques in programing languages and system support.