tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Gallimore <jonathan.gallim...@gmail.com>
Subject Re: Why two interfaces for CalculatorImpl.java
Date Tue, 26 May 2009 20:01:05 GMT
On Tue, May 26, 2009 at 8:48 AM, siegfried <siegfried@heintze.com> wrote:

> I'm studying
>
> openejb-examples-3.1\simple-stateless\src\main\java\org\superbiz\calculator\
> CalculatorImpl.java
>
> (1) Why does CalculatorImpl need to implement two identical interfaces? Is
> this necessary? Is this because we might want to expose additional
> functionallity to other server side functions that are not available to
> clients?


CalculatorLocal is a local business interface, which can be used for calls
where the bean you are calling is in the same JVM as the caller. The remote
business (CalculatorRemote) interface on the other hand will work across
JVMs. You can also specify @Remote and @Local on the same business
interface, but I personally prefer using different interfaces for remote
calls to local ones.

I've never tried having different methods in the different interfaces, but I
can't see why it wouldn't work.


>
>
> (2) In c++ one would have to implement function sum twice: one for
>    each interface. Does the single implementation of function "add"
>    satisfy both ancestor interfaces?
>
>
>
Yes it does.

Cheers

Jon

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message