Object Oriented Data and Process

Only available on StudyMode
  • Download(s) : 253
  • Published : April 27, 2009
Open Document
Text Preview
Object-Oriented Data and Processes CheckPoint

Main program
Call find car Module
Call open car module
Call drive car Module

Find the Car
Get out Keys
Unlock the Door with door key
Sit in driver’s seat
Close the Door
Put seat belts on
Put ignition key in ignition switch
Turn key to start car
Check side mirror
Check rear mirror
Shift into gear
Grab steering wheel
Press Accelerator

• Think about this task in an object-oriented way, and identify the objects involved in the task. Objects:
1. Car has the following objects (door, ignition, seat-belt, mirror, steering wheel gear, and accelerator} 2. Keys have door key, ignition key, and alarm

With Car
Set Door.close = true
Set Seat-belt.on = true
Call Ignition(Key)
Call Mirror.adjust()
Call Steering (wheel)
Call Gears engage()
Call Accelerator Press()
End With Car

An object oriented design with an object called Car can have data to represent top speed, current speed, engine state (running or not) and passengers carried. These are just a few pieces of data that describe a Car. Then actions might be Brake() and Accelerate() which will internally affect the data item (property) of current speed.

Object-oriented design is part of OO methodology and it forces programmers to think in terms of objects, rather than procedures, when they plan their code. An object contains encapsulated data and procedures grouped together to represent an entity. The 'object interface', how the object can be interacted, is also defined. An object-oriented program is described by the interaction of these objects. Object-oriented design is the discipline of defining the objects and their interactions to solve a problem that was identified and documented during object-oriented analysis. Structured programming frequently employs a top-down design model, in which developers map out the overall program structure into separate subsections. A defined function or set of similar functions is coded in a...
tracking img