Modular Classes or modular methods
Adriano Peluso
a.peluso at fulltrading.it
Wed Mar 14 14:24:24 UTC 2001
Dear Dirk,
At 12.41 14/03/01 +0100, you wrote:
>If I extend a program and reuse some of the already created classes, I find
>that I do not
>need the whole bunch, but I am using bits from one class and bits from
>another and than
>create my own class to bring them together.
>For example: if I add storage to my program and want to write data, I need
>all the variables.
>So I add a method inside the already existing class to create this data as I
>need it.
>If the data would be private I would not be able to write such a procedure.
>Still the added method would have no use to someone else or to another part
>of the program.
>So this method can be defined fully private within my own module.
>After I have written several of such methods, I can bring them together in
>my store-it-all method,
>which is the only part of my extension should be accessable by other parts
>of the program.
Ok, maybe I'm wrong and I didn't catch your point but this seems to me
somewhat similar to the Lisp and Dylan packaging facilities.
I never used Lisp neither Dylan but I've benn reading some docs and I was
interested that in Dylan you could decide to export in a package a single
method or a single attribute of a class.
So, as you say, a package could contain bits from one class and bits from
another.
Now, I don't remember wether a package could also be compiled in a stand
alone executable, I'd have to check...
I read something that sounded similar even about TOM but here what I know
is very little.
>So my conclusion is that in most cases we can find a proper seperation based
>on
>methods and not on the level of classes.
-:) methods and fields...
>Secondly I find that this kind of seperation is already expressed but not
>fully implemented
>in Smalltalk: it has "cathegories" as well as "packages".
>So somehow it is already a way we deal with the problem anyway.
>
>If someone does not agree with this please tell so, because there is a lot
>of
>experience to be shared in this area.
Bye
Adri
" One of the tricks here is to get away from thinking that programs have to
be composed with only a simple text editor "
Alan Kay
More information about the Squeak-dev
mailing list
|