Java News-collector wrote:
> 
> Obviously you have limited knowledge/experience with the internals of
> object-oriented environments.  I wouldn't be too quick to call the object
> construction/initialization sequence "dumb" without a detailed analysis.
> 
> I would be inclined to say that calling an abstract/virtual method that
> must be defined in a subclass from within a constructor is a bad/dangerous
> programming practice that will yield unpredictable results, at best.

Maybe so, but I thought the whole point
of Java was to provide me with a language
where I couldn't shoot myself in the foot.
The worst thing about this particular design
is that I can call `method()' and update `d'
in this method, and neither or these provokes
an error at compile- or runtime. And later the
Java runtime overwrites `d' (which I set in
`method()') with the initializer value, which is
totally contrary to expectations and very
dangerous.

So granted that there may or may not be a
technical reason why the initialization sequence
is as it is (and I'm not convinced that it
couldn't be done in a more reasonable order yet),
I should at the very least get an error or
exception when I try to run the code.

Rich.

--
-      Richard Jones. Linux contractor London and SE areas.        -
-    Very boring homepage at: http://www.annexia.demon.co.uk/      -
- You are currently the 1,991,243,100th visitor to this signature. -
-    Original message content Copyright (C) 1998 Richard Jones.    -

Reply via email to