Download presentation
Presentation is loading. Please wait.
Published byAdelia Shaw Modified over 9 years ago
2
Object Orientation Concepts, Terminology and a Story. © Allan C. Milne School of Engineering, Computing & Applied Mathematics University of Abertay v12.7.17
3
Why Object-Orientation ? ► It is, in some sense, a natural way of talking about systems. ► The concepts can be applied both to describe the “real world”, and to implement computer software representations of that world. ► Do not confuse these two uses of OO; they can be applied independently.
4
Some Technical Advantages. ► OO encapsulates both data and functionality. ► OO distinguishes between internal operation and external application. ► OO forms a base technology for reusable components.
5
An Object Has … … a unique identity. … an existence that can be described in terms of … … what it is (state) … what it does(behaviour)
6
Some Observations. ► Individual objects may have many features in common with other objects. ► Objects must normally interact in order to be useful. ► Objects appear both in the “real world” and in our programming space.
7
Classification. ► Objects that exhibit similar characteristics (i.e. the same kinds of state & behaviour) can be considered to all belong to the same class. ► This classification is arbitrary and depends on the system requirements and the experiences of the observer. ► The unique identity of an object is defined by its individual existence.
8
Classes & Objects. ► A class describes the kind of state and behaviour an object of that class will exhibit. ► A class defines the type of objects. ► Objects exist as individual entities. ► An object is considered to be an instance of a particular class.
9
A Clock Class. My alarm clock Big Ben The office clock Class Clock ObjectsObjects
10
Abstraction. ► Identifying objects as belonging to the same class reflects the level of abstraction (generality) within the system. ► The level of abstraction is determined by the level of detail in the criteria used for identifying objects as belonging to a class. ► Thus objects may be classified at different levels of detail.
11
Inheritance. ► If objects are classified at different levels of detail we can put their classes into a classification hierarchy. ► The most abstract class is at the top and the most detailed class at the bottom. ► Inheritance means that a class contains all the characteristics of the class above it in the hierarchy.
12
A Class Hierarchy.
13
Message Passing. ► Interaction between objects is accomplished through message passing. ► Passing a message to an object is a request for it to exhibit some part of its behaviour. ► There are 2 general types of messages command messages(do this...) query messages(what is...)
14
Methods & Message Passing. ► Methods define the type of behaviour that an object can exhibit. ► A message can thus be defined in terms of the identity of the target object for the message, the method which exhibits the desired message processing behaviour, and any additional information (parameters) required by the method. ► The methods of an object define the set of messages that can be sent to the object.
15
So What Is Object Orientation? ► It is a technique for “thinking about” the architecture and operation of systems. ► It is a way of modeling a system in terms of the objects which make it up. ► It allows us to classify together objects with similar characteristics.
16
Object Orientation … … allows us to abstract the model using classes & class hierarchies. … identifies the relationships & interactions between objects. … provides a model that can be used directly in a software implementation.
17
A Story Through Quotes. Following are some quotes that tell a story … think about what the quotes mean; how they are linked together; and what the story they are telling is.
18
"A C program is like a fast dance on a newly waxed dance floor by people carrying razors." Waldi Ravens
19
"I invented the term 'Object-Oriented', and I can tell you I did not have C++ in mind.“ Alan Kay (inventor of SmallTalk)
20
"The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones." Anon
21
“Assumption is the mother of all screw- ups." Anon
22
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan
23
“Never increase, beyond what is necessary, the number of entities required to explain anything" William of Ockham (1285-1349)
24
"the more dogmatic you are about applying a design method, the fewer real-life world problems you will solve" P.J. Plauger (1993)
25
"Beware of bugs in the above code; I have only proved it correct, not tried it." Donald E. Knuth
26
"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question." Charles Babbage
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.