adam bien's blog

Are EJB Naming Conventions Still Needed? 📎

Since the advent of EJB 3.X I don't use the Local/Remote naming schemes for business interfaces any more. The EJB client is only interested in the functionality and not the distribution or other infrastructural settings. The business interface is therefore just a POJI - without any dependency on the EJB API or infrastructure:

public interface CrudService {

}

The EJB implements the interface and exposes it with the @Local annotation. 

@Stateless
@Local(CrudService.class)
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public class CrudServiceBean implements CrudService {
}

I actually thinking about getting rid off the suffix Bean as well. It would be much better to emphasize the actualy responsibility and name after it e.g. a JPACrudService. It is already annotated with the @Stateless annotation - so it is obviously a Bean. In my opinion interface naming schemes are unnecessary in general.