“MService”: A DSL for RESTful Services
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.
We then add two Get functions; one that yields all the values of People and the other than returns a specific value.
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”.
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.
and this
One of the cool things “MService” supports is OPTIONS to get metadata. We use the new infoof keyword for that.
That allows a client to get all the metadata for the service.
That let’s do interesting things like build this test form.
and even flow validation information to the browser client
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.
[...] 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/ [...]
“MUrl” and “MService”, two new DSLs for REST services - Pablo M. Cibraro (aka Cibrax)
20 Mar 09 at 21:17
“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
[...] 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 [...]
"MService": Part II at Douglas Purdy
21 Mar 09 at 03:23
Wow, 110% Standards compliant:o)
Fire Snake
23 Mar 09 at 14:03
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
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
[...] MService begins to make Oslo interesting [...]
MIX09 Videos, Oslo, Cloud Memory and More « Tales from a Trading Desk
24 Mar 09 at 21:37
[...] Microsoft: not an example of MS using Oslo to build/drive our own frameworks (Doug Purdy’s Mservice is a good example of [...]
BLOG 1138 : Oslo is running my house
24 Mar 09 at 23:37
[...] Part I, Part [...]
“MService”: Part III at Douglas Purdy
29 Mar 09 at 20:40
[...] 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 [...]
Where is “Oslo” going? at Douglas Purdy
9 Apr 09 at 01:39
[...] 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 [...]
Book tip: RESTful .NET « Stefanseverin’s Blog
26 Apr 09 at 16:30
Is the MService runtime already published. If so where can I find it?
LucVK
3 Jun 09 at 22:01