动态网站制作指南 [  QQ表情  ]
[ 投票调查 ]
[ 企业邮箱 ]
[ 网站空间 ]
网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
ASP源码 | .Net源码 | PHP源码 | JSP源码 | JAVA源码 | CGI源码 | VB源码 | C++源码 | Delphi源码 | PB源码 | VF源码 | 汇编 | 服务器
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > J2EE/J2ME教程
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
文章搜索服务
邮件订阅
输入你的邮件地址,
你将不会错过任何关于:
[ J2EE/J2ME教程 ]的信息

本月文章推荐
.MIDP终端模拟之三:MIDP 的自定义.
.EJB的SessionBean编程规则.
.在J2ME编程中使用 Nokia 的中文模.
.Java数据对象(JDO)介绍(四).
.经典收藏:J2MEGame的开发笔记.
.J2EE组件开发:会话EJB.
.JBosseclipseEJB学习体会.
.Servlet中jdbc应用高级篇之一.
.使用SAAJ1.2发送和接收二进制Web.
.JBOSSAOP学习笔记-一些术语.
.熟练使用J2ME可选包MMAPI.
.MoreJSP编程实践(上).
.使用platformRequest()自动更新M.
.Spring Framework中的面向方面编.
.线标记语言(WML)之Script函数库.
.jBPM取得任务和任务的人员.
.简单封装MIDP RMS操作.
.Flash Lite挑战J2ME.
.实例-用JSF实现文件下载.
.测试遗留代码.

JDO、EJB/CMP、Hibernate和Amber的比较

发表日期:2007-12-23 |



  来自:http://www.matrix.org.cn/blog/liu2liu2

jdo的优点

●  JDO的生命周期状态机(lifecycle state machine)是正确的用法。任何其它的O/R映射工具都应该使用JDO的生命周期或者它的子集(例如:如果不支持事务)。记住,JDO生命周期是为JDO实现服务的。大部分用户不需要了解其中很复杂的内幕。网页Amber生命周期中有些图示。

●  PersistentManager API对如何管理JDO对象的状态有一定的优势和价值。

jdo的缺点

●  查询(query)支持不完全。它应该使用类似Hibernate的HSQL查询语言,并使用Java.sql.ResultSet作为查询结果。

●  用于重载方法的字段扩展让人觉得比较混乱。最好使用类似Hibernate或者EJB/CMP的方法,并重载它们。

hibernate的优点

●  有着正确的数据模型。以POJO为基础的模型是个正确的方向。

●  可配置性(例如对象之间的关系)是个很好的基础。

●  HSQL正是O/R映射语言应该有的。

●  有着完整的API

●  采用简明的Session类作为控制流的清洗器,因为它沿用了Connection的模型

hibernate的缺点

●  没有使用JDO生命周期,这是不正确的做法。

●  API(例如查询)还是有点混乱。It's better than the alternative, but using java.sql.ResultSet as the foundation would clean it up.

●  API如果作为一个规范的话,还是不够干净。例如,在使用查询参数(query parameters)时,存在一些应用漏洞。

●  我不认为使用类名作为表的标识是件好事。

ejb/cmp的优点

●  采用工厂类(指Home)查找实例比向Session/Connection对象传递参数获取实例要好。

●  ejbSelect跟上面说的类似。

●  查询名称使用abstract schma是一个很好的解决方案。

●  理论上来说,这种模式在某些方案中可以有更好的复用性。

ejb/cmp的优点

●  CMP不属于EJB规范。它并不是个合适的模型去实现这个目的。已经没有合适的(例如非官方)借口去让EJB3.0中保留CMP。

amber优点

●  使用JDBC ResultSet和PreparedStatement做查询

出于某些原因,O/R映射工具通常抛弃强大的ResultSet和PreparedStatement API,而创建自己一套并不是很合适的替代品。O/R查询器应该使用一个外部的SQL(例如HSQL)作为查询语言,并使用ResultSet作为结果集,使用PreparedStatement处理查询参数。可以增加其它的API作为查询子集,就像查询一个单独的实体,但应该使用ResultSet和PreparedStatement作为基础。

amber缺点

●  Amber的研究价值远大于它的使用价值

原文内容
JDO pros:
The JDO lifecycle state machine is the correct one. Any serious O/R mapper needs to use the JDO lifecycle or a subset (e.g. if transactions aren't supported.) Remember, the JDO lifecycle is for JDO implementors. Most users don't need to see the gory details. The Amber lifecycle page has some diagrams.
The PersistentManager API has some positives, valuable for managing the state of JDO objects.
JDO cons:
The query support is completely inadequate. It should use something like Hibernate's HSQL, and should use java.sql.ResultSet as the query result.
The promotion of fields to overloaded methods is messy. It's better to start with methods like Hibernate or EJB/CMP and overload them.
Hibernate pros:
The data model is correct. The POJO model using methods as the basis is the right way to go.
The configuration, esp for relations is a good basis.
HSQL is just about what an O/R map language should be.
The API is adequate.
The eXPlicit Session makes the control flow cleaner,
since it follows the Connection model.
Hibernate cons:
It doesn't use the JDO lifecycle model. This is incorrect.
The API, esp the query, is still a bit messy. It's better than the alternative, but using java.sql.ResultSet as the foundation would clean it up.
The API isn't clean enough for a spec, i.e. it has a number of implementation hacks, esp with the query parameters.
I'm not convinced using the class name as the table identifier is a good thing.
EJB/CMP pros:
The factory (home) classes are nice for finding instances rather than passing extra parameters to a Session/Connection object.
The ejbSelect is similarly
Using the abstract schema for the query names is a good solution
In theory, the model can allow for efficient object reuse in some cases
EJB/CMP cons:
CMP does not belong in the EJB spec. It's been contorted to follow a model that's not appropriate for the task. There's no valid, i.e. non-political, excuse for keeping CMP in EJB 3.0.
Amber pros:
Using the JDBC ResultSet and PreparedStatement for queries.
For some reason O/R mappers generally throw out the powerful ResultSet and PreparedStatement API and create their own hacked up and inadequate replacements. O/R queries should use an extended SQL like HSQL as the query language and use ResultSet for results and PreparedStatement for query parameters. Other specialized APIs can be added for particular subsets, like quering a single entity, but the foundation should be ResultSet and PreparedStatement.

Amber cons:

Amber is an experiment rather than an actual competing API.

(出处:http://www.knowsky.com)


上一篇:JDO2.0的查询语言新特性 人气:532
下一篇:JSP+JavaScript实现类似MSDNCSDN导航树效果! 人气:881
浏览全部J2EE/J2ME的内容 Dreamweaver插件下载 常用网页广告代码全集
  最新网站源码 最新软件下载
2008-12-1 MyBB v1.4.4 简体中文版 bulid 2
2008-12-1 新云网站内容管理系统 v4.0.0.11
2008-12-1 网趣网上购物系统时尚版 v8.8
2008-12-1 Textpattern v4.0.7 多国语言版
2008-12-1 Piwik ( PHP统计系统,可以和GOOG
2008-12-1 天空网络电影系统SKYUC! v2.6.2
2008-12-1 SiteDynamic企业网站管理系统 v1
2008-12-1 KindEditor HTML在线编辑器 v3.0
2008-12-1 0451sky高校教务管理系统2008 v4
2008-11-29 Tencent Traveler 4.4
2008-11-29 龙卷风网络收音机 v3.0.0.0
2008-11-29 Intel Chipset Software Install
2008-11-29 TweakVI 1.0 Build 1100
2008-11-29 Opera 9.62 Build 10469
2008-11-29 MPlayer WW编译版 SVN-r28044(20
2008-11-29 NetTools网络工具v1.0.0破解版
2008-11-29 3DGallery三维体验1.1破解版
2008-11-29 SecretBook保密本v1.0破解版
  发表评论
姓 名: 验证码:
内 容:
站长工具:网站收录查询 | Google PR查询 | ALEXA排名查询 | CSS在线编辑器 | OPEN参数生成器 | 弹出式窗口代码产生器 | 密码登录生成器 | 在线按钮生成器 | Meta标签生成器 | 多色彩特效字代码生成器 | 网页代码调试器 | 在线FTP登陆 | Flash取色器 | 配色代码对照表 | 配色辞典 | CSS生成器 | 广告代码 | 框架网页代码生成器 | js/vbs加密 | md5加密 | 进制转换 | UTF-8 转换工具 | 在线调色板 | Html转换js | Html转换asp | Html转换php | Html转换perl
实用工具:汉字翻译拼音 | 拼音字典 | 符号对照表 | 个税计算 | 实时汇率查询换算 | 经典小工具 | 汉字简繁转换 | 普通单位换算 | 公制单位换算 | 生辰老黄历 | 国内电话区号 | 国家代码与域名缩写 | 文字加密解密 | 元素周期表 | 健康查询 | 世界时间 | 万年历 | 二十四节气 | 汉字横竖排版 | 手机号码查询 | 计算器 | ip搜索
业务联系 | 广告刊登 | 频道合作 | 投稿荐稿 | 联系方式 | 加入收藏 | RSS订阅
Copyright © 2000-2009 www.knowsky.com All rights reserved | 沪ICP备05001343号
ホームページ制作 不動産検索システム 求人情報
防水工事·改修工事 フットサル大会 探偵
SEO対策 中国語教室 ホームページ作成