正在加载图片...
pest中EB的设计模式 persistent store. Because the bean delegates its persistence-related asks to the DAo, it can concentrate on implementing business method At deployment time, the application administrator configures the implementation of OrderdAo to be one of OrderDAOCS, OrderDAOOracle, or OrderDAOSybase, depending on whether an Cloudscape, Oracle, or Sybase database is used, No matter what choice is made. the orderejb is unaffected, because it is programmed to an interface, not to an implementation.(很简单,我就不翻译了吧,要不就被我糟蹋原意了)。 不过我现在使用的是JB6.0+ Weblogic6。1开发bmp,我们大多使用了JB的 向导,它自动生成了代码,可是它没有实现这种模式.在 Sessionbean中我们 封装了JDBC的数据读取,有点向这种模式 213.结构 它使用了GOF中的 Bridge和 Adapter模式。整个结构图如下 Brdge: Implementor Bda:b cion Budge: Concrutamplamenbor idoe: Conen almplamanbor oid dataAccessMethod 2 roid data accesskath 6 id data.Acc色 大家可能看明白,其实就是在 Businessobject中提供了业务逻辑方法,假如它必须要读取 数据,但是这个数据可能存在 Oracle数据库中,又有可能存在exce文件中,也许存在XML 文件中,如果我们在这个方法中直接读取数据,那就要写这样的语句 witch (DATA TYPE) CLE. 通过JDBC读取 Oracle数据 通过专门的AP进行读取, Excel文件PetStore 中 EJB 的设计模式 5/5 persistent store. Because the bean delegates its persistence-related tasks to the DAO, it can concentrate on implementing business methods. At deployment time, the application administrator configures the implementation of OrderDAO to be one of OrderDAOCS, OrderDAOOracle, or OrderDAOSybase, depending on whether an Cloudscape, Oracle, or Sybase database is used. No matter what choice is made, the OrderEJB is unaffected, because it is programmed to an interface, not to an implementation.(很简单,我就不翻译了吧,要不就被我糟蹋原意了)。 不过我现在使用的是 JB6.0+Weblogic6。1 开发 bmp,我们大多使用了 JB 的 向导,它自动生成了代码,可是它没有实现这种模式.在 SessionBean 中我们 封装了 JDBC 的数据读取,有点向这种模式。 2.1.3. 结构 它使用了 GOF 中的 Bridge 和 Adapter 模式。整个结构图如下: 大家可能看明白,其实就是在 BusinessObject 中提供了业务逻辑方法,假如它必须要读取 数据,但是这个数据可能存在 Oracle 数据库中,又有可能存在 excel 文件中,也许存在 XML 文件中,如果我们在这个方法中直接读取数据,那就要写这样的语句 switch (DATA_TYPE){ case ORACLE: 通过 JDBC 读取 Oracle 数据 break; case Excel: 通过专门的 API 进行读取,Excel 文件
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有