Question

I have a question about EJB: Local, and No-Interface Views.

According to the book "Beginning Java EE 7"

@Local: Denotes a local business interface. Method parameters are passed by reference from the client to the bean.

The no interface view is a variation of the local view that exposes all the public business methods of the bean class locally without the use of separate business interface.

And my question is are there any significant differences between @Local annotation and no interface view, and if so how and when each of them should be used?

Was it helpful?

Solution

It is called no interface view if you let you Bean implement only one Interface you do not need to annotate the Interface or Bean, because the Container will use this Interface as LocalInterface by default.

The client who wants to use the EJBs Methods only see the public methods provided by the interface and all the other aspects of method implementation are hidden from the client.

So you can annotate bean or interface with @Local but you do not need it, if you only use one Interface.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top