哪位大佬有空来谈一下objectspace是个什么东东?

xupc 2003-11-03 11:25:38
好像是以后的一个主流东东,俺不清楚耶,有谁来说一说。
...全文
154 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
BossFriday 2003-11-06
  • 打赏
  • 举报
回复
学习
chegan 2003-11-06
  • 打赏
  • 举报
回复
好贴就得顶
softye 2003-11-04
  • 打赏
  • 举报
回复
好贴就得顶
xupc 2003-11-04
  • 打赏
  • 举报
回复
老大们,别老是把别人的东西copy过来行不。
我是想有哪位真正用过的,来谈谈自已对它的认识。
liduke 2003-11-04
  • 打赏
  • 举报
回复
2、OlyMars 是个免费的工具,全称是SQL Server Centric .NET Code Generator
但当前.net社区中对其的评价是普遍不好,认为其难以使用(主要是模板的学习有坡度和曲线),哈哈,就像我的ActiveContent。

对于微软是否公开以微软的名义发表这个工具,大部分人持反对的看法


地址:http://www.microsoft.fr/olymars/webupdate.xml



posted @ 2003-4-18 21:54:44 | comments
介绍一些 Orm 工具

最近,orm工具是.net 中一个讨论较多的话题,orm对.net非常重要,因为在.net或是在微软的环境中,还没有类似j2ee entity bean的东西。


EntityBroker


http://www.thona-consulting.com/
无api文档,尚在beta ,通过Attribute来定义map,缺少与objectSpaces对应的map文件,据EntityBroker的开发者说,这也是他的目标


EntityManager.Find 看起来很快,实际上它不并组装对象,所以如果你绑定ObjectList到一个DataGrid时将非常的慢


ObjectSpace 的GetObjects慢,但它组装全部对象,所以将ObjectSet绑定到DataGrid很快


在有7000多条记录的数据表中,GetObjects需要20多秒,而Find只要2秒,使用SqlDataAdapter.Fill方法则不到1秒


在EntityBroker中数据表中必须有OID,和ObjectVersion字段 OID是Guid而ObjectVersion为int


EntityBroker的查询机制相对比ObjectSpaces要完善



ObjectZ.Net

http://www.mongoosesolutions.com/mg/

非free,没有仔细研究,待以后补充


非常关心的开源项目 NHibernate
http://sourceforge.net/projects/nhibernate


nhibernate 是模拟java hibernate 的.net实现,当前在.net社区中,对其寄于厚望


posted @ 2003-4-18 21:53:15 | comments
Microsoft ObjectSpaces

objectspaces是个orm 工具,这个orm应该是object-relational mapping 而不是object rule modal,其主要目的就是为了简化数据库和对象之间的映射。连接 http://groups.msn.com/objectspaces


objectspaces类似于jdo(jdo是java的一个orm工具),在pdc版本中,提供了XmlObjectSpace 和SqlObjectSpace两个类,支持xml或是Sql Server。

从技术角度来说,objectspaces建筑于ado.net之上(同jdo建筑在jdbc之上一样)一样,使用map文件来映射对象和数据库的关系。



<map xmlns="http://www.microsoft.com/ObjectSpaces-v1">
<type name="Customer" dataSource="customers" source="s">
<uniqueKey name="Id" mappedBy="autoIncrement" dataSource="CustomerId" />

<property name="Name" dataSource="ContactName" />
<property name="Title" dataSource="ContactTitle"/>
<property name="Company" dataSource="CompanyName"/>
<property name="Phone" dataSource="Phone"/>
<property name="Fax" dataSource="Fax"/>

<method name="GetRandomOrder" userAssembly="Customization.dll" userClass="Customizer" />
</map>

在这个map文件中,type tag中的name是objectspaces中的对象,datasource 则是数据库表名,而source则是数据源map文件中定义的数据源

property或是uniqueKey对应一个字段或是关键字字段。大家可以看到uniqueKey中的mappedBy被设置为autoIncrement,意味着是sql server的identity或是access中的自动计数字段。当然,mappedBy还有guid、user或是custom等多种方式。dataSource则是实际的字段名。

大家可以粗略看出这种定义方式非常灵活,因为在设计初期,数据库会经常改变,这种定义方式,可以减少对源代码的改动。

使用objectspaces可以大大简化你的数据库存储代码,其实objectspaces的原则就是让你:

不使用 sql 语言
不使用存储过程
在objectSpaces中,数据库操作(新增、删除、更新、查询)被简略成CreateObject,Delete,Update(UpdateAll),getobject(getObjects)等几个方法,下面以一个实例来介绍。

如一个Customer(客户) 对象,其可能有Id(编号),Name( 名称),Address(地址)等属性
注:代码中的os是ObjectSpace的一个实例


定义对象
public abstract Customer
{
[UniqueId]
public abstract Int32 Id{get;set;}
public abstract String Name{get;set;}
public abstract String Address{get;set;}
public void OnCreate(Int32 ItemId,String ItemName,String ItemAddress)
{
this.Id=ItemId;
this.Name=ItemName;
this.Address=ItemAddress;
}
}

查询对象
GetObject
GetObjects


GetObject返回单一对象,GetObjects返回对象的集合(ObjectSet)
查询使用的是(OPath,ObjectPathLanguage),也就是使用对象.属性的方式进行查询,查询根据编程语言的不同而不同,如C#用==表示是否相等而vb.net则用=
c=os.GetObject(typeof(Customer),"Id==1");
注:(在pdc版本中,like 操作还未被支持,正式版中会支持这个操作,而且,从新闻组的一些文字上来看,这个特性已经被实现)


objectSpace使用如下方式进行新增,删除、更新操作


新增对象
CreateObject


Customer c=os.CreateObject(typeof(Customer),1,"jjx","浙江省")


删除对象
DeleteObject


更新
Update 更新某个对象
UpdateAll 更新全部对象


objectSpaces中的对象定义可以自行扩展,以加入各种商业逻辑。请大家参阅帮助文件。



老早就听到过这个东西,但没有找到,这次在fabrice's 的webblog(http://dotnetweblogs.com/FMARGUERIE/)中发现了这个连接(http://groups.msn.com/objectspaces)


现在的objectspaces还是最早的pdc preview版本,在浏览了新闻组和其它网站的一些消息后,确定这将是一个不会发表的产品,不过objectspaces 将会融合在.net 2.0中,来源如下

Latest Update on Microsoft ObjectSpaces
Wednesday, October 02, 2002 9:14 PM
According to Guang-an Wu who works for the company, Microsoft have utilized the feedback received via newsgroups and through customer meetings to improve ObjectSpaces further. Currently, ObjectSpaces is being developed as a part of the next major .NET framework release.
Stay tuned for further announcements at the PDC next year.


Since the component is still under development, many of the details are still being decided and are not yet available for public release. However, here are some of the highlights, with the usual caveat that all details are subject to change without further notice. And Additional details beyond these highlights are not available at this point for release.


Unlike the PDC 2001 Technology Preview, classes don't need to be abstract. The goal is to make ObjectSpaces available for all .NET objects.
The foundation is a better optimized streaming model for fast retrieval of objects.
Key features like simplicity of OPath queries for retrieving objects, choice of span or delay loading are being enhanced and improved.
More sophisticated support is planned for inheritance and advanced mapping between classes and one or more tables.
Further, tools support for application development lifecycle is in the works.




虽然objectspaces只是个预览产品,但其特征非常丰富,我非常喜欢其基于map文件的特性,这是 ado.net的TableMappings集合的文件化,使你在改动数据库(如改变字段名时)不必改动代码。


缺点
1、对象查询速度
我做了一下测试,查询一个8000条的包含7个属性的对象需要20秒
2、绑定
ObjectSet实现支持ICollection和支持IBindingList,因此支持绑定
类自己定义,需要自己实现IEditableObject,IDataErrorInfo来完美的支持.net数据绑定


约定
在OjbectSpace中
对象的UniqueId属性是必须的,当在进行OPaht查询时需要使用

liduke 2003-11-04
  • 打赏
  • 举报
回复
1、为了使采用Java编写的后端服务更容易被用户接受,ObjectSpace
日前发布了一种可以使Java和XML之间的结合变得更加容易的免费工具。
ObjectSpace将对自己的Voyager应用程序服务器进行功能扩充,允许
应用程序开发者通过混合和匹配远程服务来创造应用程序。而这个名
为“Dynamic XMLa 1.0 for Java"的免费工具则是这一发展战略的关
键部分,因为它允许任何支持XML的工具或应用程序去调用Java编写
的远程服务。

pp4u 2003-11-04
  • 打赏
  • 举报
回复
关注
Edifier0709 2003-11-03
  • 打赏
  • 举报
回复
关注。。。。
duibudui 2003-11-03
  • 打赏
  • 举报
回复
!
laogao 2003-11-03
  • 打赏
  • 举报
回复
强烈关注.
softye 2003-11-03
  • 打赏
  • 举报
回复
Microsoft ObjectSpaces
objectspaces是个orm 工具,这个orm应该是object-relational mapping 而不是object rule modal,其主要目的就是为了简化数据库和对象之间的映射。连接 http://groups.msn.com/objectspaces


objectspaces类似于jdo(jdo是java的一个orm工具),在pdc版本中,提供了XmlObjectSpace 和SqlObjectSpace两个类,支持xml或是Sql Server。

从技术角度来说,objectspaces建筑于ado.net之上(同jdo建筑在jdbc之上一样)一样,使用map文件来映射对象和数据库的关系。



<map xmlns="http://www.microsoft.com/ObjectSpaces-v1">
<type name="Customer" dataSource="customers" source="s">
<uniqueKey name="Id" mappedBy="autoIncrement" dataSource="CustomerId" />

<property name="Name" dataSource="ContactName" />
<property name="Title" dataSource="ContactTitle"/>
<property name="Company" dataSource="CompanyName"/>
<property name="Phone" dataSource="Phone"/>
<property name="Fax" dataSource="Fax"/>

<method name="GetRandomOrder" userAssembly="Customization.dll" userClass="Customizer" />
</map>

在这个map文件中,type tag中的name是objectspaces中的对象,datasource 则是数据库表名,而source则是数据源map文件中定义的数据源

property或是uniqueKey对应一个字段或是关键字字段。大家可以看到uniqueKey中的mappedBy被设置为autoIncrement,意味着是sql server的identity或是access中的自动计数字段。当然,mappedBy还有guid、user或是custom等多种方式。dataSource则是实际的字段名。

大家可以粗略看出这种定义方式非常灵活,因为在设计初期,数据库会经常改变,这种定义方式,可以减少对源代码的改动。

使用objectspaces可以大大简化你的数据库存储代码,其实objectspaces的原则就是让你:

不使用 sql 语言
不使用存储过程
在objectSpaces中,数据库操作(新增、删除、更新、查询)被简略成CreateObject,Delete,Update(UpdateAll),getobject(getObjects)等几个方法,下面以一个实例来介绍。

如一个Customer(客户) 对象,其可能有Id(编号),Name( 名称),Address(地址)等属性
注:代码中的os是ObjectSpace的一个实例


定义对象
public abstract Customer
{
[UniqueId]
public abstract Int32 Id{get;set;}
public abstract String Name{get;set;}
public abstract String Address{get;set;}
public void OnCreate(Int32 ItemId,String ItemName,String ItemAddress)
{
this.Id=ItemId;
this.Name=ItemName;
this.Address=ItemAddress;
}
}


查询对象
GetObject
GetObjects


GetObject返回单一对象,GetObjects返回对象的集合(ObjectSet)
查询使用的是(OPath,ObjectPathLanguage),也就是使用对象.属性的方式进行查询,查询根据编程语言的不同而不同,如C#用==表示是否相等而vb.net则用=
c=os.GetObject(typeof(Customer),"Id==1");

注:(在pdc版本中,like 操作还未被支持,正式版中会支持这个操作,而且,从新闻组的一些文字上来看,这个特性已经被实现)


objectSpace使用如下方式进行新增,删除、更新操作


新增对象
CreateObject


Customer c=os.CreateObject(typeof(Customer),1,"jjx","浙江省")


删除对象
DeleteObject


更新
Update 更新某个对象
UpdateAll 更新全部对象


objectSpaces中的对象定义可以自行扩展,以加入各种商业逻辑。请大家参阅帮助文件。



老早就听到过这个东西,但没有找到,这次在fabrice's 的webblog(http://dotnetweblogs.com/FMARGUERIE/)中发现了这个连接(http://groups.msn.com/objectspaces)


现在的objectspaces还是最早的pdc preview版本,在浏览了新闻组和其它网站的一些消息后,确定这将是一个不会发表的产品,不过objectspaces 将会融合在.net 2.0中,来源如下

Latest Update on Microsoft ObjectSpaces
Wednesday, October 02, 2002 9:14 PM
According to Guang-an Wu who works for the company, Microsoft have utilized the feedback received via newsgroups and through customer meetings to improve ObjectSpaces further. Currently, ObjectSpaces is being developed as a part of the next major .NET framework release.
Stay tuned for further announcements at the PDC next year.


Since the component is still under development, many of the details are still being decided and are not yet available for public release. However, here are some of the highlights, with the usual caveat that all details are subject to change without further notice. And Additional details beyond these highlights are not available at this point for release.


Unlike the PDC 2001 Technology Preview, classes don't need to be abstract. The goal is to make ObjectSpaces available for all .NET objects.
The foundation is a better optimized streaming model for fast retrieval of objects.
Key features like simplicity of OPath queries for retrieving objects, choice of span or delay loading are being enhanced and improved.
More sophisticated support is planned for inheritance and advanced mapping between classes and one or more tables.
Further, tools support for application development lifecycle is in the works.




虽然objectspaces只是个预览产品,但其特征非常丰富,我非常喜欢其基于map文件的特性,这是 ado.net的TableMappings集合的文件化,使你在改动数据库(如改变字段名时)不必改动代码。


缺点
1、对象查询速度
我做了一下测试,查询一个8000条的包含7个属性的对象需要20秒
2、绑定
ObjectSet实现支持ICollection和支持IBindingList,因此支持绑定
类自己定义,需要自己实现IEditableObject,IDataErrorInfo来完美的支持.net数据绑定


约定
在OjbectSpace中
对象的UniqueId属性是必须的,当在进行OPaht查询时需要使用

posted on 2003-4-18 21:52:44
Comments
No comments posted yet
softye 2003-11-03
  • 打赏
  • 举报
回复
http://www.soho-works.net/BLOG/84.asp
henryfan1 2003-11-03
  • 打赏
  • 举报
回复
有点类似于JAVA 的O/R Mapping
在工程中有和数据表一一对应的实体类,
objectspace这是把实体类和表关连起来,
你不用写SQL语句,对实体类的操作直接返映到数据表中。
为了表达实体类和表的关系,还要定义一个对应关系的XML。
xupc 2003-11-03
  • 打赏
  • 举报
回复
有谁用过的再来谈谈啊,
这么多分呢
brightheroes 2003-11-03
  • 打赏
  • 举报
回复
gz,mark
qiuji 2003-11-03
  • 打赏
  • 举报
回复
你可以参考:
http://blog.joycode.com/kaneboy/posts/4452.aspx

110,524

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧