CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Peter's Gekko

public Blog MyNotepad : Imho { }

Contract first development (Christian Weyer spoke for the SDN)

Last Friday, December 9th, the Dutch user group SDN had a meeting. A lot of people turned up, demonstrating that blogs and other internet stuff are still not (and never will be) all there is. There is no substitute for meeting and talking with real live people.

My favorite presentation was on Contract First development by Christian Weyer. He's been giving this talk for some time. Last year for DotNed, the other Dutch user group. It is an evolving story, at the moment the content is hotter than ever. Christian has some great ideas on the subject, is quite passionate about them and gets carried away presenting it. Which leads to a hell of a presentation. Let me give you a short resume. Thanks to my glasswork I've been able to catch both speaker and the highlights of his slides, so Christian can do the main part of the talking himself

The Visual studio template to create a  webservice generates skeleton code:

The problem with this code is that is just a class whose methods are wrapped up with attributes. The webservice is used by making RPC (remote procedure calls) to some webservice object.

This does not fit very well in world of real world of communications:

There is a mismatch between webservices VS template style and message based systems as seen in service oriented architecture.

You cannot describe all aspects of services, messages and contracts in just a class. The real world has more aspects:

Instead of starting with code you should start with the contracts which describe the messages to exchange and the operations which accept and transmit messages. All of this can be described in XML schema.

This contract is going to be the base for generating the implementation of the webservice. That's where Christians Contract first tool enters the story. Like a real VS add-in it is started with a right click. It can generate two kinds of code: a server stub to implement the service and a client side proxy to consume it. The tool is free for download. It's also works for VS 2005. In Christan's words it's more or less 'pre-alpha' which requires some crossing of thumbs. In his demo it worked like a charm.

The essential point of the story is that a webservice is based on a contract. At the moment this contract is written out as an xml schema (xsd) which can be  understood by a variety of platforms. These contracts specify services in some specific domain. Being a good German Christian's domain were restaurants. When people agree on what the contracts in a specific domain should look like (after all a contract should be an agreement) you have building blocks for developing software for that specific domain. And the start of a domain specific language. Another whole new thing...

What the role and form of these contracts will be in the future remains an open question

I can't wait to see more glimpses at the next user group meeting.



Comments

darrell said:

I met Christian at TechEd 2005. He's scary smart.
# December 23, 2005 10:20 PM

Peter's Gekko said:

Here's the problem : We have quite a website which works with quite a database. The end user can only...
# January 16, 2006 9:06 AM

Peter's Gekko said:

Here's the problem : We have quite a website which works with quite a database. The end user can only...
# January 16, 2006 3:47 PM

Peter's Gekko said:

Recently I was in the need of a web service. At first sight I only needed a back door on a website to...
# January 20, 2006 8:09 AM

Peter's Gekko said:

Here's the problem : We have quite a website which works with quite a database. The end user can only...
# January 20, 2006 8:30 AM

Peter's Gekko said:

When you create a web service with Visual Studio the code template throws you straight into the code of a class. By writing out the code you're defining and implementing the service in one go. At first sight a web service is no more than a bunch of RPC invocations. In the real world web services are a matter of services sending each other (XML) messages. Christian Weyer created the Web Services Contract First tool, an add-in for Visual Studio. Using this tool you start with defining the messages being exchanged between web service and its consumer and end with a generated proxy and a stub class which take care of sending and receiving these messages. This approach to web services fits far better in a good architectural view of your services and applications.

# January 20, 2006 11:18 AM

Peter's Gekko said:

When you create a web service with Visual Studio the code template throws you straight into the code of a class. By writing out the code you're defining and implementing the service in one go. At first sight a web service is no more than a bunch of RPC invocations. In the real world web services are a matter of services sending each other (XML) messages. Christian Weyer created the Web Services Contract First tool, an add-in for Visual Studio. Using this tool you start with defining the messages being exchanged between web service and its consumer and end with a generated proxy and a stub class which take care of sending and receiving these messages. This approach to web services fits far better in a good architectural view of your services and applications.
# January 20, 2006 11:21 AM

Peter's Gekko said:

Author: <a href="blogs/peter.van.ooijen">Peter Van Ooijen</a><br />When you create a web service with Visual Studio the code template throws you straight into the code of a class. By writing out the code you're defining and implementing the service in one go. At first sight a web service is no more than a bunch of RPC invocations. In the real world web services are a matter of services sending each other (XML) messages. Christian Weyer created the Web Services Contract First tool, an add-in for Visual Studio. Using this tool you start with defining the messages
# January 20, 2006 11:24 AM

Peter's Gekko said:

When you create a web service with Visual Studio it throws you straight into the code of a class. Writing out the code you're defining and implementing the service in one go. At first sight the service is no more than RPC invocations. In the real world web services are a matter of services sending each other (XML) messages. Christian Weyer created WSCF, an add-in for Visual Studio. Using this you start with defining the messages being exchanged between service and its consumer and end with generated proxy and a stub which take care of sending and receiving them. This approach fits far better in a good architectural view of your services and applications.
# January 20, 2006 11:24 AM

Peter's Gekko said:

When you create a web service with Visual Studio it throws you straight into the code of a class. Writing out the code you're defining and implementing the service in one go. At first sight the service is no more than RPC invocations. In the real world web services are a matter of services sending each other (XML) messages. Christian Weyer created WSCF, an add-in for Visual Studio. Using this you start with defining the messages being exchanged between service and its consumer and end with gener
# January 25, 2006 11:21 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add
Check out Devlicio.us!