Re: Code generation or forms?

On 8 Jun 2005, at 22:15, Jan Algermissen wrote:

> in general, I think I still do not understand what code is to be 
> generated from the descriptions.

Well, in general if you write code that's formulaic,
it can be generated, no?

> Here the answer is explicitly 'client-side', yes?

Descriptions are in general published by a service for the
benefit of many clients. WSDL, for example, goes to great lengths
to abstract the 'interface' from where the service is deployed.
Ignoring such separations vastly simplifies matters.

> The problem I have with generating client side code is that the client 
> being an HTTP client
> anyhow and given it understands (== has the semantics coded in) the 
> message MIME type there
> should not need to be any extra information for the client to advance 
> through the state machine (that is the service).

Consider a URI which may return the current temperature for a
given location from a HTTP GET. The URI may have longitude
and latitude as parameters and return the value in a number of
different formats, subject to content negotiation:

- as HTML
- as XML (with the value encoded somewhere)
- as a WAV file containing the temperature spoken
- as a jpeg, png or gif file containing a picture of the value
- possibly others

I could generate all kinds of different stubs, forms applications
documentation, whatever from a machine readable description of such
a service. It would be useful for a developer to be aware of the
possible options up front, though that wouldn't preclude other
formats for the returned data being made available in the future
and subject to negotiation at runtime.

> It should  not need extra information because from understanding 
> theMIME type it should understand the semantics of the hyperlinks in 
> the message.
>
> Or what am I getting wrong here? Can you sketch an example of the code 
> that you'd like to see generated?


AIUI this is a scenario in which a service returns data
containing other URIs which are then in turn processed.

I believe that stubs could be generated here, though how the stubs are
invoked and the service traversed would require a choreography language,
probably going well beyond the scope of simple description languages
being discussed here.

--
http://blog.whatfettle.com

Received on Wednesday, 8 June 2005 22:05:27 UTC