[Tutor] Code critique please (OOP strategy)

Timothy Wilson wilson@visi.com
Sun, 30 Dec 2001 20:30:43 -0600 (CST)


Hi everyone,

I've done an object-oriented version of the stock portfolio tracking
program I assigned to my students
(http://www.isd197.org/sibley/cs/icp/assignments/portfolio_html). I plan
to use this for comparison when we introduce OOP after the Winter Break.

My version is available at http://www.qwerk.org/tim/

I'd like to get some feedback on the code. I've created two classes
here, Portfolio and Stock. I'm specifically interested in the way the
main() function interacts with the class methods. I've got a strange mix
of program logic stuck in a series of elif statements and in the class
methods themselves. Something doesn't seem right about it.

Is there a way to create a Menu class that would help?

-Tim

--
Tim Wilson      |   Visit Sibley online:   | Check out:
Henry Sibley HS |  http://www.isd197.org   | http://www.zope.com
W. St. Paul, MN |                          | http://slashdot.org
wilson@visi.com |  <dtml-var pithy_quote>  | http://linux.com