150 likes | 312 Views
An Engineering Interlude. Santa Maria Del Fiore. Designed by Fillipo Bruneleschi The marble slab inside reads: Corpus Magni Ingenii Viri Philippi Brunelleschi Fiorentini (“Body of the great and clever man Filippo Brunelleschi of Florence”). “Ingenere” is the Italian word for engineer
E N D
Santa Maria Del Fiore • Designed by Fillipo Bruneleschi • The marble slab inside reads: Corpus Magni Ingenii Viri Philippi Brunelleschi Fiorentini (“Body of the great and clever man Filippo Brunelleschi of Florence”)
“Ingenere” is the Italian word for engineer • Genius, ingenius, and ingenere clearly all have the same Latin root • Builders of machines were clever • In fact, Brunelleschi was awarded the dome contract but refused to divulge the design • Typical of his day: architecture was an exercise in cleverness
How does a profession differ from a craft? • Substitution of standard techniques for cleverness • Licensing • Self-regulating professional bodies • Government regulation • Threat of litigation
Software Design • Still in the craft (clever) stage
Issues • Not good enough for a program to run • It must: • Be maintainable • Communicate with other programs
Software Development • Assess client needs. • Develop conceptual documentation • Show to client. If not OK, go to step 1 • Build prototypes. • Show to client. If not OK, go to step 1 • System design • Program • Test Components. If not OK, go to step 7 • Integrate Components. • Test Integration. If not OK, go to step 6.
Object-Oriented Design Goals: • Manage Complexity • Promote software reuse Tools: • Data hiding • Inheritance • Composition • Polymorphism
A Quick How-To Object-Oriented Analysis • Statement of what our client wants Object-Oriented Design • How to provide it using OO tools
Tasks • Provide a problem statement (requirements analysis) • Multiple discussions with client • Determine objects needed to implement the system • Look for nouns in problem statement • Determine object attributes • What do I know? • How are the nouns described? • These become the class variables • Determine object behaviors • What can I do? • Look for verbs in problem statement • These become the class methods
Key Rule Information Hiding • Though objects know how to communicate with one another across well-defined interfaces, objects are normally not allowed to know how other objects are implemented
Unified Modeling Language • OOD Tool • We use C++ to communicate our instructions to a computer • Designers use UML to communicate their instructions to those who will do the coding • Important names • Grady Booch • James Rumbaugh • Ivar Jacobsen • All worked at Rational Software in the late 90’s • Adopted by the Object Management Group (www.omg.org) in 1997. • OMG is a non-profit organization that promotes the development of standards in OO technology. • OMG now has responsibility for maintaining the notation. • UML 2.0 is the current version
Sample Problem Develop software to perform ATM transactions. The software should model the functions of all hardware associated with an ATM, but not be concerned with how the hardware works. The ATM must authenticate a user and then perform a number of transactions. The user enters security a five digit account number through a numeric keypad. Choices are displayed, menu fashion, on the screen. The user enters the choice (balance, withdraw, deposit, exit) using the numeric keypad. The machine has a cash dispenser that dispenses bills in multiples of $20. The deposit slot receives deposit envelopes. If the user chooses to withdraw, he/she is presented with a screen indicating valid withdrawal amounts menu fashion (20,40,60,100,200, Cancel). There are several error conditions: • Invalid account number • Invalid transaction choice • Invalid withdrawal choice • Withdrawal amount exceeds balance In case of error, the user receives an appropriate message and is invited to try again or quit.