Hi Glen,
Forcing people to implement an interface might not be liked by some people.
One thing ppl do not like about EJBs is that it forces you to implement
interfaces. In the simplest scenario, a user can have a POJO, drop this into
Axis2 and expose it as a service, also the same POJO may be dropped into a
different container without having to include the dependent Axis2 libraries.
Forcing the user to implement the interface will tie the POJO to Axis2. Is
there a significant performance gain if an interface is used? How often does
the init/destroy method get invoked?

-- Azeez




On 6/14/07, Glen Daniels <[EMAIL PROTECTED]> wrote:

Hi folks!

We're trying to resolve https://issues.apache.org/jira/browse/AXIS2-2785
here at the hackathon.  (see conversation at
http://www.nabble.com/java.lang.NoSuchMethodException-tf3886972.html if
you're interested)

What it comes down to is this.  Currently DependencyManager (why the
heck is this called "DependencyManager"? It doesn't manage anything,
and-- ok, that's another issue :)) is introspecting the service class to
find the init(ServiceContext) and destroy(ServiceContext) methods.  It
has been suggested that instead of introspecting, we could simply have
the service author optionally implement ServiceLifecycle, an interface
containing these two methods.  Then all the introspection code would go
away to be replaced with code like:

   if (serviceObject instanceof ServiceLifecycle) {
     ((ServiceLifecycle)serviceObject).init(serviceContext);
   }

Advantages - faster.  Simpler.  Less error-prone for developers (IDEs
will help you implement the interface).

So my proposal is that we do the following:

1) Add ServiceLifcycle interface, and code like the above.  Also leave
    the introspection code for now.
2) Put a BIG BOLD notice in the release notes that we are now using
    the interface and you should switch to that rather than relying on
    method introspection.
3) Remove introspection code in 1.X (where X=4 or 5)

Here's my +1.  Are people OK with moving forward with this solution?

Thanks,
--Glen

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Thanks
Afkham Azeez

http://www.wso2.org
GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760

Reply via email to