Presentation is loading. Please wait.

Presentation is loading. Please wait.

Stephenson College DP 96 1 Object-Orientation by Derek Peacock.

Similar presentations


Presentation on theme: "Stephenson College DP 96 1 Object-Orientation by Derek Peacock."— Presentation transcript:

1

2 Stephenson College DP 96 1 Object-Orientation by Derek Peacock

3 Stephenson College DP 96 2 Types of Objects a Tangible things ` Cars, Cards, Books a Roles ` Employer, Teacher, Student a Incidents ` Flight, Transactions

4 Stephenson College DP 96 3 Types of Objects cont... a Interactions ` Electrical circuit, a contract a Specifications ` Architectural Design ` Engineering blueprint

5 Stephenson College DP 96 4 Objects in Programming a Direct representation of the application ` Graphical Playing Cards ` Documents ` Accounts a Artefact of Implementation ` Card Deck Unit ` stacks, queues

6 Stephenson College DP 96 5 What are Objects? a Attributes, States a Methods, Behaviour a Composed of other objects

7 Stephenson College DP 96 6 Program Objects Object = (private) Data + (public) Processes Object Name Public Processes Private Data

8 Stephenson College DP 96 7 Encapsulation a Data & Processes linked a Public interface a Information is hidden a private data a private internal processes Bank Account Account number account holder current balance get current balance make deposit make withdrawal

9 Stephenson College DP 96 8 Traditional Modularity Process Driven a Functional Decomposition a Data structured to suite the process a code re-use difficult Data Driven a Data Decomposition a Process constrained by the structure of data a code re-use difficult

10 Stephenson College DP 96 9 Object Oriented Modularity a Data & Process tightly bound together (encapsulated) a Internal data and processes hidden a Public interface can remain fixed while internal workings are changed a Can be extended without altering original code

11 Stephenson College DP 96 10 ‘Good’ Modules a Reusability a Extensibility a Decomposability a Composability a Understandability a Continuity a Protection Software components New components from old breaking a system down building a system up easy to understand the part small changes lead to small effects errors confined to module

12 Stephenson College DP 96 11 Features of OOP a Encapsulation/Abstraction a Inheritance a Polymorphism a Aggregation

13 Stephenson College DP 96 12 Encapsulation/Abstraction a Abstraction is used to represent essential features of behaviours and states abstract data typeclass a Behaviours & States encapsulated into an abstract data type or class a Internal States not directly accessible a Changes to internal implementation do not effect external interface

14 Stephenson College DP 96 13 Inheritance a One Class can inherit the characteristics of another class. ` One class can be a “Kind of” other class a kind of ` a text window is a kind of window a A classification hierarchy shows the inheritance relationships between classes

15 Stephenson College DP 96 14 Polymorphism a Different objects can respond to the same message in different ways e.g. ` Square.Draw ` Circle.Draw a At runtime we might not know what object is present but for example Object.Draw will draw whatever object is available

16 Stephenson College DP 96 15 Aggregation a Objects can be aggregated into new relationships a Objects of one class can be composed of objects of another class is a part of ` Object A is a part of Object B is a part of ` Engine is a part of Car

17 Stephenson College DP 96 16 Comparing Approaches Procedural a Data Type a Variable a Function/Procedure Object-Oriented a Abstract Data Type or Class a Object/Instance a Method/Operation


Download ppt "Stephenson College DP 96 1 Object-Orientation by Derek Peacock."

Similar presentations


Ads by Google