My colleague told me that EJB itself shoudln't contain any method implemetation, it must only delegate method calls to some "helper" classes, i.e. EJB methods should look like this:
public String bsuinessMethod1() {
return helper.bsuinessMethod1()
}
public void bsuinessMethod2() {
helper.bsuinessMethod2()
}
And the reason to delegate methods like above, is to have less coupled code (for example when I want to reuse methods of "helper" class not in EJB context). Also he told that business methods shouldn't know anything about Java EE.
(Correct me if above statement is wrong, and please note that we don't use JPA transactions, we use another framework to dealing with data persistence)
So if above statement is correct, my "helper" classes should have the same methods as EJB. So can I reuse EJB interface for helper class (i.e. make helper class to implement same interface as EJB)? Would not it be bad from an architectural point of view?