哪种Web服务更好的方法-先签约还是后签? [英] Which is the better approach to web services - contract first or contract last?

查看:91
本文介绍了哪种Web服务更好的方法-先签约还是后签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哪种是开发Web服务的更好方法?首先签订合同还是最后签订合同?
每种都有哪些优缺点?

Which is the better approach to developing web services; contract first or contract last?
What are the advantages and disadvantages of each?

您有哪些经验?

编辑 这个问题与Web服务的实现有关(阅读:SOAP) 问题是,应该首先对实现类进行编码,然后从中生成WSDL和XSD模式(最后进行合同),还是首先编写WSDL和XSD方案并生成实现类(首先进行合同)

EDIT This question is about the implementation of a web service (read: SOAP) The question is whether the implementation classes should be coded first and the WSDL and XSD schema generated from that (contract last) or the WSDL and XSD schema written first and the implementation classes generated (contract first)

推荐答案

合同优先是公认的最佳实践".

Contract-first is the generally accepted 'best practice.'

这使您与服务的生产者和消费者都非常清楚,确切知道需要什么和期望什么.当您开始尝试转换Java类型-> xml类型时,这尤其重要.您还可以在不同的Web服务之间重用架构.

It makes you be very clear with both the producer and consumer of the service exactly what is needed and what is expected. This becomes especially important when you start trying to convert java types -> xml types. You're also able to reuse schemas across different web service.

这篇关于哪种Web服务更好的方法-先签约还是后签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆