cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <vadim.gritse...@verizon.net>
Subject Re: Re-precating (?) classes (was: RE: What is a Parser?)
Date Mon, 03 Feb 2003 15:37:00 GMT
Berin Loritsch wrote:

> Vadim Gritsenko wrote:
>
>> Berin,
>>
>> Please see example sent in response to Ken's question:
>>
>> Generator g;
>> Component c = g;
>>
>> This *will* fail to compile.
>
>
> Of course if it was written explicitly like a good programmer should,
> it would compile:
>
> Generator g = // ... lookup of Generator
> Comonent c = (Component) g;


I guess you know that modern IDEs do not appreciate this code style 
(unnecessary class cast). And after removing Component from Generator 
and all implementing classes (you are not in favour of keeping 
deprecated interface there, are you? the whole point was in reducing 
amount of deprecations) this will become dangerous class cast.


> However, when would this ever happen?


When, say, you happen to collect components in an array. Or see below.


> Who ever goes from an interface with methods to one without methods?


Avalon does ;-)
Or any avalon-like code, like CocoonComponentManager (which means 
chances are there is MyCompanyComponentManager somewhere out there).


> This only seems to be an accademic issue, and not a real world code 
> example.


Berin, that was you who taught us to work hard to keep backward 
compatibility. It should be you who should argue on this point instead 
of me! But if you want to go down the road of "academic" and "practical" 
backward compatibility, then I rest my case.


> IOW, what does it buy you to perform the bad code snippet above?
>
> For all practical and real requirements, it is safe to remove the
> Component interface from the Generator interface, et. al.
>
> Upgrading to Fortress or the CVS version of ECM, and then removing
> the Component interface from the core interfaces should give you
> the piece of mind that everything should compile and run.
>
> Try it as an experiment. 


I'm planning to. Really. When fortress is "ready" - or, better one - 
when beta release is due?
But do not complain when it breaks compilation of your favorite client's 
code ;-)



PS If any part of this email sounds offensive it means I have to take 
english classes ;-)

Vadim



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message