[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] Which Class do I use?
From: |
Duke Normandin |
Subject: |
[Help-smalltalk] Which Class do I use? |
Date: |
Sun, 10 Jan 2010 09:52:42 -0700 (MST) |
User-agent: |
Alpine 2.01 (OSX 1266 2009-07-14) |
Or more specifically, "How does one *start* an OOP/GST program?
My understanding so far of OOP - which, to me, means GST - is that
there exists the following general structure:
Genesis Object (God)
|
+--ClassA (which is an object having its origin in God)
| |
| + ---- ClassA.InstanceOf1 (which is an object)
| | |
| | +--feature1 (which is an object)
| | |
| | +--message1 (that feature1 understands)
| | |
| | +--feature2
| | |
| | +--message2
| |
| |
| +---- ClassA.InstanceOf2
|
+--ClassB
|
+--ClassC
|
and the list goes on, and on, and on, and on... ;)
Am I "on track" at all, so far?
So, when a person begins to design an OOP/GST program/script, with
what Class do you start? Let say that I want to create a console app -
say a text-based calculator (which eventually I'll migrate to
ncurses). The app will (pseudo-code) do the following:
print-to-screen "Duke's Kick-ass GNU-Smalltalk Calculator"
skip a line
print-to-screen "Select a math Operation [+ - * /]:
wait for user input, then inhale it
print-to-screen "Enter first operand":
You get the idea!
What Class do I use to start the Inheritance ball rolling? String?
Math? Is there a "template" type of thing to organize the OOP design?
In C - which I know very little of - you have the general structure:
prototypes go here
global vars go here
blah main()
{
local vars go here
Opening statement goes here
etc
etc
}
other functions go here
I probably don't have the C program structure dead on, but you get the
point I hope. So far, my impression of OOP/Smalltalk classes is that
they're like Perl's CPAN modules repository - is that correct?
I'm using the a couple of GST tutorials to get me started with the
syntax etc, but I'm still not clear on how to start "thinking in OOP"
- obviously.
--
duke