comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » What about real polymorphism ??
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: What about real polymorphism ?? [message #42020 is a reply to message #41991] Tue, 14 December 2004 10:56 Go to previous messageGo to previous message
Michael Wallace is currently offline  Michael Wallace
Messages: 409
Registered: December 2003
Senior Member
> My favorite quote:
>
> Singleton is a social disease. Because Singleton is so easy to
> understand, it is the single pattern that almost anybody who merely
> thumbed through GoF at the bookstore can remember and explain. That
> leads to unwarranted exuberance for the pattern among those who can
> least afford such exuberence.

That's a pretty good quote. Really, you could say that about any of the
patterns. One thing that novice programmers will do is discover the
Singleton, Decorator, Visitor, Factory or some other pattern and then
try to apply the pattern to every possible task usually with great
exuberance. What you wind up with are programs that are 10 times as big
as what they need to be (if not more) and layer upon layer of needless
complexity. I've suffered that same exuberance before, so I know
exactly what it feels like and what it feels like to look at the code a
year later. :-p

> You *can* implement a singleton in IDL (yes, using a common block or
> system variable). Try a search:
>
> http://groups.google.com/groups?as_q=singleton&as_ugroup =*idl-pvwave*

That's interesting. I had no clue that you could create your own system
variables. While not totally ideal, the read only system variable
allows you to do what I thought that IDL couldn't do -- be able to
enforce the rule of having one and only one class in existence. The
previous example just said to have a global variable, which wouldn't be
a singleton at all because you could instantiate as many of those
variables as you want. I sure didn't know of any way to limit IDL so
that you could only create a single instance. I must admit that I am
VERY surprised that IDL has this feature and happy to see it. Will
wonders never cease?

Mike
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: building loops at the command line
Next Topic: Reg VarRoi

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 17:17:21 PDT 2025

Total time taken to generate the page: 0.56107 seconds