views:

94

answers:

3

"Bottom up" or "top down"?

First I used top down but I felt to much design options that didn't have any implementation or validation.

Now my approach is "bottom up" heaven when a create a new service.

  • Bottom-up: when you use the code to make the web-service.
  • Top-Down: when you create and use the wsdl file to make the web-service and generate some code.
+1  A: 

I definitely prefer generating the WSDL from code, because modeling code-first is so much more comfortable and easy. Also, classes generated from an XSD tend to be rather messy in my experience, and can be a real nightmare when exposed as an API.

Fabian Steeg
This was also my preference, but maybe I can resolve some interoperability problems by creating the WSDL.
Eduardo Santa
+2  A: 

I use "contract first" - start with a schema describing the XML messages and work out from there. Generate the WSDL from that, and have the endpoints deal with XML. You can do "duck typing" that way.

duffymo
Aren't both ways contract-first? The choice seems to be how to define the contract: as a class in a programming language or as an XML schema definition.
Fabian Steeg
I think classes in programming languages are more brittle, because changing the class means changing both the service and the client. At least with XML schema you don't dictate client language and you can still do "duck typing". As long as the service can cherry pick what it wants out of XML...
duffymo
How do you dictate the client language? When I use code to define the contract I also use "duck typing" to keep the original code simpler and clean.
Eduardo Santa
If your protocol is RMI you're presuming Java clients. If you change the classes, generated WSDL changes, and both client and service have to mirror it. With XML and WSDL first you have a chance to keeping client and service more loosely coupled.
duffymo
The classes I use to define the WSDL, are different from my business classes, and the only propose of that classes is to define WSDL. That way I keep the service loosely coupled. One off my questions on contract-first is the possibilities off multiple validations that are not implemented by anyting
Eduardo Santa
A: 

I'm not sure that you can describe wsdl creation as top-down vs. bottom-up. I think it just depends on what tools you're using. Some products lend themselves better to schema creation first. Others are better in starting with code. It really depends on what you have access to.

I think you may be able to describe an overall SOA implementation strategy as top-down vs. bottom-up. Bottom up is start building services at the data access level and then higher order services on top of those. Where top-down is get a major project, create a few services that are to be leveraged, scrub, rinse & repeat.

In this case, bottom up is the way to go. The ROI is longer, but it is because those services continue to be leveraged that you experience the savings soa purports to enable.

Nathan