论坛首页 Java企业应用论坛

TOB - An ORM Replacement Unleashes Real Power Of Java OO Per

浏览 24141 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2006-11-24  
partech 写道
用户名是ddddd,密码是什么? unchanged or [unchanged] 都登录不上 ddddd GpjJDENh 也不对


http://www.webofweb.net/reset.jsp
0 请登录后投票
   发表时间:2006-11-24  
partech 写道
有比较才知道好在哪里。
再美丽的闪电,最终都要亲吻大地。
作了实际点的示例出来吧,比如就拿springside里面的bookstore,看看你这个TOB是如何处理的。

TOB 版 BookStore 的持久模型, 按以下步骤编译运行:

如果还没有JDK 5, 从 SUN 网站下载一个安装

如果还没有Eclipse (最新是3.2, 至少要3.1, 以便支持Generics, Annotation), 从 eclipse.org 下载一个. 因为最新的JDK 1.5.0_09 的 javac 编译 TOB 生成的代码也会 crash, 所以只能通过eclipse编译.

从 http://www.ableverse.com/download-free.jsp 下载TOB, 获得 av5base.jar 和 av5tob.jar 以及 freemarker-2.3.4.jar

从 http://www.h2database.com 下载 H2, 获得 h2.jar

将附件 zip 文件导入为一个eclipse项目, 修改项目属性, 改正引用的外部 jar 文件路径.

两个方法来编译这个项目:

1. 设置系统环境变量 JAVA_HOME 指向JDK 5的安装目录(或者修改项目根目录的 run-apt.bat, 在所有语句之前加上 set JAVA_HOME=xxx), 双击执行项目根目录的 run-apt.bat, 完成以后再在Eclipse里选中项目, 选 Project->Clean菜单.

2. 下载Apache Ant 1.7.0 (目前最新是1.7.0RC1)或者更新的版本以支持 apt 任务. 在Eclipse里调出 Run->External Tools 对话框(如果没有出现 av5patterns build.xml 条目, 说明你的eclipse版本比较老, 最好升级一下) 选中 av5patterns build.xml 这个条目, 在右边的Classpath选项卡下修改Ant Home, 然后执行. 或者你自己想办法让项目根目录的 build.xml 在有eclipse jdtCompiler的Ant 1.7.0 环境中执行.

编译好以后可以运行 tob.bookstore.Test 类.

修改 meta\tob.meta 配置不同的数据库参数.
  • av5patterns.zip (13.2 KB)
  • 描述: 包含BookStore的TOB Patterns
  • 下载次数: 10
0 请登录后投票
   发表时间:2006-11-24  
aardvark 写道
I don't understand you, man. There's already a standard in the field, and more importantly it is much better than your way. You are playing a one player game under a private rule, while the rest of the players in the world are playing another game together, under a public rule, which is called STANDARD.

JDO works with POJO!! Don't you understand what that means? There's no, or at least low dependency, between the client application and the persistence layer. I really don't wanna bring up any argue with anybody, but I do feel sad when I see somebody walking down the wrong way. I have to say you are wasting your talent, your effort, your time! You may feel proud of it while the world won't buy it!

I'm sorry!

为啥老是有人把TOB和JDO比较呢,TOB是号称ORM Replacement呀!JDO/Hibernate/EJB3这些土家伙,完全是戴着R-Database概念的镣铐在跳舞,TOB是Object Relationship Management In Java, 比Object-Relational Database Mapping的概念要先进N个generation呢!
0 请登录后投票
   发表时间:2006-11-24  
aardvark 写道
I don't understand you, man. There's already a standard in the field, and more importantly it is much better than your way. You are playing a one player game under a private rule, while the rest of the players in the world are playing another game together, under a public rule, which is called STANDARD.

JDO works with POJO!! Don't you understand what that means? There's no, or at least low dependency, between the client application and the persistence layer. I really don't wanna bring up any argue with anybody, but I do feel sad when I see somebody walking down the wrong way. I have to say you are wasting your talent, your effort, your time! You may feel proud of it while the world won't buy it!

I'm sorry!


You can't understand me just as you can't understand the existence of true Object Oriented Persistent Models, JDO and other OODBs nowadays just refuse to admit that there are *Relations* exist to connect objects. They, seems including you, think object topograph is plain, just as C data structures or their OO versions - POJOs. But in fact it is not, that's why OODBs, including JDO/ORM can not walk out of the shadow under Relational Databases.

Keep an eye on TOB, it will start a new generation of database sofwares.
0 请登录后投票
   发表时间:2006-11-24  
关系型数据库的数据模型大学时候也有过一点学习,这种OO的数据库模型是怎么样的呢,凡是计算机的东西都需要数学来支撑的吧,就这样大家说来说去,俺也不知道他的数学理论是怎么样的呢,难道能脱得了关系模型的关系吗?各位大侠给点学习的连接吧
0 请登录后投票
   发表时间:2006-11-24  
edge_hh 写道
楼主,
tob没有文档,没有源代码,我只能揣测。

与o/rm+rdb的组合相比,tob+rdb组合的区别,
我这么理解对不对?
1。tob不需要我建表,它在后面自动替我建了。也就是说我只需领域建模,不需要数据建模,完全oo。
2。建立领域模型后,tob根据annotation运行时帮我生成class?
3。持久化是自动的,query是使用原生sql?

其它还有乱七八糟的很多疑问。

楼主有时间能写篇tutor最好,最起码把tob的那些annotation的含义说清楚。。

使用说明很重要。

楼主,我刚看到tob,很感兴趣。

现有的文档确实比较少, 也只有英文的:

http://tob.ableverse.org
http://www.ableverse.org/apidoc/index.html?av/tob/package-summary.html
http://www.ableverse.org/tutorials/tob/

我正在写另外一个产品的教程, 完了以后马上就是TOB的了.

最新的 Ableverse 软件包(包括TOB在内)附有 TOB RDB Family SwapEngines 的源码, 可以参考.

前面我发了包含 av5patterns.zip 的帖子, 这个可能是最直接最简单的上手教程, 我觉得 Pattern Based Learning 会轻松舒服一些, 以后会陆续的加各种情况的Model Pattern.

关于你的问题:

1. 是的, 情况是这样. 只要编你的java程序, 编译正常, 运行的时候TOB会自动调整数据库表结构.
2. TOB是在编译时生成class.
3. 是的, TOB自动为持久类生成SQL查询条件类, 这样对于数据库列和JOIN列的引用都是通过生成的Java常量进行的, 可以帮助部分检查SQL语法.

你可以看看 av5patterns 里的, tob.contact.User 类, 和 tob.bookstore.Test 类, 里面都有查询的语法示例. 同时看看 __generated_src 下面生成的那些类, 很多问题会不言自明.
0 请登录后投票
   发表时间:2006-11-24  
TheRelation和TheObject有何异同?
0 请登录后投票
   发表时间:2006-11-24  
jianfeng008cn 写道
关系型数据库的数据模型大学时候也有过一点学习,这种OO的数据库模型是怎么样的呢,凡是计算机的东西都需要数学来支撑的吧,就这样大家说来说去,俺也不知道他的数学理论是怎么样的呢,难道能脱得了关系模型的关系吗?各位大侠给点学习的连接吧


TOB的 Object/Relation/Kin Model 是对 Peter Chen 30 年前提出的 Entity/Relation Model 的直接扩充, 主要解决了在RAM大小允许的情况下, 由系统自动维护通过 Relation 的直接物理连接问题.

以磁盘为主体的ER数据库系统中, 数据记录(Record)之间是在逻辑级别上关联起来的, 通过JOIN查询进行遍历.
TOB是以内存为主体的ER数据库系统, 对象(Object)之间通过Relation建立的联系可以存在物理连接, 并且这些连接是系统维护的. Kin就是藉由持久关系而存在的引用关系, 所不同于程序里直接引用的是, 当Kin所藉由的关系对象发生改变, 被创建或者删除时, Kin也应当跟着改变. 而这样的一致性目前没有数据库系统是设计去自动维护的, 除了TOB.

这是个创新的东西, 目前还没见有其他类似的资料文章发表.
0 请登录后投票
   发表时间:2006-11-24  
partech 写道
TheRelation和TheObject有何异同?


TheRelation有一个 Role<T extends TheObject> 的内嵌类, 这是为了持久关系用以继承它而定义 Tie 的, 只有TheRelation的子类能定义 Role 的子内嵌类, 从而用这个类型去定义 Tie

Tie 可以理解为一个关系对象它藉以自身的存在所维护的一个相关性的其中一方(一元).

所以有一个Tie的 TheRelation 子类就是单元关系, 有两个Tie的是二元关系, 三个的是三元关系, 如此类推, 可以无限复杂下去. 当然日常情况下四元以上的多元关系就很少见了.

比如亲子关系这个三元关系, 一个Tie是父亲, 一个Tie是母亲, 一个Tie是孩子. 这三者在亲子关系里缺一不可.
0 请登录后投票
   发表时间:2006-11-24  
complystill 写道
aardvark 写道
I don't understand you, man. There's already a standard in the field, and more importantly it is much better than your way. You are playing a one player game under a private rule, while the rest of the players in the world are playing another game together, under a public rule, which is called STANDARD.

JDO works with POJO!! Don't you understand what that means? There's no, or at least low dependency, between the client application and the persistence layer. I really don't wanna bring up any argue with anybody, but I do feel sad when I see somebody walking down the wrong way. I have to say you are wasting your talent, your effort, your time! You may feel proud of it while the world won't buy it!

I'm sorry!


You can't understand me just as you can't understand the existence of true Object Oriented Persistent Models, JDO and other OODBs nowadays just refuse to admit that there are *Relations* exist to connect objects. They, seems including you, think object topograph is plain, just as C data structures or their OO versions - POJOs. But in fact it is not, that's why OODBs, including JDO/ORM can not walk out of the shadow under Relational Databases.

Keep an eye on TOB, it will start a new generation of database sofwares.


Correct me if I'm wrong:

JDO is just an API, it doesn't define the technology underneath, right? It supports, but is not limited to, ORM or any other persistence technology. You can still use OODB behind the API.

To me persistence of POJOs doesn't mean "object topograph is plain", it means you can persist any object, not just subclass of specific class. This means a lot to me, and to a lot of other developers.

By the way, could you explain "object topograph is plain" a little bit? How is TOB better in object topograph?
0 请登录后投票
论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics