Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [birt-dev] Java Event Handlers

There are also some advantages to implementing an interface rather than
extending an adapter class.  When you implement an interface, Eclipse
generates the stubs for you, allowing you to see not only all the
methods in the interface, but also the arguments to the methods you are
about to implement.  When you extend an adapter class, you have to refer
to the Javadoc or other documentation to find the method signatures.
Also, if you implement the interface and the interface changes, the
compile errors let you know what you need to change.  Whereas if you
extend the adapter class and the interface has changed, you will not get
compile errors, but neither will you have functioning event handlers,
and the report will run but without the desired results and the reason
may not be so apparent.  The documentation mentions both techniques and
explains the advantages and disadvantages of both.  Is there some reason
that we need to go further than that?

Don French
Developer Communications

-----Original Message-----
From: birt-dev-bounces@xxxxxxxxxxx [mailto:birt-dev-bounces@xxxxxxxxxxx]
On Behalf Of Scott Rosenbaum
Sent: Monday, February 06, 2006 1:00 PM
To: For developers on the BIRT project
Subject: Re: [birt-dev] Java Event Handlers

Petter,

I brought this up to Wenfeng at the PMC today.  After discussing the 
alternatives, we decided that the recommended approach will be to use 
the adapters.  Apparently this is in keeping with Eclipse standard 
practice.  I will send an email to Janet in docs to change the BIRT 
documentation.  In addition, I will work with Jason Weathersby to make 
sure that the web site highlights this method.

If anyone has any additional thoughts or comments on this, please let me

know.

Scott Rosenbaum
BIRT PMC

Petter Ivmark wrote:
> By extending the adapters, we guarantee that if we change the
> interfaces, the user's script code will still compile (although it
might
> not be executed). So I guess it's up to the user to decide if they
> prefer compile errors or not if the interfaces are updated. This
should
> probably be documented somewhere.
> /Petter
>
> -----Original Message-----
> From: birt-dev-bounces@xxxxxxxxxxx
[mailto:birt-dev-bounces@xxxxxxxxxxx]
> On Behalf Of Scott Rosenbaum
> Sent: Friday, February 03, 2006 3:41 PM
> To: For developers on the BIRT project
> Subject: [birt-dev] Java Event Handlers
>
> This is probably for Petter,
>
> I noticed in the documentation where they show Java event handlers,
they
>
> demonstrate creating handler classes by implementing items from the 
> org.eclipse.birt.report.engine.api.script.eventhandler package.  I see

> that for each of the interfaces, a default implementation has all
ready 
> been created in
org.eclipse.birt.report.engine.api.script.eventadapter. 
>
> Is it preferable to have people implement the interface or just have 
> them extend the eventadapter classes?
>
> If extending eventadapter is preferable I will create a Bugzilla
entry.
>
> Scott Rosenbaum
> BIRT PMC
> _______________________________________________
> birt-dev mailing list
> birt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/birt-dev
> _______________________________________________
> birt-dev mailing list
> birt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/birt-dev
>
>   
_______________________________________________
birt-dev mailing list
birt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/birt-dev


Back to the top