UML to model Web Services?
Eric Newcomer answers some of my criticisms of his recent posting on MDA.
Great to see that we’re not that far apart, and kudos to Eric for openly acknowledging a slight change of mind — something you don’t find very often. Interestingly, many opponents of code generation tend to compromise on the viability of doing one-shot generation without later on going to back to the model, while I believe that this is even worse than not doing code generation at all.
One interesting point remains: Eric believes UML to unsuited for modeling Web services. I see no reason why this should be the case. I strongly agree that Web services are not distributed objects, but of course UML can be used to model non-OO concepts as well. In fact, we are using UML in one of our projects to model Web services, and we definitely do not take a distributed objects approach.
Maybe I should illustrate this using an example. Anyone got a nice Web service I could use? ;-)
The short answer is that Web services are designed for use across software domains, originally across the Internet, but also within an Intranet. UML was designed for development within a domain, and actually only certain domains (i.e. object oriented but not message queues). Web services design must focus on the data, or schema, to be shared, rather than on the interface. It’s true that you can use UML for Web services, just like you can use a piece of string and two tin cans for a telephone. But that doesn’t mean the technology was intended to be used that way, nor that it’s the right fit for purpose. More details coming on my blog http://www.iona.com/blogs/newcomer/.
The way I see it, a web service is an entity in the same way that a class is and has operations.
A web service is also built in code and will use the underlying objects to perform its functions, so in this respect UML is a good tool to use for this.
On the other hand, UML is not currently designed to show configuration type of stuff so transport definitions are not suitable for UML.
Event the data/message schema can be modelled as a class, in much the same way that we can interchange classes and XML documents. So I would say that UML is a suitable tool.
As I said before, the only real weakness is the nice portrayal of an XSD schema in UML, but it has been done..