正在加载图片...
PetStore中EJB的设计模式 Petstore中EJB的设计模式 Liubing(bliu76@yeah.net) 1.概述 通过分析数据模型,和实际操作 PetStore我们大概对它的数据模型有所了解。现在开始 分析系统EJB层的设计模式。首先什么是模式?看Gof的《设计模式》的定义,就是对被 用来在特定场景下解决一般设计问题的类和相互通信的对象描述。唉!太深沉了。一头雾水。 其实,就是一些经验,并且经过科学整理,可以在某种场合下反复使用,解决一些问题。当 然在《设计模式》一书罗列出23中模式,并且进行了详细描述。今天我们所说的模式,是 PetStore中的EJB设计经验 关于设计模式,我有很多感触,Gof的书我不知看了多少遍,可总是不太明白,我几年 没有使用C艹+了,里面的例子,看着很不爽。板桥先生网上的例子很简单明了,但是经过 段时间的学习,有点不尽兴的感觉。于是又看了其他的几本书,心中有了一些感觉,可是实 际写代码很难用上,并且现在项目使用J2EE,于是我决定分析 PetStore源码,看看这些牛 人是怎样使用模式的。在我们的项目开发中也照葫芦画瓢,使用一把。 关于 Petstore的模式,SUN的站点列出了以下几种模式,当然其中的 Frontcontroller属 于Web层的 Pattern Inte Data Access Decouple business logic from data access logic and adapt the resource being ec accessed, so that the type of resource can change easily and independently accelerate read-only data access by not using enterprise beans Reader Front Controller Centralize view management(navigation, templating, security, etc. ) for a Web application in a single object that handles incoming client requests Page-bY-Page Efficiently access a large, remote list by retrieving its elements one sublist of Iterator value objects at a time Session Facade Provide a unified, workflow-oriented interface to a set of enterprise beans Efficiently transfer remote, fine-grained data by sending a coarse-grained Value object view of the data 在《J2EE核心模式》一书中列出了以下几种模式,当然包括了以上的几种模式。这本书不 错,可惜翻译的很次。 业务代表 值对象 值对象组装器PetStore 中 EJB 的设计模式 3/3 PetStore 中 EJB 的设计模式 Liubing (bliu76@yeah.net) 1. 概述 通过分析数据模型,和实际操作 PetStore 我们大概对它的数据模型有所了解。现在开始 分析系统 EJB 层的设计模式。首先什么是模式?看 Gof 的《设计模式》的定义,就是对被 用来在特定场景下解决一般设计问题的类和相互通信的对象描述。唉!太深沉了。一头雾水。 其实,就是一些经验,并且经过科学整理,可以在某种场合下反复使用,解决一些问题。当 然在《设计模式》一书罗列出 23 中模式,并且进行了详细描述。今天我们所说的模式,是 PetStore 中的 EJB 设计经验。 关于设计模式,我有很多感触,Gof 的书我不知看了多少遍,可总是不太明白,我几年 没有使用 C++了,里面的例子,看着很不爽。板桥先生网上的例子很简单明了,但是经过一 段时间的学习,有点不尽兴的感觉。于是又看了其他的几本书,心中有了一些感觉,可是实 际写代码很难用上,并且现在项目使用 J2EE,于是我决定分析 PetStore 源码,看看这些牛 人是怎样使用模式的。在我们的项目开发中也照葫芦画瓢,使用一把。 关于 PetStore 的模式,SUN 的站点列出了以下几种模式,当然其中的 FrontController 属 于 Web 层的。 Pattern Intent Data Access Object Decouple business logic from data access logic and adapt the resource being accessed, so that the type of resource can change easily and independently. Fast-Lane Reader Accelerate read-only data access by not using enterprise beans. Front Controller Centralize view management (navigation, templating, security, etc.) for a Web application in a single object that handles incoming client requests. Page-by-Page Iterator Efficiently access a large, remote list by retrieving its elements one sublist of value objects at a time. Session Facade Provide a unified, workflow-oriented interface to a set of enterprise beans. Value Object Efficiently transfer remote, fine-grained data by sending a coarse-grained view of the data. 在《J2EE 核心模式》一书中列出了以下几种模式,当然包括了以上的几种模式。这本书不 错,可惜翻译的很次。 业务代表 值对象 值对象组装器
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有