sábado, 24 de agosto de 2013

EJB3.1


EJB is used to provide services for distributed applications.
Some different configuration type can be used, one example in the code;

@Stateless //State type for the EJB
@LocalBean //Says that this need not local interface
public class Implementation   implements InterfaceRemote {
}

In this case the local method is all in the class Implementation, they don't need annotations.


Some implementations use generics to have less repeated code.
A Good use of  this is for DAO of entity, the class Implementation extends SomeGenericDAO<EntityTO>.
Or a simple use is extends SomeClass only.

One EJB can acess other using the annotation @EJB to inject dependen.
@EJB
private UserBean userBean;


This being updated.........

Nenhum comentário:

Postar um comentário