Feeds:
Posts
Comments

Posts Tagged ‘oslo’

It has been more quiet around “Oslo” the last month. Maybe just about everybody is on vacations. Or people feel that everything will change with the PDC in November and are afraid of publishing nonsense.

Nonetheless, I felt it’s time for an update on what I think, heard and read about “Oslo”.

I divided my post in two sections:

  • Information about “Oslo”
  • What I think about “Oslo” today

have fun!

Some Information about “Oslo”

For those who don’t know, “Oslo” is the current codename for Microsoft’s forthcoming modeling platform, which is available as CTP Download since back in October 2008.

If you want to read more about what Oslo is about, I recommend those Resources:

Well, since then Microsoft has released two more CTP releases (January and May), written a lot of documentation and posted quite some videos and samples. If you ask me, it’s yet too much for such a young and undone technology. Oslo’s modeling language “M” has and The "Oslo" Modeling Language Specification, which yet has been implemented in JavaScript by Mathew Wilson (jsmeta).

The community did also care a lot, and there are even companies investing in tools around “Oslo”. Telrik published two projects on their Labs Site. A tool for comparing and migrating M as well as LINQ to M. There are even trainings offered by Agilitrain and PluralSight.

Some recommended links:

What I think about Oslo today
(May CTP + Announcements)

First of all I want to say, that I’m happy Microsoft released Oslo in such an early state. I think they know the pros and cons of such an open process. The community can help with forming the product, and companies can start to invest early in what they think might be valuable for the future. But It also means more friction for any changes that are made.

I have used M for defining schemas and languages and also played around with the Repository and Quadrant. As Microsoft also states, it’s early Alpha. I stumbled over many bugs which I still plan to report and blog about. But that is OK, no one ever said it was production ready.

“M”

So far I like the schema part of M, also called MSchema. It has a very concise (compared to XSD) c-style syntax and covers a lot of what I want to express when modeling information structures. The M-graph (for values) syntax is also OK, while I don’t like the MGraph API. M-constraints let you restrict your types in a nice way. What I don’t like here, is the missing support for weak constraints. Named M-queries (similar to LINQ syntax), are a nice way to query M structures.

M-grammar is useful for DSLs. I think it could be more opinionated. I feel MS is striving for an expressiveness that let you describe all computer languages in the world using MGrammar. This makes it more complex than necessary for covering DSLs. At the same time it doesn’t support nesting of languages, which would be especially useful for DSLs, because you often need to talk to external models (e.g. pinvoke). The support for editor customizing (crucial language workbench feature) as it is today is not sufficient and too hard to configure.

Another feature I miss here is referencing between nodes and even across files (linking + scoping). For now all references are just values (ids), and the output of a DSL program will be a tree model, no graphs!

The Repository

The Repository basically offers some features on-top of SQL server as are row-level security, hierarchies, localization, versioning, additional constraints. All those features are plain SQL “libraries” in conjunction with M-models which also are compiled down to SQL. I don’t yet know what to think about the Repository.

Naming / Packaging

In the last couple of weeks the Oslo team published two posts that confirmed some of my speculations.

Let’s start with Doug’s Post: On “Oslo” at Douglas Purdy

In this post he basically makes two statements:

The only thing that I feel bad about is that we kept the “Oslo” name around so long (you will see that change at the next PDC), which has continued to be a confusing point for customers (“I thought Oslo was your new SOA platform”).

Douglas Purdy

I agree. It was confusing. Although people slowly start to accept “Oslo” as for “Modeling”.

Oslo and EF / Data Programmability

With this in mind, we made a decision to merge the Data Programmability team (EDM, EF, Astoria, XML, ADO.NET, and tools/designers) and the “Oslo” team (“Quadrant”, Repository, “M”) together.

Douglas Purdy

I don’t yet know what to think about this. “Oslo” is not and should not evolve to an O/R-Mapper. M’s type system is structural and doesn’t map well to strongly typed objects as used by EF. I can see this choice limiting the modeling capabilities of Oslo. But I guess we have to wait and see.

Quadrant. A graphical Editor?

The other post, confirming my fears about Quadrant was Model Citizen : What’s So Compelling about "Quadrant" Anyway?.

Back in November last year, when I wrote a sum-up post about “Oslo” I concluded Quadrant:

Yes. Quadrant lets you interact with models graphically. It’s highly generic, customizable and it looks great.

Lars Corneliussen, November 2008, What "Oslo" is and is not

I concluded this from the official statement about Oslo plus some videos and screenshots I had seen.

A tool that helps people define and interact with models in a rich and visual manner

Doulas Purdy, September 2008, What is Oslo?

But here is the smackdown:

Microsoft code name "Quadrant" is a ‘tool for viewing and editing SQL data,’ but… so what?

Michael Murray, July 2009, What’s So Compelling about "Quadrant" Anyway?

As I understand today, and as it shows up in the May CTP, it is not a graphical editor or graphical editing toolkit but rather a light WPF-version of Microsoft Office Access that understands Oslo Modeling concepts and relationships and builds up default editors in a generic manner. This is still useful (if it is free), but not far as useful as what I hoped Quadrant to be.

Please, Microsoft, make Quadrant a graphical editing toolkit with good support for configurable diagramming and any custom WPF editors. It should also have the plug-in model VS2010 offers for sharing any extensions.

The “Oslo” Story

Microsoft tries to sell “Oslo” as if it was all one story. It’s a lie.

There is tons of impedance mismatches that restrict you in many ways.

Modeling Structure

  • M in general uses structural typing (duck typing, supports mix-ins) and supports real graphs (including references)
  • MGrammar ASTs are hierarchal (tree structure) and for now only supporting nodes and strings.
  • Databases store flat relational data,
  • and objects in the .NET world are typed nominally (no multiple inheritance).

DSLs + Repository

There is no story for “DSLs and the repository”, and there is not yet a good story for any runtime support off the repository or DSL files. It’s basically what you had before. You can either access the database via ADO.NET or an O/R-Mapper or you run directly off the parsed MGraph-AST representing your DSL-Script, which feels like visiting xml documents. M has a nice LINQ-ish query language, but that doesn’t work in memory against a graph.

Querying

M has good support for complex data structures. As said there is no support for in-memory queries. But even the database implementation is limited by it’s relational backend. Even though queries can consult complex properties for sorting or filtering, it can only return rows with a list of scalar fields.

Constraints

Most constraints on types are only implemented in the SQL-Mapping. Also here there is no in-memory implementation that would validate your model against a schema. Basically the M-compiler generates a database schema including checks that would not let you insert invalid data into the database.

Data and schema evolution

There is this dream about capturing requirements in quite fuzzy ways and then piece for piece add details to them – until they have reached some formal state that might be executable. This sounds nice in theory, but there is no chance to implement this stuff. M is very easy to change, and it is easy to add constraints and refactor schema structures. But there is no story around how to let your data evolve together with your schemas using the Repository. So, besides nice theories, Oslo doesn’t help here.

More to come

There will be new content and Chris Sells also announced a fresh CTP around this years PDC in November.

So far, only one session has been scheduled, but watch this list for more sessions to come: Microsoft PDC09 – Modeling Sessions

Hope to see you in LA in November!

Read Full Post »

Soeben ist der dritte Artikel der DSL-Serie von Markus und mir bei der dotnetpro erschienen.

Bild 11

Abstract: Mehrspaltige Layouts für Webseiten sind komplex und stellen hohe Ansprüche an den Webprogrammierer. Warum nicht eine Sprache entwickeln, die solche Layouts vereinfacht? Mit Oslo M und dem ASP.NET MVC Framework lässt sich so eine Sprache realisieren.

Inhalt

Hauptsächlich dreht sich der Artikel um MGrammar, den Teil der Sprache Microsoft M (Teil von Microsoft Oslo) mit dem andere Sprachen definiert werden können. Zuerst wird die MGrammar (Arbeitstitel) anhand einer simplen “Hello, World”-Sprache erklärt.

Danach erstellen wir eine DSL zur Beschreibung mehrspaltiger Layouts und bringen diese mittels ASP.NET MVC und YAML ans laufen.

Das Beispiel im Artikel basiert auf der Oslo January CTP, der Quelltext für das Oslo May CTP kann aber bei mir angefragt werden.

Beispiel

Typisches dreispaltiges Portal-Layout.

Konkretes Layout - dreispalter

* Die Berechnung der Restbreite stimmt hier nicht. Richtig wäre:

Rest = (75%* Gesamtbreite) –400px

Dies mag aber von CSS-Framework zu CSS-Framework variieren.

DSL zur Beschreibung

Die Syntaxhervorhebung ergibt sich aus der Grammatik und ein wenig Konfiguration.

intellipad - Syntaxhervorhebung

Read Full Post »

The "Oslo” team has released the third CTP of Microsoft’s forthcoming modeling platform.

Some of the  changes are:

For more detailed information check out the team announcement and the release notes.

New Installer

oslo setup

Empty Quadrant Workspace

empty quadrant

Intellipad Splitting

intellipad-multisplit And yes, I’ll be blogging about my web-layout DSL :-)

kick it on DotNetKicks.com

Read Full Post »

Just my random reaction to 2009 Lang.NET Symposium – Language and Data.

As all of us know these days, Oslo is about a language, a repository and Quadrant. We all know the hard parts are the language and quadrant.

I have the gut feeling that the repository just is about the data backing for  the glue between M and Quadrant. This is the tool that has the potential to bring in money and I do understand it needs a repository.

But since PDC we have not heard anything about Quadrant, so for now all is about the language “M”. We also agree on that we won’t model customers and orders in Quadrant.

So why the heck do we still have to stand all that SQL mapping demos?

Just show us the modeling part… And show us Quadrant as soon as you’ve got something to show.

Read Full Post »

Abstract: Auf der PDC letzten Herbst hat Microsoft eine neue Plattform vorgestellt: Oslo. Dabei handelt es sich um Frameworks und Tools zur Arbeit mit Modellen und der Erstellung von domänenspezifischen Sprachen. In diesem Artikel möchten wir einen Überblick über Oslo geben, und es in das Umfeld der modellgetriebenen Softwareentwicklung und der DSLs einordnen.

Download: http://www.voelter.de/data/articles/VoelterCorneliussen-OSLO.pdf

Publiziert in: DotNetMagazin Developer Channel, 03/2009

Markus Voelter, Independent/itemis, voelter@acm.org
Lars Corneliussen, itemis, lars.corneliussen@itemis.de

Read Full Post »

Scott Hanselman about Oslo

Doug and Chris will talk about Developing RESTful Services and Clients with "M" at MIX . Scott had a chance to see a preview and posted about it:

Mix: Getting my head around Oslo, M and MGrammar

Read Full Post »

Update: Switched off 3D-Support in the Fusion-VM-Settings. Everything works fine now.

I need to do some intellipad screenshots for my article on DSLs, but on my Parallels XP installation intellipad just crashes on every start. Great! A good reason to test Windows 7 on a VM Ware Fusion. But now, even worse, the whole VM crashes every time I startup intellipad :-)

It just hangs as this screenshot shows. Any ideas?

Bild 7

Read Full Post »

Microsoft’s upcoming “Oslo” modeling initiative is about tools and languages. MGraph is the piece within the language “M” that defines values, while MSchema is for schemas, functions and constraints and MGrammar is for textual DSLs. “Oslo” is still CTP and it will take some time until all concepts are available for production use.

By then, Microsoft plans to publish an open specification, such that everyone who wants to can implement the “M” language. Their ambition is to make it be as broad as XML is today.

Anyone can implement it. We want this approach wide spread on a variety of different platforms. We want it to be as broad as Xml is today.

Douglas Purdy, A Lap around “Oslo”

Today we have lots of XML on the wire. There’s also lots of JSON.

I want to see MGraph get there as well.

Jeff Pinkston alias Pinky:-), MGraph as a data rep

What is MGraph?

MGraph at it’s base is not a language. It is a simple contract for storing structured data in form of a labeled directed graph. This is a set of nodes where each node has an optional label and a set of successors, each of which may be a node or any other object.

The idea behind that is, that every structure can be exposed as a MGraph just by implementing the following interface, which is the core API behind MGraph.

I added some comments for easier understanding.

// Exposes whatever structure as an MGraph
public interface IGraphBuilder
{
  // Checks, if the object submitted is a value or a (custom) node.
  bool IsNode(object value);
  // Retrieves a comparer for the (custom) node objects.
  IEqualityComparer NodeComparer { get; }
  // Extracts the label from a (custom) node.
  object GetLabel(object node);
  // Extracts the successors from a (custom) node.
  IEnumerable GetSuccessors(object node);
  // Gets a (custom) node with a label.
  object DefineNode(object label);
  // Sets successors to a (custom) node.
  void DefineSuccessors(object protoNode, IEnumerable successors);
}

As you see, even the node is not specified by an interface or a base class. Both labels and successors are extracted by the visiting graph builder.

If you want, read more about the MGraph Api here.

MGraph as a language

What I do care more about is how MGraph's textual notation looks like and how it compares to XML.

On MSDN you can find a language specification covering MSchema and MGrammar which both use parts of MGraph, but in a slightly different manner. Microsoft definitely plans to bring those pieces together

Today MGraph is used for values in MSchema extent initializers as well as for the AST (Abstract Syntax Tree) productions in MGrammar.

The basic syntax of MGraph very similar to JSON:

label { 
  otherLabel { "value" },
  "value",
},
"value"

As mentioned previously a successor can be either a node or a value. A value is just written directly, while a node is split into a label followed by its comma-separated successors within curly braces.

The same data as a XML-fragment would look like this:


  value
  value

value

One of the major differences is, that MGraph doesn't distinguish attributes and elements. As XML is used today, anyone use attributes and elements according to their personal taste anyway.

Typed values

The next great difference is, that values are not just strings, but typed. Some of the intrinsic types are Text, Logical or Number.

mynode
{
  text { "some text" },
  number { 1234 }
  logical { true }
}

Find a list of the supported types in chapter 3.5 Intrinsic Types in the "Oslo" Modeling Language Specification.

Escaped Labels

While XML-elements and attributes are restricted to QName, a label in MGraph can be any object. They way how this is expressed in the textual syntax is not finished yet, but in MGrammar productions more complex strings are defined with an id-function.

id("some label xyz") 
{
  true, 
  id("another node") { "value" }
}

Ordered and unordered successors

In order to make a mapping to relational structures easier, successors are not sorted by default. In order to sort the successors, they have to be encapsulated in an integer-labeled node.

{
  0 { "value1" },
  1 { "value2" }
}

Which alternatively also can be expressed by brackets instead of braces. In the "M" jargon this is called a sequence.

[
  "value1",
  "value2"
]

Single successor nodes, or labeled values

A named value in MGraph is just a labeled node with a single value successor. The equals-sign is just some syntactic sugar for better read- and writability. In the "M" jargon this is called Entity, but this name is subject to change. Record structure might be a better name.

person
{
  name = "John Smith",
  age = 24
}

equals to

person
{
  name { "John Smith" },
  age { 24 }
}

Better than XML?

XML is great. Mostly because it can be read by almost every system, not because it has such a nice syntax. It was never meant for the purpose it is used for today either. It is a markup language for defining additional metadata onto text.

But what XML is broadly used for today, is configuration files, transport messages and even internal DSLs. For this kind of information, that has more structuring elements than data, XML is way to verbose.

Therefore I think MGraph with its tight syntax has the potential to become a great and broad alternative.

What do you think?

Comparing XML, JSON and MGraph

(more…)

Read Full Post »

I drafted Fowlers state-machine example with MGrammar. While doing so I found a few things I would like to see optimized or find better solutions for.

  • New line handling. I would like to express one required new line, when it is required, but then ignore all the others. Forum discussion.
    I could make new lines part of some tokens and then just interleave other tokens. But I don’t think this would be a nice solution. Any ideas?
  • The blocks events, resetEvents, commands and state+ have to be written in order. It is possible to describe a grammar where unordered blocks would be allowed, but it’s not trivial.
    Ordered and unordered “Lists” of syntaxes, separated somehow should IMHO be supported directly: forum discussion.
  • I wrote the Grammar using Intellipad and the three-pane input/grammar/AST view. It’s great! But I’d like to define the Semantic Model (using MSchema) along with the grammar and directly validate my AST against it: forum discussion.
  • References are not directly supported by MGrammar/MSchema. Forum discussion.
  • Xtext, which is quite comparable to MGrammar has a much more compact syntax. But I haven’t done a more deep comparison yet.
    Sven Efftinge’s Blog: Fowler’s DSL example with Xtext

Still missing:

  • A schema that represents the structure of the AST and validates it using constraints.
  • An adapter to Simple State Machine on CodePlex or a generating a state machine framework using T4.

Would love your feedback…

Grammar definition

module MGrammar.Net.Sample {

  // This is my first try, to parse the state machine
  // dsl syntax proposed by Martin Fowler
  language Statemachine 
  {
    interleave Ignore = " ";
    
    syntax Main = 
        NewLines? e:Block(Events, NameAndCode)
        NewLines+ r:Block(ResetEvents, Name)
        NewLines+ c:Block(Commands, NameAndCode)
        NewLines+ s:List(StateBlock)
        NewLines?
        => Statemachine 
        {
          Events { valuesof(e) },
          ResetEvents { valuesof(r) },
          Commands { valuesof(c) },
          valuesof(s)
        };
        
    // list of syntax "Item" separated by one or more
    // new lines
    syntax List(Item) = n:Item => {n}
        | list:List(Item) NewLines+ n:Item 
            => {valuesof(list), n};
    
    // lists of tokens separated by whitespaces 
    syntax TokenList(Item) = n:Item => {n}
        | list:List(Item) n:Item 
            => {valuesof(list), n};

    // a block consisting of a keyword, new-line-
    // separated "Item"s and end
    syntax Block(Keyword, Item) = Keyword 
            NewLines items:List(Item) 
            NewLines End => {valuesof(items)};
            
    // a word projected as a name
    // grouped into a separate successor
    // for extensibility reasons
    syntax Name = n:Word
        => { Name {n} };
        
    // a word plus a code, separated by spaces
    syntax NameAndCode = n:Word c:Word
        => {Name {n}, Code{c}};
    
    
    // special block and subsyntaxes for states
    syntax StateBlock = State n:Word 
            actions:(NewLines a:Actions => a)?
            NewLines+ items:List(Transition) 
            NewLines+ End 
            => State 
            {
                Name { n }, 
                actions, 
                Transitions { valuesof(items) } 
            };

    syntax Transition = e:Word "=>" s:Word
        => { Event {e}, ToState{s} };
        
    syntax Actions = tActions "{" l:TokenList(Word) "}" 
        => Actions [ valuesof(l) ];
    
    
    // keyword specification for strong formatting
    @{Classification["Keyword"]} final token Events = "events";
    @{Classification["Keyword"]} final token Commands = "commands";
    @{Classification["Keyword"]} final token ResetEvents = "resetEvents";
    @{Classification["Keyword"]} final token State = "state";
    @{Classification["Keyword"]} final token End = "end";
    @{Classification["Keyword"]} final token tActions = "actions";
    
    
    // Some whitespace characters
    token NewLineCharacter 
            = 'u000A'  // New Line
            | 'u000D'  // Carriage Return
            | 'u0085'  // Next Line
            | 'u2028'  // Line Separator
            | 'u2029'; // Paragraph Separator
            
    token NewLines = NewLineCharacter#2..;
         
    token Letter = 'a'..'z' | 'A'..'Z';
    token Digit = '0'..'9';
    token Word = (Letter (Letter | Digit)*);
  }
}

Input Text

events
  doorClosed  D1CL
  drawOpened  D2OP
  lightOn     L1ON
  doorOpened  D1OP
  panelClosed PNCL
end

resetEvents
  doorOpened
end

commands
  unlockPanel PNUL
  lockPanel   PNLK
  lockDoor    D1LK
  unlockDoor  D1UL 
end

state idle
  actions {unlockDoor lockPanel}
  doorClosed => active
end

state active
  drawOpened => waitingForLight
  lightOn    => waitingForDraw
end

state waitingForLight
  lightOn => unlockedPanel
end

state waitingForDraw
  drawOpened => unlockedPanel
end

state unlockedPanel
  actions {unlockPanel lockDoor}
  panelClosed => idle
end

Output AST

Statemachine{
  Events{
    {
      Name{"doorClosed"},
      Code{"D1CL"}
    },
    {
      Name{"drawOpened"},
      Code{"D2OP"}
    },
    {
      Name{"lightOn"},
      Code{"L1ON"}
    },
    {
      Name{"doorOpened"},
      Code{"D1OP"}
    },
    {
      Name{"panelClosed"},
      Code{"PNCL"}
    }
  },
  ResetEvents{
    {
      Name{"doorOpened"}
    }
  },
  Commands{
    {
      Name{"unlockPanel"},
      Code{"PNUL"}
    },
    {
      Name{"lockPanel"},
      Code{"PNLK"}
    },
    {
      Name{"lockDoor"},
      Code{"D1LK"}
    },
    {
      Name{"unlockDoor"},
      Code{"D1UL"}
    }
  },
  State{
    Name{"idle"},
    Actions[
      "unlockDoor",
      "lockPanel"
    ],
    Transitions{
      {
        Event{"doorClosed"},
        ToState{"active"}
      }
    }
  },
  State{
    Name{"active"},
    Transitions{
      {
        Event{"drawOpened"},
        ToState{"waitingForLight"}
      },
      {
        Event{"lightOn"},
        ToState{"waitingForDraw"}
      }
    }
  },
  State{
    Name{"waitingForLight"},
    Transitions{
      {
        Event{"lightOn"},
        ToState{"unlockedPanel"}
      }
    }
  },
  State{
    Name{"waitingForDraw"},
    Transitions{
      {
        Event{"drawOpened"},
        ToState{"unlockedPanel"}
      }
    }
  },
  State{
    Name{"unlockedPanel"},
    Actions[
      "unlockPanel",
      "lockDoor"
    ],
    Transitions{
      {
        Event{"panelClosed"},
        ToState{"idle"}
      }
    }
  }
}

Read Full Post »

Oslo Blog Roll

My Feeds in Google Reader categorized “Oslo”

Read Full Post »

Older Posts »

Follow

Get every new post delivered to your Inbox.

Join 35 other followers