[Tutor] class question

Dick Moores rdm at rcblue.com
Sat Jul 14 01:11:28 CEST 2007


At 03:12 PM 7/13/2007, Alan Gauld wrote:

>"Dick Moores" <rdm at rcblue.com> wrote
>
> > Thanks. You've clarified it for me completely.
> >
> > Your second way seems to make more sense.
> > And instead of raising the error, why not just print it:
>
>Because that would make the class much less reusable.
>It would be limited to applications using stdout. A GUI
>banking program would be unable to use the BankAccount
>class. But by raising an exception the user gets to decide
>what to do, either pop up a dialog, print a message or send
>an email to the banks client.
>
>Its a primary design goal for reuse to de-couple business
>logic - like the bank account - from the user interface.
>
>There is a bit more discussion around this in my
>Case Study topic where I convert it from command
>line to GUI and again in my InterProcess Comms topic
>where I turn the AddressBook into a client-server app.

Thanks, Alan. I'll check it out.

Dick




More information about the Tutor mailing list