S*********t 发帖数: 78 | 1 我看到很多人都是从数据库来生成domain object(entity)和 xsd ,然后用在web
service 数据传递。
可不可以先写 domain objects 然后用这个object 生成 xsd 呢?
感觉第一种方法 OO 不够好,是以数据库表为驱动的。
大家怎么看这个问题? | g*****g 发帖数: 34805 | 2 在我看来,web service只是remoting的一种方法,应该对xml透明。
用CXF之类的生成相关的wsdl即可,具体内容不必关心。
【在 S*********t 的大作中提到】 : 我看到很多人都是从数据库来生成domain object(entity)和 xsd ,然后用在web : service 数据传递。 : 可不可以先写 domain objects 然后用这个object 生成 xsd 呢? : 感觉第一种方法 OO 不够好,是以数据库表为驱动的。 : 大家怎么看这个问题?
| t*******e 发帖数: 684 | 3
要看是先设计数据库,还是先设计object model,我做的几个项目用hbm2ddl从object
model生成relational schema.和DBA的沟通很重要的,有许多实用的auditing columns
一般Java programmer不会想到。
【在 S*********t 的大作中提到】 : 我看到很多人都是从数据库来生成domain object(entity)和 xsd ,然后用在web : service 数据传递。 : 可不可以先写 domain objects 然后用这个object 生成 xsd 呢? : 感觉第一种方法 OO 不够好,是以数据库表为驱动的。 : 大家怎么看这个问题?
| t*******e 发帖数: 684 | 4
我开始的想法和你的类似。但实际上WS已经发展的非常远了。
Object centric web services比较合适企业内部使用,原因是简单,xml透明。但当通
信要跨越corporate boundaries 时,document centric (contract-first) approach
更合适些,这种情况下,method (operation) binding就被忽略了,所有的信息都包含
在XSD之中,包括具体的operations,transaction, security,policy等等。
修改一下,所有的信息都包含在XSD之中,以及SOAP headers里面。
【在 g*****g 的大作中提到】 : 在我看来,web service只是remoting的一种方法,应该对xml透明。 : 用CXF之类的生成相关的wsdl即可,具体内容不必关心。
| m******t 发帖数: 2416 | 5
approach
+1. Any application serious about interoperability has _got_ to
start with the schema and wsdl.
【在 t*******e 的大作中提到】 : : 我开始的想法和你的类似。但实际上WS已经发展的非常远了。 : Object centric web services比较合适企业内部使用,原因是简单,xml透明。但当通 : 信要跨越corporate boundaries 时,document centric (contract-first) approach : 更合适些,这种情况下,method (operation) binding就被忽略了,所有的信息都包含 : 在XSD之中,包括具体的operations,transaction, security,policy等等。 : 修改一下,所有的信息都包含在XSD之中,以及SOAP headers里面。
| m******t 发帖数: 2416 | 6
columns
I always generate a draft DDL from the object model, but always
hand-write the final version (working with DBA as you pointed out).
I know the trend is to generate one from the other, but I think
for any non-trivial application, it's really worth it to hand roll
the object model and the db schema, considering how incredibly
critical they are in the entire architecture.
【在 t*******e 的大作中提到】 : : 我开始的想法和你的类似。但实际上WS已经发展的非常远了。 : Object centric web services比较合适企业内部使用,原因是简单,xml透明。但当通 : 信要跨越corporate boundaries 时,document centric (contract-first) approach : 更合适些,这种情况下,method (operation) binding就被忽略了,所有的信息都包含 : 在XSD之中,包括具体的operations,transaction, security,policy等等。 : 修改一下,所有的信息都包含在XSD之中,以及SOAP headers里面。
|
|