Douglas Purdy

“MService”: A DSL for RESTful Services

with 12 comments

This is the second of three posts about our MIX talk/announcements.

In addition to “MUrl” (which works on the CTP bits today), we showed off an early look at “MService”.

This is the the next rev of the “MService” prototype that we showed at PDC.

The key and very important difference is that “MService” is no longer an external DSL like what we showed at PDC.

Rather “MService” is just “M” that a runtime uses to provide RESTful services.

Let’s take a look at how it works.

We start off with a simple domain (Person).  This, of course, could be as complex as you want (have a look at the models.mproj in the SDK), but I want keep it small.

image

We then add two Get functions; one that yields all the values of People and the other than returns a specific value.

image

So far this is all “M” that you would see in the CTP, but now we are going to do something new.

The below shows an early look into some new  “M” language features we expect to have in place in a future CTP.

Don’t get wrapped up in the keywords, etc. (although they are quite nice), the key thing is that you will be able to do this in “M”.

image

As you see, we now have described a complete, albeit trivial, RESTful service.

All we need to do is save this file in a vroot with the “MService” runtime installed.

That let’s us do things like this.

image

and this

image

One of the cool things “MService” supports is OPTIONS to get metadata.  We use the new infoof keyword for that.

image

That allows a client to get all the metadata for the service.

image

That let’s do interesting things like build this test form.

image and even flow validation information to the browser client

image

You can fully expect for “MService” to leverage the full power of all the .Net runtimes we have available today, include WCF, ADO.Net Data Services, ASP.Net, etc.

In fact, we call “M” and all “M” based languages — .Net DSLs.

The key thing we are doing is letting the developer stay focused on their domain and then the runtime behavior emerges from the domain description.

Lastly, I want to be clear that this is all early thinking and this could and likely will change as we learn more (just as “MService” has changed between PDC and MIX).

One of the things we are explicitly doing with “M” and “Oslo” is engaging the community very early and very openly to work together on this technology.

Our goal is to greatly simplify how people design, develop and manage applications.

We need your help to do it.

March 20th, 2009 at 8:26 pm

Posted in Microsoft, Oslo, Software Development

12 Responses to '“MService”: A DSL for RESTful Services'

Subscribe to comments with RSS or TrackBack to '“MService”: A DSL for RESTful Services'.

  1. [...] MService, on the other hand, is a DSL for defining or creating RESTful services. Doug just posted new information about it, http://www.douglaspurdy.com/2009/03/20/mservice-a-dsl-for-restful-services/ [...]

  2. “MService”: A DSL for RESTful Services – Douglas Purdy…

    Thank you for submitting this cool story – Trackback from DotNetShoutout…

    DotNetShoutout

    20 Mar 09 at 22:16

  3. [...] want to make clear, especially to people new to "M", the MService example I showed in my first post uses a database to store all [...]

  4. Wow, 110% Standards compliant:o)

    Fire Snake

    23 Mar 09 at 14:03

  5. A few people, myself included, have tried to play with your sample from the Mix09 session or from this post. Are the “insert”, “update”, etc SQL mappings not available in the Jan09 CTP?

    Here is the thread in question:
    http://social.msdn.microsoft.com/Forums/en-US/oslo/thread/b292c987-32ef-49f8-b99e-398d128b1e15

    Any insight would be appreciated.

    -Jeff

    Jeff Williams

    23 Mar 09 at 15:56

  6. I replied on the forum thread too…

    There is not insert keyword in the published language specification. We are in the process of working through how insert/update/delete will manifest in the language currently.

    “M” does support insert today, not as a keyword, but via the extent initalization syntax.

    People: Person* {
    {Name=”Doug”, Age=99}
    }

    douglasp

    23 Mar 09 at 20:00

  7. [...] MService begins to make Oslo interesting [...]

  8. [...] Microsoft: not an example of MS using Oslo to build/drive our own frameworks (Doug Purdy’s Mservice is a good example of [...]

  9. [...] Part I, Part [...]

  10. [...] as it often confuses more than helps the conversation with developers. It seems that the Oslo team is heavily (and emotionally) involved in REST, actually let me rephrase that, involved in both lo-REST and CRUD-REST. That’s pretty [...]

  11. [...] with the MUrl which is a DSL for RESTful clients and I am looking really forward trying out the MService – a DSL for RESTful services, which I believe will be shipped with the next OSLO [...]

  12. Is the MService runtime already published. If so where can I find it?

    LucVK

    3 Jun 09 at 22:01

Leave a Reply