Unformatted text preview:

Object Oriented Programming Using C CLASS 2 IDLOOPC1998 1 Objectives Understand the difference between Structured Programming and ObjectOriented Programming IDLOOPC1998 2 What is Object Oriented Programming A new way of thinking A different approach to the solution to a problem IDLOOPC1998 3 Object Oriented Design vs Structured Approach Structured Approach Decompose the problem into tasks Write procedures functions to solve simple tasks and compose them into a more sophisticated process until desired functionality is reached IDLOOPC1998 4 Object Oriented Design vs Structured Approach Structured Approach Little regulation of access to data Focus is on looking for operations Unit testing integration IDLOOPC1998 5 Object Oriented Design vs Structured Approach Object Oriented Approach Describe a problem in terms of things rather than activities IDLOOPC1998 6 What does an elevator contain Button Rider What action does an elevator perform Goes up Goes down IDLOOPC1998 7 Object Oriented Design vs Structured Approach Object Oriented Approach Identify objects and the operations to be performed on these objects IDLOOPC1998 8 What does a rider do with an elevator Gets on Gets off Pushes buttons IDLOOPC1998 9 Object Oriented Design vs Structured Approach Object Oriented Approach Object oriented design and programming encourages gradual growth by attaching more working class clusters and repeated testing IDLOOPC1998 10 What are Some Problems with the Structured Approach Time estimates Low quality High maintenance Duplication of effort What is the Solution Improve the tool the language Improve the process IDLOOPC1998 11 Word Processing Program In a strucured approach 2000 functions A program bug is detected IDLOOPC1998 12 Word Processing Program In OOP every operation is associated with a particular class We could have 100 classes with 20 operations per class A program bug is detected IDLOOPC1998 13 Inventory Getdata for item Printdata for item IDLOOPC1998 14 Inventory Getdata for item Printdata for item Getdata Prompt and read in item Prompt and read in unit price Prompt and read in quantity in stock IDLOOPC1998 15 Inventory Getdata for item Printdata for item Getdata Prompt and read in item Prompt and read in unit price Prompt and read in quantity in stock Printdata Print item Print item price Print item quantity IDLOOPC1998 16 Pipes Need length size and type Light Bulbs Watts Paint Size Color IDLOOPC1998 17 Inventory Object Oriented Approach Create a pipe object IDLOOPC1998 18 Inventory Object Oriented Approach Create a pipe object Apply getdata to pipe object IDLOOPC1998 19 Inventory Object Oriented Approach Create a pipe object Apply getdata to pipe object Pipe object has it s own getdata also IDLOOPC1998 20 Inventory Object Oriented Approach Create a pipe object Apply getdata to pipe object Pipe object has it s own getdata also Create a light bulb object IDLOOPC1998 21 Inventory Object Oriented Approach Create a pipe object Apply getdata to pipe object Pipe object has it s own getdata also Create a light bulb object Apply getdata to light bulb object IDLOOPC1998 22 Inventory Object Oriented Approach Create a pipe object Apply getdata to pipe object Pipe object has it s own getdata also Create a light bulb object Apply getdata to light bulb object Light object has it s own getdata also IDLOOPC1998 23 Inventory Object Oriented Approach Create a pipe object Apply getdata to pipe object Pipe object has it s own getdata also Create a light bulb object Apply getdata to light bulb object Light object has it s own getdata also Create a paint object IDLOOPC1998 24 Inventory Object Oriented Approach Create a pipe object Apply getdata to pipe object Pipe object has it s own getdata also Create a light bulb object Apply getdata to light bulb object Light object has it s own getdata also Create a paint object Apply getdata to a paint object IDLOOPC1998 25 Inventory Object Oriented Approach Apply printdata to the above objects IDLOOPC1998 26 Advantages of Object Oriented Programming Data abstraction details of classes only visible to its methods Compatibility easier to combine software components Flexibility classes provide units for task allocation IDLOOPC1998 27 Advantages of Object Oriented Programming Reuse easier to develop reusable software Extensibility inheritance allows new classes to be built from old ones Maintenance The natural modularity of the class structures makes it easier to contain the effects of change IDLOOPC1998 28 Q A IDLOOPC1998 29


View Full Document

SMU CSE 2341 - Object-Oriented Programming Using C++

Loading Unlocking...
Login

Join to view Object-Oriented Programming Using C++ 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 Object-Oriented Programming Using C++ 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?