Is there some kind of Design pattern which would make it possible to use the Same code base in EJB and non EJB context?

Jan Matèrne

A good suggestion would be using Delegation


class PieceOfCode {
    public Object myMethod() {}
}

class EJBImpl ... {
    PieceOfCode poc = new PieceOfCode();

    public Object myMethod() {
        return poc.myMethod();
    }
}
This should not be a violation of EJB specs, since EJBs can use simple java classes for their use. Think about Dependant Objects and so on.
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact