Tuesday, April 5, 2011

Which type of creation of web-services is your primary choice?

"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.
From stackoverflow
  • 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.

    Eduardo Santa : This was also my preference, but maybe I can resolve some interoperability problems by creating the WSDL.
  • 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.

    Fabian Steeg : 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.
    duffymo : 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...
    Eduardo Santa : 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.
    duffymo : 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.
    Eduardo Santa : 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
  • 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.

0 comments:

Post a Comment