My lap around OSLO

Now I am home I can start experimenting with things I heard at the PDC. In my previous post I created a Azure Service; my first one. This time I am going to do my own lap around OSLO. In some post you have already read what OSLO is; if not here’s a brief explanation. OSLO is a platform for model-driven applications. It contains three components:

image

“M” gives you the modeling and textual DSLs. With M you write down the things you need to drive your application.  The things could be application configuration data, or application specific data, or data which is actually your application. With “Quadrant” you have a visual tool to view the models in the Repository (interaction with data). It gives the user a flexible and focused design surface (some people like drawings). Finally the repository holds all models. This repository is build on top SQL Server.

MGrammar is a language for writing textual, domain-specific languages. Grammar is set of rules that determine if a sequence of characters conform to a language.In this case the language is M belonging to OSLO, which is declarative language for working with data. Easiest way to see the grammar in action is to use Intellipad, which ships with OSLO SDK. Oslo team actually build this tool to create a great editing experience and tool also called IPad for short. I fired this tool up inside my Oslo_Dublin_WF_WCF_4 folder of USB Drive every attendee received called PDC08-CSD.

image

And then IPad tool pops up in standard mode.

image

Now I am going to start modeling using M. I create a module around insurance and save it as in

image

Now as you can see below I am in MMode with my model.

image

I continued my model that looks like this:

module Insurance
{
    type InsuranceType
    {
        Id  : Integer64 = AutoNumber();
        Name : Text;
        Description : Text;
        Premium : Integer32 where value <= 200;
    } where identity Id;


    Insurances : InsuranceType*;
}

And SQL looks like below:

image

Changes in model are directly seen left inside SQL cod. Everything is dynamic. I saved this model. Now I want to store model in repository and to do this I need to compile model with mschema2db.cmd. This file is not on the VPC so I created it myself, after watching a lap around oslo video.

@echo off
echo Compiling schema %1...
m.exe %1 /p:image -nologo -t:Repository
echo Populationg...
mx.exe /i:%1x /db:repository /ig /f /verbose

M.exe compiles model and MX.exe generates TSQL. I created this script inside bin directory of the Microsoft OSLO SDK 1.0. Also I copied Insurance.m I created there (I know this not exact way to go, but it is fine for now).

image

I now open SQL Server 2008 Management Studio to see how my model is stored since SQL Server acts as a repository.

image

There you go it is in the repository. Microsoft already has loaded up models and so in this repository. With any data access tool this data can be shown, for instance Excel.

image

Next I am going to write some data for this model (like xml for a schema).

image

Now I am also going to load this into the repository with another script called m2db.

%echo off
echo Compiling %1...
m.exe %1 /p:image -r:%2 -nologo -t:Repository
echo Populating
mx.exe /i:%1x /db:repository /ig /f /verbose

image

I then refresh my excel and see there is data.

image

What I have done so far is some basic stuff that has been demoed during the Lap around OSLO session by Doug Purdy and Vijaye Raji in first half hour. It was one off the interesting sessions during the PDC. Around this session you can find some excellent posts by Paul, Dennis and Jon. If you want to see al session around Oslo and corresponding PowerPoint deck.

Session Speaker(s) PowerPoint Video
“Oslo”: The Language Don Box & David Langworthy PowerPoint Deck High Quality Video
"Oslo": Building Textual DSLs Chris Anderson & Giovanni Della-Libera PowerPoint Deck High Quality Video
"Oslo": Repository and Models Martin Gudgin & Chris Sells PowerPoint Deck High Quality Video
"Oslo": Customizing and Extending the Visual Design Experience Don Box & Florian Voss PowerPoint Deck High Quality Video

In total there were 5 session around OSLO. Best starting point is lap around OSLO with blog posts I pointed out. Have fun trying it out.

 

Technorati:

Labels: ,