[futurebasic] Re: Classes Shells Wrappers Objects and FB Now.

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 1997 : Group Archive : Group : All Groups

From: Mike Friedman <friedo@...>
Date: Fri, 19 Dec 1997 10:49:15 -0500 (EST)
On Fri, 19 Dec 1997, Robert Covington wrote:

> >In a message dated 12/18/97 8:54 PM, you wrote:
> >
> >>When can we start working on this and............what's it gonna be???
> >
> >One thing that you will start seeing probably very soon after the release
> >of FB^3, is a collection of freeware classes to be used with the FB^3
> >object class library.  Because of time constraints (you guys are so
> >impatient!  ;^) ), the base class library will be full-featured, but
> >probably very simple to start off.  Object libraries inherently lend very
> >well to programmers adding on by building their own subclasses, so the
> >fact that the library starts out simple won't be a problem.  I am sure we
> >will end up setting up a section for third-party classes on our site -
> >I'd like to have a central place availalable for collection.
> >
> >So you guys may want to start thinking about writing code you can "wrap"
> >in class shells when the time comes, and ideas on what types of objects
> >you would like to see added to the collection.
> >
> >Just a thought...  :-)
> >
> >========================================
> >|       David Blache - Developer       |
> >========================================
> Explainers,
>  I must have missed class class; I slept through it, I reckon. What would
> be some examples of classes, subclasses, and perhaps skipped classes?

My knowledgs of this is somewhat limited...it's based on the first three
chapters of a Java book I got bored of and the discussion that's been
taking place on the list, so here goes...

> What is an object exactly; an example of one? Why are they called objects?

An object is anything.  It can be a button, edit field, menu, window, or
picture.  They're simply elements of the mac interface we all know and

> I mean how do all these things relate to what is known as a LOCAL FN in
> today's FB? And if they are just pre-written FN's you can plug in why can't
> they be called that?  Are they just pre-compiled codeballs you pass
> parameters to like a CDEF?

Sorta.  Objects belong to a class (right?) which has methods.  Methods are
basically specialized FN's.  They describe how a certain class "behaves."
For example, suppose you have the class _cWindow, which has methods that
describe how a typical window behaves.  One of those methods would tell
the mac to close the window when the close box is clicked.  Objects can
have their own methods to make behavior specific to them, and they can
"inherit" traits from their parent class.  I don't know weather or not
FB^3 will support multiple inheritence, as I think Java does, which would
allow and object to inherit stuff from more than one parent class.

> What are class shells in terms of the current FB syntax and structure?
> Another name for an include file or big LOCAL FN?

Classes are just little files (you don't need to reference them with an
INCLUDE or anything in FB, just shove them in your project window.)  They
contain the rules of behavior for objects.  For example, the cWindow class
mentioned above deals with closing windows when the close box is clicked,
etc.  An infinite amount of objects can be "offspring" of a class, each
with it's own specific behavior.  For example, suppose you wanted to make
a certain window throw up a special dialog before it closes if the close
box was clicked, and even stop the window from closing as a result of a
choice in the dialog.  (For example, a dialog saying "Do you REALLY want
to close that window?")  You could define a method in that specific
window's code which would intercept the close-box event and do the dialog.
You then either have the choice of passing the event on to the super-class
or not.  Incidently, the way you "intercept" events for use with your
object's methods is simply by naming the method in the object the same
thing it's named in the class (for example METHOD closeBox) which is kinda
reminiscent of HyperCard (remember HyperCard? :))

> I find this confusing. Still. If these questions are dumb, well, that's
> because this stuff isn't explained well as regards terms, and I have no
> idea what is going on here (duh :) )...yet. Probably mentioned in the big
> terror thread a while back, but I must have missed it or found it
> unfathomable as presented.
> Is there any alternative lingo for all this stuff that relates to the world
> as we know it now in FB that makes this more understandable?

I hope I've cleared it up a bit, but I'm not very confident I _fully_
understand it.  As for alternative terms, I don't think so.  These are the
same terms used in other Object Oriented environments (in Java I believe
an object is called an "instance" of a class).  Anyway, I would hesitate,
no, I would not at all begin to compare methods to FN's, because they are
for entirely different purposes.  It took me a while to fully understand
the PG way of doing things when I upgraded to FBII, and when i did I
thought it was ingenious.  (I still do!.)  So, if you think the PG
philosophy is as brilliant as I do, just wait until you get OOP.  It

> Class and SubClass and Objects and Inheritances seem to be like Quantum
> Theory for BASIC; they can be explained, but in doing so, what is being
> explained seems to become unexplainable. <G>

It's just one of those things that's intimidating because there's a lot of
new theory and big words.  But, once you get it, it's pretty cool.  It's
one of those things that just sort of "clicks" on all of a sudden in your

> I want Newtonian BASIC, even Relativistic BASIC. Quantum BASIC isn't basic
> anymore, though I guess it would be cool to be able to use $uper$trings,
> but that is only a theory at this point. I mean string.

It is, it's just a new form of it.  All the commands and stuff are the
same, but this is the next evolutionary step up from spaghetti code (like
TRS-80 BASIC, and PG which generated "organized" spaghetti code :-)) to an
object oriented code style which makes more sense when programming for GUI
environments like the Mac.  I admit, I was very intimidating jumping from
BASICA on the 286 to PG projects, but it pays off in the long run.  I look
forward to FB^3 with a great deal of enthusiasm, but most of all, willing
to learn.  I hope I've helped you a bit, apologies for such a long post.

 - Mike

> Gracias,
> Robert Covington
> --
> To unsubscribe, send ANY message to <futurebasic-unsubscribe@...>