You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by David Blevins <da...@visi.com> on 2010/05/05 06:27:23 UTC
No Interface view (@LocalBean) and examples
With the @LocalBean support going in, we should maybe consider yanking @Local interfaces from all the examples across the board as really having to have an explicit business local interface is just EJB 3.0 noise.
Logically speaking the @LocalBean view will have all the interfaces the bean implements, so there's rarely a time to use just @Local.
We could instead just make a "local-interfaces" example or something and document it as "when you don't want to expose the bean class do it like this...." And document that perhaps @Local is preferred if memory is a concern as each reference to an @LocalBean essentially involves a "do nothing" subclass that takes up a small chunk for each field even though those fields aren't getting used.
On that memory note, perhaps for Stateless and Singletons we can just continuously give out the same local bean proxy instance. Cut down on wasted memory just a bit.
-David
Re: No Interface view (@LocalBean) and examples
Posted by David Blevins <da...@visi.com>.
On May 5, 2010, at 2:29 PM, Jonathan Gallimore wrote:
> On Wed, May 5, 2010 at 5:27 AM, David Blevins <da...@visi.com>wrote:
>
>> With the @LocalBean support going in, we should maybe consider yanking
>> @Local interfaces from all the examples across the board as really having to
>> have an explicit business local interface is just EJB 3.0 noise.
We should definitely do this. As we should maybe make it so the default format for @LocalBean views is just plain 'Foo' rather than 'FooLocalBean'.
Maybe a new 'interfaceType.' classification so that 'empty string' can be used in the format.
Thoughts? (volunteers?)
-David
Re: No Interface view (@LocalBean) and examples
Posted by Jonathan Gallimore <jo...@gmail.com>.
On Wed, May 5, 2010 at 5:27 AM, David Blevins <da...@visi.com>wrote:
> With the @LocalBean support going in, we should maybe consider yanking
> @Local interfaces from all the examples across the board as really having to
> have an explicit business local interface is just EJB 3.0 noise.
>
> Logically speaking the @LocalBean view will have all the interfaces the
> bean implements, so there's rarely a time to use just @Local.
>
> We could instead just make a "local-interfaces" example or something and
> document it as "when you don't want to expose the bean class do it like
> this...." And document that perhaps @Local is preferred if memory is a
> concern as each reference to an @LocalBean essentially involves a "do
> nothing" subclass that takes up a small chunk for each field even though
> those fields aren't getting used.
>
> I think this makes sense. I've added a JIRA for changes to the examples:
https://issues.apache.org/jira/browse/OPENEJB-1270
> On that memory note, perhaps for Stateless and Singletons we can just
> continuously give out the same local bean proxy instance. Cut down on
> wasted memory just a bit.
>
I've added an enhancement (mentioned in my other post) which should take
care of this.
Jon