This is a good example of a design pattern, and it is perhaps
understandable that a pattern like this would be built into the
language given the focus on GUI applications. But one of the things
I like least about Swing (the primary GUI framework for Java) is that
you end up passing a reference to a JFrame to objects like dialogs.
Sure, it's useful because there has to be some way of communicating
what ever data you entered through the dialog back to the main
application which, believe it or not, is usually an instance of
JFrame (!) Ugh. Maybe I'm missing something obvious, but that seems
to me like a completely unnatural way to use inheritance -- and I
like Java.
===
Gregory Woodhouse
[EMAIL PROTECTED]
"The whole of science is nothing more than a refinement
of everyday thinking." -- Albert Einstein
On Jul 11, 2005, at 3:55 PM, Kevin Toppenberg wrote:
In Borland's VCL, every object that is created must
supply an Owner parameter. Then, during creation,
that owner is notified of the new object, and they add
it to their list of objects they are responsible for.
Then, whenever an object is deleted, its destructor
makes sure to destroy all the objects that it is
responsible for. This helps prevent lost memory
allocations, though Borland also uses other methods as
well to ensure appropriate garbage collection.
I would think a similar system could be used for M
"objects". But the programmer would have to be sure
to call the "object's" destructor rather than just
killing it.
Kevin
-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Hardhats-members mailing list
Hardhats-members@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hardhats-members