tags:

views:

144

answers:

2

I am doing some research on web services. I have not written any web service but am doing a small write up on them. During my research I've come across terms contract-first and contract-last.

Can someone explain these two in an understandable form.

A: 

Contract-first means you design the way your services are going to communicate with each other BEFORE your design the services themselves. Contract-last is the other way around -- you design how your service is going to work, then make one or more methods available as the interface for other services.

Kaleb Brasee
+1  A: 

To expound on the answer by Kaleb, contract-first is where you create the WSDL, and then you can create the implementation from this, and since the WSDL is your contract, this would be contract-first.

Contract-last is where the WSDL is created from the source code, or implementation, so it will most likely be generated by a tool rather than created by the developer.

Update

For a nice explanation with code, in Java, you can look at this explanation from the Spring 1.5 documentation.

http://static.springsource.org/spring-ws/sites/1.5/reference/html/why-contract-first.html

They will discuss the pros and cons, but they will be biased toward their approach, but, I think it is a nice explanation.

James Black