Re: Static vs Dynamic

From: Darren (pyedarren_at_hotmail.com)
Date: 11/03/04


Date: 2 Nov 2004 15:32:13 -0800

Pascal Costanza <costanza@web.de> wrote in message news:<cm7ich$qif$1@newsreader2.netcologne.de>...

>
> Imagine names that only differ in their use of punctuation but otherwise
> become ambiguous.

I don't have to imagine it. Research what are the known values
returned by "os.name". They already ARE ambiguous. That is what the
companion property "os.version" is for. All of the solutions on the
page would have the same problem. A combination of "os.name" and
"os.version" as part of the class naming convention would easily solve
this.

>
> It wouldn't stand the test of time. Today's operating system names may
> work in your solution, but you don't know what names vendors will come
> up with in the future.

quib·ble ( P ) Pronunciation Key (kwbl)
intr.v. quib·bled, quib·bling, quib·bles
To evade the truth or importance of an issue by raising trivial
distinctions and objections.
To find fault or criticize for petty reasons; cavil.

n.
A petty distinction or an irrelevant objection.
Archaic. A pun.

Come on, you are quibbling. You know (at least I hope you do) as well
as I that that could easily be solved by prepending something like
"OSj" to the class naming convention and using a double transformation
on the "os.name" result.

Example:
String osName = System.getProperty("os.name").replaceAll("\\p{Punct}|[
]", "_");
String os = "OSj"+osName.replaceAll("_", "");

Wow...that was complictated. Though I never saw such a requirement
expressed in the example. Will your next complaint be that I didn't
implement all known operating systems as objects and therefore it will
break if moved to a Mac box or an AS/400?

>
> > I am starting to see a trend here. Every time I do something with
> > Java that you hadn't thought of, you call it a hack. What I did there
> > is called "factory loading" and it's done all the time in java
> > software!!
>
> Too bad for Java software.

Whatever. Factory loading, incase you are unfamiliar, is typically
done using a hash table, the Factory Pattern and class loading. The
Factory loads the class on demand or extracts it from a cache and
returns... Never mind, if you thought I was implementing a "dirty
hack", you wouldn't get it. It's obvious to me you don't do real
programming and probably couldn't see the value of such a thing in a
real system.

>The trend I see is that you are only correcting bugs when someone
points them out to you.

Ya, I have better things to do with my time then turn a toy example
into production quality code, especially when you keep changing the
parameters by which the code is judged.

> I'll stop now.

It would be appreciated.