You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ecs-user@jakarta.apache.org by Mathew Pole <Ma...@clipsal.com.au> on 2002/06/25 02:46:31 UTC

ECS FrameSetDocument extend Document

Hi ,
 
I'm curious as to why org.apache.ecs.FrameSetDocument doesn't extend
org.apache.ecs.Document.
 
In the past I've written a number of methods which returned the Document
class. Today I need to return a document containing frames from one of those
methods, and found myself writing this code:
 
    Document d = new Document ();
    d.setHtml (new FrameSetDoc ().getHtml ());
    return d;

 
Note that FrameSetDoc extends FrameSetDocument and builds the frameset.
 
Can someone satisfy my curiousity as to why this is so?
 
Regards,
    Mathew

-- 
Mathew Pole 
Web Developer, Custom Press 
email: mathew.pole@clipsal.com.au 
phone: 08 8269 0511 ext 313, fax: 08 8340 1212, mobile: 0403 164 617 
 

Re: ECS FrameSetDocument extend Document

Posted by robert burrell donkin <ro...@mac.com>.
(sorry about taking so long to get back to you.)

i've now got the patch extracted ok (please create a '-u' diff next time). 
i'm not going to apply it but i will give you a reason.

one subtle point about ecs is that inheritance doesn't work as well as you 
think it might. the override Document setXX and appendXXX return Document 
rather than FramesetDocument. this means that your patch will break 
backwards compatibility. it also means that you'll require down casting to 
get back the extra methods.

creating a class extending Document is probably the right way to solve 
your problem but i don't think that it's a general solution.

anyway, thanks for taking the time to submit the patch.

- robert

On Tuesday, June 25, 2002, at 02:02 AM, Martin Redington wrote:

>
> I just had a 15 second glance at the source.
>
> Looks like missing it out was an oversight to me.
>
> Why not take a 5 minute look, and if you can't see any problems, fix it 
> and submit a patch :-)
>
> On Tuesday, June 25, 2002, at 01:46 AM, Mathew Pole wrote:
>
>> Hi ,
>>
>> I'm curious as to why org.apache.ecs.FrameSetDocument doesn't extend
>> org.apache.ecs.Document.
>>
>> In the past I've written a number of methods which returned the Document
>> class. Today I need to return a document containing frames from one of 
>> those
>> methods, and found myself writing this code:
>>
>>     Document d = new Document ();
>>     d.setHtml (new FrameSetDoc ().getHtml ());
>>     return d;
>>
>>
>> Note that FrameSetDoc extends FrameSetDocument and builds the frameset.
>>
>> Can someone satisfy my curiousity as to why this is so?
>>
>> Regards,
>>     Mathew
>>
>> --
>> Mathew Pole
>> Web Developer, Custom Press
>> email: mathew.pole@clipsal.com.au
>> phone: 08 8269 0511 ext 313, fax: 08 8340 1212, mobile: 0403 164 617
>>
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ECS FrameSetDocument extend Document

Posted by Martin Redington <m....@ucl.ac.uk>.
I just had a 15 second glance at the source.

Looks like missing it out was an oversight to me.

Why not take a 5 minute look, and if you can't see any problems, fix it 
and submit a patch :-)

On Tuesday, June 25, 2002, at 01:46 AM, Mathew Pole wrote:

> Hi ,
>
> I'm curious as to why org.apache.ecs.FrameSetDocument doesn't extend
> org.apache.ecs.Document.
>
> In the past I've written a number of methods which returned the Document
> class. Today I need to return a document containing frames from one of 
> those
> methods, and found myself writing this code:
>
>     Document d = new Document ();
>     d.setHtml (new FrameSetDoc ().getHtml ());
>     return d;
>
>
> Note that FrameSetDoc extends FrameSetDocument and builds the frameset.
>
> Can someone satisfy my curiousity as to why this is so?
>
> Regards,
>     Mathew
>
> --
> Mathew Pole
> Web Developer, Custom Press
> email: mathew.pole@clipsal.com.au
> phone: 08 8269 0511 ext 313, fax: 08 8340 1212, mobile: 0403 164 617
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>