Vidal Pineda
IT – 210
1-18-2013
Kevin Swinson
Mowing the Lawn
Objects:
Shed
Lawn Mower
Human
Main Module
Call Shed Module
Call Lawn Mower Module
Open Shed Module
Class Shed (gas can, lawn mower, oil, shed door, Green waste bin)
Open shed door
Roll green waste bin out
Get lawn mower Get gas can Fill gas tank
Check oil Add oil if needed Get oil
Put oil back when done
Roll mower to lawn
End Program
Open Lawn Mower Module
Class Lawn Mower Module (prime lever, pull string, gear drive, lawn catcher, push mower, lawn)
Hold prime lever down
Pull string until Lawn Mower starts
Press gear drive
Push mower over lawn
Empty lawn catcher in green waste bin
Attach
lawn catcher on lawn mower
Put mower back in shed
Put green bin back shed
Close shed door
End Program
Encapsulating:
The Human is an object the when starting the lawn mower he or she will hold the prime lever down, pull on the pull string until the lawn mower starts. Next he or will engage the gear drive and push the lawn mower over the lawn until complete. When he or she is complete they will empty lawn catcher in to green bin and re-attach lawn catcher back on the lawn mower and roll the lawn mower back into the shed. Then roll the green bin back into the shed and close the door.
Architectural Differences:
The main difference between object – orientated (OOP)and structure design is that object – orientated creates classes that are used to construct objects. Objects will store data and send messages to other objects while receiving messages as well. OOP is flexible and organizes code for the data. Structure design is command line friendly while OOP is user friendly.