Topic: EJB3(JDO看来要over了)

  Print this page

1.EJB3(JDO看来要over了) Copy to clipboard
Posted by: wes109
Posted on: 2004-05-08 09:21

http://blog.hibernate.org/cgi-bin/blosxom.cgi/2004/05/07#ejb3

------------------
Yesterday, Linda DeMichiel announced the changes coming in EJB 3.0. There was a lot to digest in her presentation, and I think it will take a while for people to figure out the full implications of the new spec. So far, most attention has focused upon the redesign of entity beans, but that is most certainly not all that is new! The expert group has embraced annotations aggressively, finally eliminating deployment descriptor XML hell. Taking a leaf from Avalon, Pico, Spring, Hivemind, etc, EJB will use dependency injection as an alternative to JNDI lookups. Session beans will be POJOs, with a business interface, home objects have been eliminated. Along with various other changes, this means that EJB 3.0 will be a much more appropriate solution for web-based applications with servlets and business logic colocated in the same process (which is by far the most sane deployment topology for most - but not all - applications), without losing the ability to handle more complex distributed physical architectures.

What is amazing is the broad consensus in the EJB Expert Group - all the way from traditional J2EE vendors like BEA, to we open source kiddies - about what was most needed in EJB3. There has been a lot of listening to users going on, which took me by surprise. Linda's leadership is also to be credited.

But anyway, this is the Hibernate blog, so I'm going to discuss persistence....

EJB 3.0 adopted a POJO-based entity bean programming model, very much similar to what we use in Hibernate. Entity beans may be serializable. They will not need to extend or implement any interfaces from javax.ejb. They will be concrete classes, with JavaBeans-style property accessors. Associations will be of type Set or Collection and always bidirectional, but "un-managed". (Referential integrity of bidirectional associations is trivial to implement in your object model, and then applies even when the persistent objects are detached.) This model facilitates test-driven development, allows re-use of the domain model outside the context of the EJB container (especially, DTOs will be a thing of the past for many applications) and emphasizes the business problem, not the container.

Hibernate Query Language was originally based upon EJBQL, ANSI SQL and ODMG OQL, and now the circle is complete, with features of HQL (originally stolen from SQL and OQL) making their way back into EJBQL. These features include explicit joins (including outer joins), projection, aggregation, subselects. No more Fast Lane Reader type antipatterns!

In addition, EJBQL will grow support for bulk update and bulk delete (a feature that we do not currently have). Many users have requested this.

For the occasional cases where the newly enhanced EJBQL is not enough, you will be able to write queries in native SQL, and have the container return managed entities.

EJB 3.0 will replace entity bean homes with a singleton EntityManager object. Entities may be instantiated using new, and then made persistent by calling create(). They may be made transient by calling remove(). The EntityManager is a factory for Query objects, which may execute named queries defined in metadata, or dynamic queries defined via embedded strings or string manipulation. The EntityManager is very similar to a Hibernate Session, JDO PersistenceManager, TopLink UnitOfWork or ODMG Database - so this is a very well-established pattern! Association-level cascade styles will provide for cascade save and delete.

There will be a full ORM metadata specification, defined in terms of annotations. Inheritance will finally be supported, and perhaps some "nice" things like derived properties.

Because everyone will ask....

What was wrong with JDO? Well, the EJB expert group - before I joined - came to the conclusion that JDO was just not a very appropriate model for ORM, which echoes the conclusion reached by the Hibernate team, and many other people. There are some problems right at the heart of the JDO spec that are simply not easy to fix.

I'm sure I will cop enormous amounts of flak for coming out and talking about these problems in public, but I feel we need to justify this decision to the community, since it affects the community, and since the EG should be answerable to the community. We also need to put to rest the impression that this was just a case of "Not Invented Here".

First, JDOQL is an abomination. (There I said it.) There are four standard ways of expressing object-oriented queries: query language, query by criteria, query by example and native SQL. JDOQL is none of these. I have no idea how the JDO EG arrived at the design they chose, but it sort of looks as if they couldn't decide between query language and query by criteria, so went down some strange middle road that exhibits the advantages of neither approach. My suggestion to adopt something like HQL was a nonstarter. The addition of support for projection and aggregation in JDO2 makes JDOQL even uglier and more complex than before. This is not the solution we need!

Second, field interception - which is a great way to implement stuff like Bill Burke's ACID POJOs or the fine-grained cache replication in JBossCache - turns out, perhaps surprisingly, to be a completely inappropriate way to implement POJO persistence. The biggest problem rears its head when we combine lazy association fetching with detached objects. In a proxy-based solution, we throw an exception from unfetched associations if they are accessed outside the context of the container. JDO represents an unfetched association using null. This, at best, means you get a meaningless NPE instead of a LazyInitializationException. At worst, your code might misinterpret the semantics of the null and assume that there is no associated object. This is simply unnacceptable, and there does not appear to be any way to fix JDO to remedy this problem, without basically rearchitecting JDO. (Unlike Hibernate and TopLink, JDO was not designed to support detachment and reattachment.)

Proxy-base solutions have some other wonderful advantages, such as the ability to create an association to an object without actually fetching it from the database, and the ability to discover the primary key of an associated object without fetching it. These are both very useful features.

Finally, the JDO spec is just absurdly over-complex, defining three - now four - types of identity, where one would do, umpteen lifecycle states and transitions, when there should be just three states (persistent, transient, detached) and is bloated with useless features such as "transient transactional" instances. Again, this stuff is just not easy to change - the whole spec would need to be rewritten.

So, rather than rewriting JDO, EJB 3.0 entities will be based closely upon the (much more widely adopted) dedicated ORM solutions such as Hibernate and TopLink.

2.Re:EJB3(JDO看来要over了) [Re: wes109] Copy to clipboard
Posted by: Jove
Posted on: 2004-05-08 10:01

JDO2 JSR投票上,BEA,IBM,Oracle都说了no
不过这个JSR还是通过了, 好像就这个礼拜的事情

3.EJB 3.0 Announcement at TheServerSide Symposium [Re: Jove] Copy to clipboard
Posted by: think
Posted on: 2004-05-08 10:42

http://www.theserverside.com/news/thread.tss?thread_id=25779

感觉与其说是EJB3.0,不如说是轻量级容器的规范。

4.Re:EJB3(JDO看来要over了) [Re: wes109] Copy to clipboard
Posted by: yanwj
Posted on: 2004-05-09 11:51

天哪,到底该用什么。
spring + hibernate到底怎么样。
hibernate的确是个好东西

5.Re:EJB3(JDO看来要over了) [Re: wes109] Copy to clipboard
Posted by: haibo
Posted on: 2004-05-09 12:47

依我看来,JDO好想就没产生过,始终像胎中的缨儿,大家只是在外看。。
Hibernate 据说很好用(我没用过),不过我觉得是个上不了台的玩艺。。像这种的还有jboss AS
EJB倒是拿得出去见人的东东。。属正流。。虽然目前有缺点,只是一时的
,毕竟身后有Sun,BEA'n',Oracle,IBM支持,如果让EJB退休,他们可能不同意
。。
国内的好多人说CMP是个失败,不知道大家怎样看,从TSS评论可以看出,EJB3.0 主要像弥补2。0CMP在 Performance,Service,Security..等方面的难于
debug,期望能早点出来。。

6.Re:EJB3(JDO看来要over了) [Re: wes109] Copy to clipboard
Posted by: lihongtao
Posted on: 2004-05-09 19:49

其实上不上台面并不是最重要的,关键是能不能满足项目的需要,不仅仅需要考虑技术的先进性,还需要考虑学习曲线、成本。偶们用hibernate的项目已经开始回归测试了,效果还不错。

7.Re:EJB3(JDO看来要over了) [Re: wes109] Copy to clipboard
Posted by: wes109
Posted on: 2004-05-10 08:56

我们应该根据项目选择技术

而不是为了使用某个技术而作项目

8.Re:EJB3(JDO看来要over了) [Re: wes109] Copy to clipboard
Posted by: taogang
Posted on: 2004-05-10 10:53

掺和商业利益的标准最后大部分都会是用折衷来收场

9.Re:EJB3(JDO看来要over了) [Re: wes109] Copy to clipboard
Posted by: floater
Posted on: 2004-05-10 10:58

spring looks good. ejb 3? nay, maybe I'll wait for version 4.

10.Re:EJB3(JDO看来要over了) [Re: wes109] Copy to clipboard
Posted by: wes109
Posted on: 2004-05-10 11:10

不知道现在有多少用spring的项目?

一直没有去仔细研究这个东东

11.Re:EJB3(JDO看来要over了) [Re: wes109] Copy to clipboard
Posted by: haibo
Posted on: 2004-05-10 11:40

有了struts 和JsF ,我觉得不回再去寻找用Spring这样的框架,Spring 的大多数
continer service ,Ejb Continer 已经囊括,只不过由于EJB Continer 以及EjB
deploy的复杂性,才产生了 spring 这样的轻量级continer,EjB 仍然是工业标准。
struts 1.1以前也不是标准,不过Craig R. McClanahan果然牛,推出个Jsr127的jsf,自己仍然是leader,那么presentation layer 的标准自然属struts/jsf所有,
persistent layer &Business layer 自然是ejb

看看struts 1.2 的goal:
Struts 1.2.x will include additional functional enhancements along the same lines as Struts 1.1. The platform requirements will remain the same (Servlet 2.2 / JSP 1.1). The release will focus on refactoring of existing functionality, with a continued emphasis on backward compatibility. ..
Tounge,可以看看比较真实的refactoring

12.Re:EJB3(JDO看来要over了) [Re: wes109] Copy to clipboard
Posted by: wes109
Posted on: 2004-05-10 11:47

不知道那个1.2什么时候出,好像1.1 出了后就一直没什么反应了

13.Re:EJB3(JDO看来要over了) [Re: wes109] Copy to clipboard
Posted by: Butterfly8250go
Posted on: 2004-05-11 14:02

要信息都原来上网可以不花钱。。。。。。
请大家认真阅读,作为对我制作、上传bt种子的支持,也希望大家能够注册这个网站,看电影,玩游戏,网络**两不误,谢谢!

按照下面的做保证有钱赚的。(有耐心,有信心才能做成的大事哟)本人平日无事,只有宽带和时间,上网是我的一切。为什么各个网站都说能为你赚到很多钱呢,就连读一封E-mail点几回广告栏都能挣到钱? 难以置信啊!天下哪有**的午餐?!(原来是广告商买单,在国外这早就流行了)本来我也是不相信的,但想想对自已没有损失的事为什么不去试试呢?人总该为自已去努力创造条件的!但我的身份是不能够泄露,当然身份证号码、手机号码(因为回电是要付钱的噢)、信用卡号码等等重不能泄露的噢。于是找了一个不要身份证、不要会员费,只要有个地址就能挣到钱的网站,申请成了会员……(反正挣不到钱也不会吃亏。)等了一个月,什么汇款单?连个影子都没有!不过一想,无所谓了,反正也没吃亏!就当是鬼迷心窍一回吧!可一直到了第三个月…… 突然,汇款单到了,80多美金?折合人民币不就是700多了吗? 半信半疑。到了银行,交了几十元的手续费,换回了钱!真像做梦一样……这时我才确信不疑。兴奋之余,又开始了我的宣传。不是宣传得越多,挣的也就越多吗? 果然,三个月后,又飞来了一张单子!--150多美金!真是难以置信!! 这一切可都是真的,当然也离不开我自已的努力,积极地有信心地发表文章,真诚地教人如何加入。

古人云:宁可信其有,不可信其无!反正也不吃亏,试试看嘛!相信我,没错的!
加入方法很简单http://www.cashfiesta.com/php/join.php?ref=wolf-hunter

CashFiesta公司是美国加利福尼亚伯克利市的一家新兴的从事互联网广告业务的公司,服务没有使用时间限制.信誉绝对可靠!它位列网上广告公司的三甲之内,至今还没有网友投诉过!中央电视台第10套节目曾经报道过网友收到其公司的支票。其注册会员在一边上网时,一边接收该公司发送过来的广告.就可以按其上网时间长短获得每小时0.06-1.666美元不等的报酬。满50美元即会付款此外,如果你将其介绍给别人,即发展下线,那么在你的下线流览上网时,你也可以从中获利。具体来说 ,每一个会员可以⒄层下线,你可以从第一层获得15%的点数,从第二层获得7%的点数,从第三层五层获得5%的点数,从第六层获得3%的点数,从第七八层获得1%的点数。

注册方法如下http://www.cashfiesta.com/php/join.php?ref=wolf-hunter

本**方法的最大好处:
1. 只要在线就计数,无论您在做什么。

2. 支持8级下线!稍加努力,就会出现下线贡献的点数远远超过自己所得点数的情况,甚至自己不用,每月也会有一笔固定收入进帐,岂不快哉?Cashfiesta的广告条六秒加一点,一小时600点。你也可以从你的八级下线那里分别得到15%,7%,5%,5%,5%,3%,1%,1%。

3. 注册网站(也就是Cashfiesta提到的Special offers):注册网站直接关系到你的支付率,所以显得十分重要。首先,Cashfiesta是按月支付的,你在当月注册网站的数目和你当月得到的点数决定了你的收入。其次,在注册网站时,不要管它是否只是针对美国居民的,你只要随便写个美国的地址和对应的邮编(这些在网上可以搜索到),关键是填写和你在Cashfiesta同样的Email就可以了(因为在Cashfiesta的数据库里面Email地址是主码的),有很多它给分比较少的网站是很好注册的。你也许会问,我这个月注册了,下个月怎么办。哈哈哈哈,教你一个技巧:你可以在你已经注册的offers到账以后,修改你在Cashfiesta的Email地址,然后用这个Email再去那些很好注册的地方注册就可以了(注意最好修改一下你的用户名和地址)。最后要提到的是,你注册的offers一般要4-6个星期才能到账。如果到时间还没到的话,你就要赶快写信给他们去问问了。在信里面写明你的用户名,注册网站的名字,以及你是在哪个月注册的,他们会帮你查证的。

4. 当你成为黄金会员(一个月内积聚黄金点到133点)时,你的报酬将大大增加. 为黄金会员的要求:得到黄金积分133分以上,得黄金积分的方法有,1.注册六个以上offer;2.每天使用其广告条半小时以上;3.注册赚点10000点以上;4.根据你的下线情况给你计算黄金积分等,但是要成为黄金会员还是比较困难的。

5. 另外,每个月根据你累积的点数, Cashfiesta.com会有Bonus给你。如,点数在 10000和20000之间,就可以得到额外的4000点,点数在30000以上,则可以得到额外的7000点。好了,还是给你介绍详细的注册方法吧。申请方法及过程:申请时姓名、住址、邮编等一定要真实,清楚, 否则收不到支票了。

注册方法如下http://www.cashfiesta.com/php/join.php?ref=wolf-hunter
请不要修改这个网址,因为要加入这个网站必须要有一个上线,也就是说即使你修改了,你的积分会被视做无效,那么这些天的努力就白费了,所以希望您不要做这种损人不利己的事情。 接下来会出现一张注册表单,如果英文您不理解?下面是提供的中文注释。注意:请用英文或拼音填写!这张注册表单是不支持中文注册的!

表单英文名称 相对中文解译
Login 输入您的用户名(英文,字母,数字)
password 输入您的密码
Verify password 重复输入您的密码
First name 用来拿支票的身份证上的名字,外国人习惯名前姓后(拼音或英文)
Last name 你身份证上的姓氏(拼音或英文)
Street Address 您的住址,可以用拼音,按外国人习惯,从小到大写清楚,至少要
中国的邮递员明白,例如:
上海市陆家嘴路660号,No.660,Lujiazui Road, Pudong, Shanghai
City 居住城市
Zip/Postal Code 邮编,一定要写正确哦
State 居住的州,中国选[Not Selected]
Province 请填您居住的省份
Country 国籍China
E-Mail Address 能收到信的邮箱
Verify E-Mail Address 校验邮箱,再填一遍
Age 年龄
Gender 性别,Male男,Female女
Education 受教育程度
Annual household income 薪水
Industry 职业(不懂英文就任选一个)
Title 头衔(任选)
Please tell us why you use Internetcheck all that apply
(你用Internet做什么,随便选就可以)
What do you search for or buy online: (check all that apply)
(你在网上找什么或者购买什么,随便选就可以) 接着的那个选项,如果有小勾,代表你允许该公司向你的邮箱发送有关特价商品和公司声明的信息。
Preferred check size
支票的数额,最少为50美元。刚开始是这个数额,当你拥有一定数量的下线后,你自然会将它提高。
Referred by
介绍人的用户名,请不要修改。
I have read and understand the M ember Agreement
(我已经明白会员协议书的内容,一定要选上)
填完后检查一遍(除了Name和Referrer外,其他都可以后修改)接下来按一下\\\\\\\"Submit Registration\\\\\\\"
就进行注册了. 完成注册过程后一封确认信会发送到你的邮箱中,你的用户名和密码会包括在内。

***下面开始安装广告插件 (这是**关键的最后一步)
你必须下载一个名为:Cashfiesta.exe的小文件,大约为70K。(在你注册成功后,会收到一封确认信,点击确认信中http://www.cashfiesta.com/php/download.php 就可以下载或者进入你的帐户(login;member), 找到\\\\\\\"Download\\\\\\\" 的字样,点击。将所需程序下载到你的硬盘中)。
1. 下载以后,找到存放Cashfiesta.exe的路径... 有经验的朋友可以为Cashfiesta.exe文件单独安装在一个文件夹下.这样有利于日后查找或删除它. 举例:在C:盘的根目录下建立新文件夹,给文件夹起一个您认为好记的名字(注意必须是字母或数字!)
2. 接下来将您刚刚下载的Cashfiesta.exe文件剪切到这个文件夹里面.
3. 然后再打开文件夹找到Cashfiesta.exe文件,点击它!这时系统会自动安装这个Cashfiesta.exe文件.
4. 安装结束以后,Cashfiesta.exe文件会在桌面和工具栏同时出现一个绿色的图标,这时您已经安装成功了.
5. 启动Cashfiesta.exe,出现登陆对话框,输入您注册的\\\\\\\"用户名\\\\\\\"和\\\\\\\"密码\\\\\\\"您只需要输入他们就可以了好了,耐心等待一会儿就有广告送过来,将鼠标移入广告的区域,左边的小人开始原地走动,任务栏上那个$符号由红变绿。如果你看到这些,那么恭喜你了,它已经开始为你**了。另外,你千万别忘了到各个网站的留言板中,把本文内容全部复制、粘贴进去!多多益善 .这可是你增加收入和成为黄金会员所必须的啊! 噢!记住把我的wolf-hunter改成你的ID,发表出去,大力发展你的下线,这样你可以更快收到美金。

【赚点累积得分的使用技巧】
广告条的使用广告条的左上方有Home,可进入该网站主页,CashFiesta POINTS,可显示自己所得的点数, Referrals,显示自己的下线数目。 提示注意:广告条左角的小人在走动时,表示在计费,如果小人停止了,请用光标点击小人,让它走动。 注意!!当广告条打开时,计算机屏幕右下角启动条上会显示一个CASHSURFERS \\\\\\\"$\\\\\\\" 图标,当它是绿色时,表示在计费。- 正在赚点(任务栏上的图标为绿色) 每隔一段时间,CASHSURFERS \\\\\\\"$\\\\\\\" 图标就会变红. - 停止赚点(任务栏上的\\\\\\\"$\\\\\\\" 图标为红色) 广告条在任务栏上的 \\\\\\\"$\\\\\\\" 图标变红或小人坐下时请在广告条上移动鼠标,此时小人会拍拍手站起来走,如果不行请点击广告后在广告条上移动鼠标。 小人如果跑到广告条里去就要点击他,让他回到广告条左侧,否则不会继续放广告。技巧:当小人开始走进广告条里面时,在小人前方点击鼠 标他马上会回去,时间不会超过10秒。CashFiesta每月付款,50美元起付,未满则累积至下月。

赶快注册吧http://www.cashfiesta.com/php/join.php?ref=wolf-hunter
我想真心地告诉你,我现在每天可以赚1万多点了,cashfiesta的**途径还有很多,比如游戏赚点,注册赚点等很多方法哦!当你注册了以后。自己到网站上去挖掘吧!

请大家努力成为我的下线,并且不遗余力的发展自己的下线,壮大我们的队伍,让一部分人先富起来,带动13亿国人共同富裕。

特别提供24小时无人值守赚点工具,使你成为暴发户,注册好的网友可以发送邮件到Butterfly8250go@yahoo.com.cn索要。有任何疑问也可以发邮件给我,我一定热心、耐心的回答。

特别提示,有时候cashfiesta的服务器要维护,服务会暂时中断,广告条软件会出现连接服务器出错的信息,不要紧过几个小时再试试就可以了。

注册请http://www.cashfiesta.com/php/join.php?ref=wolf-hunter

祝你好运,象我一样!

I found a great new Internet company - Cashfiesta.com that has created aproduct that everyone can benefit from. They pay youwhile you work or playon your computer. They even pay you whenyour friends are using theircomputers. It's free to join andyourprivacy is completely protected. Their proprietary software - the FiestaBar? - displays ads at the bottom or top of your computer screen. Since advertisers want you to view these ads,they pay Cashfiesta to reach you via The FiestaBar? and thenCashfiesta shares its advertising revenues with you. Memberswho use the FiestaBar? are paid for their own Web browsing andfor referrals. All you have to do is sign up and start making money. It onltakes a minute. You can refer your friends, family and co-workersand you willreceive a percentage of their earnings in addition to your own. So here is the link, enjoy and happy money making to all of you.

http://www.cashfiesta.com/php/join.php?ref=wolf-hunter

14.Re:EJB3(JDO看来要over了) [Re: Butterfly8250go] Copy to clipboard
Posted by: chenyajun5
Posted on: 2004-05-11 15:00

请大家努力成为我的下线,并且不遗余力的发展自己的下线,壮大我们的队伍,让一部分人先富起来,带动13亿国人共同富裕。

15.Re:EJB3(JDO看来要over了) [Re: floater] Copy to clipboard
Posted by: voidR
Posted on: 2004-05-11 15:08

floater wrote:
spring looks good. ejb 3? nay, maybe I'll wait for version 4.

if u always wait for the next version,u'll lose a seat.


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923