<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    JAVA—咖啡館

    ——?dú)g迎訪問(wèn)rogerfan的博客,常來(lái)《JAVA——咖啡館》坐坐,喝杯濃香的咖啡,彼此探討一下JAVA技術(shù),交流工作經(jīng)驗(yàn),分享JAVA帶來(lái)的快樂(lè)!本網(wǎng)站部分轉(zhuǎn)載文章,如果有版權(quán)問(wèn)題請(qǐng)與我聯(lián)系。

    BlogJava 首頁(yè) 新隨筆 聯(lián)系 聚合 管理
      447 Posts :: 145 Stories :: 368 Comments :: 0 Trackbacks
    JDO的優(yōu)點(diǎn):
      
      ● JDO的生命周期狀態(tài)機(jī)(lifecycle state machine)是正確的用法。任何其它的O/R映射工具都應(yīng)該使用JDO的生命周期或者它的子集(例如:如果不支持事務(wù))。記住,JDO生命周期是為JDO實(shí)現(xiàn)服務(wù)的。大部分用戶不需要了解其中很復(fù)雜的內(nèi)幕。網(wǎng)頁(yè)Amber生命周期中有些圖示。
      
      ● PersistentManager API對(duì)如何管理JDO對(duì)象的狀態(tài)有一定的優(yōu)勢(shì)和價(jià)值。
      
      JDO的缺點(diǎn):
      
      ● 查詢(query)支持不完全。它應(yīng)該使用類似Hibernate的HSQL查詢語(yǔ)言,并使用java.sql.ResultSet作為查詢結(jié)果。
      
      ● 用于重載方法的字段擴(kuò)展讓人覺(jué)得比較混亂。最好使用類似Hibernate或者EJB/CMP的方法,并重載它們。
      
      Hibernate的優(yōu)點(diǎn):
      
      ● 有著正確的數(shù)據(jù)模型。以POJO為基礎(chǔ)的模型是個(gè)正確的方向。
      
      ● 可配置性(例如對(duì)象之間的關(guān)系)是個(gè)很好的基礎(chǔ)。
      
      ● HSQL正是O/R映射語(yǔ)言應(yīng)該有的。
      
      ● 有著完整的API
      
      ● 采用簡(jiǎn)明的Session類作為控制流的清洗器,因?yàn)樗赜昧薈onnection的模型
      
      Hibernate的缺點(diǎn):
      
      ● 沒(méi)有使用JDO生命周期,這是不正確的做法。
      
      ● API(例如查詢)還是有點(diǎn)混亂。It's better than the alternative, but using java.sql.ResultSet as the foundation would clean it up.
      
      ● API如果作為一個(gè)規(guī)范的話,還是不夠干凈。例如,在使用查詢參數(shù)(query parameters)時(shí),存在一些應(yīng)用漏洞。
      
      ● 我不認(rèn)為使用類名作為表的標(biāo)識(shí)是件好事。
      
      EJB/CMP的優(yōu)點(diǎn):
      
      ● 采用工廠類(指Home)查找實(shí)例比向Session/Connection對(duì)象傳遞參數(shù)獲取實(shí)例要好。
      
      ● ejbSelect跟上面說(shuō)的類似。
      
      ● 查詢名稱使用abstract schma是一個(gè)很好的解決方案。
      
      ● 理論上來(lái)說(shuō),這種模式在某些方案中可以有更好的復(fù)用性。
      
      EJB/CMP的優(yōu)點(diǎn):
      
      ● CMP不屬于EJB規(guī)范。它并不是個(gè)合適的模型去實(shí)現(xiàn)這個(gè)目的。已經(jīng)沒(méi)有合適的(例如非官方)借口去讓EJB3.0中保留CMP。
      
      Amber優(yōu)點(diǎn):
      
      ● 使用JDBC ResultSet和PreparedStatement做查詢
      
      出于某些原因,O/R映射工具通常拋棄強(qiáng)大的ResultSet和PreparedStatement API,而創(chuàng)建自己一套并不是很合適的替代品。O/R查詢器應(yīng)該使用一個(gè)外部的SQL(例如HSQL)作為查詢語(yǔ)言,并使用ResultSet作為結(jié)果集,使用PreparedStatement處理查詢參數(shù)。可以增加其它的API作為查詢子集,就像查詢一個(gè)單獨(dú)的實(shí)體,但應(yīng)該使用ResultSet和PreparedStatement作為基礎(chǔ)。
      
      Amber缺點(diǎn):
      
      ● Amber的研究?jī)r(jià)值遠(yuǎn)大于它的使用價(jià)值
      
      原文內(nèi)容:
      
      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.
    posted on 2008-05-27 10:20 rogerfan 閱讀(353) 評(píng)論(0)  編輯  收藏 所屬分類: 【JDO學(xué)習(xí)】
    主站蜘蛛池模板: 亚洲成熟xxxxx电影| 在线亚洲精品自拍| 亚洲一区二区三区精品视频 | 亚洲校园春色小说| 久久WWW免费人成一看片| 亚洲综合久久综合激情久久| 99久久免费中文字幕精品| 亚洲av中文无码乱人伦在线咪咕| a毛看片免费观看视频| 亚洲av无码精品网站| 99久久99久久精品免费观看| 亚洲精品国产第1页| 免费影院未满十八勿进网站| 亚洲国产日韩视频观看| 免费毛片在线播放| eeuss影院www天堂免费| 国产亚洲精品xxx| 永久免费视频网站在线观看| 国产成+人+综合+亚洲专| 蜜桃精品免费久久久久影院| 产传媒61国产免费| 亚洲AV中文无码乱人伦下载| 亚洲视频免费一区| 一本色道久久88亚洲精品综合| 国产在线不卡免费播放| 一级特黄录像免费播放肥| 亚洲好看的理论片电影| 毛片a级毛片免费播放100| 五月天婷婷免费视频| 久久亚洲私人国产精品| 免费精品一区二区三区在线观看| 乱淫片免费影院观看| 7777久久亚洲中文字幕蜜桃 | 亚洲综合精品成人| 免费在线黄色网址| 99re6热视频精品免费观看| 亚洲高清毛片一区二区| 亚洲av色影在线| 日本免费无遮挡吸乳视频电影| 国产一精品一av一免费爽爽| 国产亚洲福利在线视频|