# Friday, July 13, 2007
« The Right Amount of Code Generation | Main | Moving to Bristol »

Erik Meijer is involved in some very interesting research at Microsoft Research. This latest video on Channel 9 introduces the work his team are doing to make writing an application a single concept and then splitting it over tiers as required.

He talks about using a refactoring to split a class out into different parts for required tiers. For example, a model running on a client needs to talk to a database at some point. That part of the code needs to be running in a context that can access the database i.e. the server. The refactoring generates a service class that contains the database access code, and the client class is updated to call the service.

Apparently they are working to make this declarative. I imagine this looking something like:

[RunAtServer] void MyMethod(int id) 
{
  var people = from p in DB.GetPeople() where p.ID = id select p.Name;
  // etc...
}

Of course, the "macro" siren went off in my head. I could probably do something like this today in Boo or Nemerle. For making close-coupled systems (where data types are shared between tiers) this could be amazing. All we need is an assembly level macro that scans class for certain attributes and auto generates the required services, proxies and proxy calls.

When you have .NET running everywhere (i.e. Silverlight in the browser) this kind of magic becomes more of a reality. I'm also very interested to see the MSIL to JavaScript compiler Erik is working on.

Friday, July 13, 2007 11:22:55 PM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
Comments are closed.