本文介绍了使用 WADL 的原因是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了描述 RESTful,我们可以说每个资源都有自己的 URI.使用 HTTP GET、POST、PUT 和 DELETE,我们可以对这些资源进行操作.所有资源都是代表性的.任何想要使用我们资源的人都可以通过浏览器或 REST 客户端来使用.

To describe RESTful we can say that every resource has its own URI. Using HTTP GET, POST, PUT and DELETE, we can operate on these resources. All resources are representational. Whoever wants to use our resources can do so via a browser or REST client.

这就是 RESTful 架构的主要思想.这种架构允许在互联网上提供服务.那么为什么这个架构需要WADL呢?WADL 提供哪些标准 HTTP 没有提供的功能?为什么需要存在 WADL?

That's the main idea of a RESTful architecture. This architecture allows services on the internet. So why does this architecture need WADL? What does WADL offer that standard HTTP does not? Why does WADL need to exist?

推荐答案

WADL 的目的是定义一个契约.合同指定一方如何呼叫另一方.

The purpose of WADL is to define a contract. Contract specifies how one party can call another.

当您从头开始创建 Web 应用程序时,您不需要合约和 WADL.

When you create a web application from scratch, you don't need contract and WADL.

当您将您的系统与其他系统集成并且您可以与他们的开发团队进行清晰的沟通时,您不需要合同和 WADL(因为您可以拨打电话将事情说清楚).

When you integrate your system with the other system and you can communicate clearly with their development team, you don't need contract and WADL (because you can make a phone call to make things clear).

但是,当您将一个复杂的企业系统与由几个不同公司(或联邦机构)维护的其他几个复杂的企业系统集成在一起时,请相信我您希望拥有尽可能严格的通信合同.然后您需要 WADL 或开放规范.非常需要.

However when you integrate a complex enterprise system with several others complex enterprise systems maintained by several different companies (or federal institutions), then believe me you want to have a communication contract defined as strictly as possible. Then you need WADL or Open Specification. Need it badly.

企业背景薄弱的人倾向于将整个 IT 视为独立开发的独立 Web 应用程序的集合.但企业现实有时很艰难.有时,您甚至无法致电或写信给开发您必须与之集成的应用程序的人员.有时,您与不再维护的遗留应用程序通信——它只是运行,您需要弄清楚如何正确地与其通信.在这种情况下,您需要签订合同,因为它可以节省您的精力.

People with weak enterprise background tend to see entire IT as a collection of separated web applications developed independently. But enterprise reality is sometimes tough. Sometimes you can't even call or write to the people developing the application you have to integrate with. Sometimes you communicate with a legacy application that is no longer maintained--it just runs and you need to figure out how to communicate with it properly. In such conditions you need a contract because it saves your ass.

实际上客户端生成是合约定义的次要特征.它只是一个玩具.契约强制糟糕的沟通者清楚地传达集成规则.这是使用 WADL 或开放规范等的主要原因.

Actually client generation is the minor feature of the contract definition. It's just a toy. Contract enforces bad communicators to communicate integration rules clearly. This is the main reason to use WADL or Open Specification or whatever.

这篇关于使用 WADL 的原因是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-03 02:23