13.07.2015 Views

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

292Chapter 12Analysis and Design: Seeking the Objectspublic AccountcreateSub(String name, String amt)throws NumberFormatExcepti<strong>on</strong>{Account acct = new Account(name, owner, amt);// Reduce the parent's unallocated funds.balance = balance.subtract(acct.getTotal());// C<strong>on</strong>nect the accounts to each other.acct.parent = this;children.put(name, acct);return acct;} // createSub/*** Looks up and returns the account with the given name.*/public AccountgetSub(String name){return (Account) children.get(name);} // getSub} // class AccounThe Umbrello UML modeller is an Open Source tool for creating the variousUML diagrams. You can find it at http://uml.sourceforge.net/index.php. We also recommend their <strong>on</strong>line documentati<strong>on</strong> as a good briefintroducti<strong>on</strong> to UML and to Umbrello. It can be found from the main Umbrellopage, or directly at http://docs.kde.org/en/HEAD/kdesdk/umbrello/.12.13EXERCISES1. Imagine a public library. Carry out the CRC nominati<strong>on</strong> process for asystem to track library members and the collecti<strong>on</strong>. What list of objectsdo you come up with? What abstract classes do you find? Which did youdiscard and why?2. Extend the purpose of the library program to include generating mailingsto members with overdue materials. Did you add classes? Did you addmethods and/or members? To which classes did you add them?

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!