周道 http://www.idon.com 工厂模式简介(续) ■ Afactory的 create方法封装了具体创建细节 解耦创建过程和使用过程,系统可扩展性增强, ■ Afactory的 create方法代码: public static aInterface create ot return new AClasso
http://www.jdon.com 工厂模式简介(续) ◼ Afactory的create方法封装了具体创建细节。 ◼ 解耦了创建过程和使用过程,系统可扩展性增强, 稳定性增强。 ◼ Afactory的create方法代码: public static AInterface create(){ …… return new AClass(); }
周道 http://www.idon.com EJB调用是工厂模式的实现 ■调用EJB语法: EJBHome em JNDI Server.getRemoteHome(EJB-JNDI-NAME) EJBObject myEJB= em created emcreateD类似 Afactory: create0; Ejbobject是接口
http://www.jdon.com EJB调用是工厂模式的实现 ◼ 调用EJB 语法: EJBHome em = JNDIServer.getRemoteHome(EJB-JNDI-NAME); EJBObject myEJB = em.create(); ◼ em.create()类似Afactory.create(); ◼ EJBObject 是接口