Ziff Davis EnterpriseDevLife
Advertisement
Advertisement

Thursday, May 03, 2007 1:47 AM/EST

Jasper and Astoria preview at MIX

Jasper and Astoria are code names for two incubator projects that the data access team at Microsoft is working on.

Both of these are projects that build on top of the Entity Framework (and I bet the first of many).

It's the first look at how the Entity Framework becomes a foundation for future data access technologies.

I wrote a little about Astoria as I sat in Pablo Castro's presentation on Monday. You can read that here and find links as well.

Here is the post about Astoria on the ADO.NET Team blog.

Today I attended the Jasper session that was given by Shyam Pather and Sam Drucker. Shyam is a Dev Lead on the data programmability team and Sam is the Product Unit Manager.

Here is the ado.net team's blog post on Jasper.

Jasper is a tool (and no, it didn't escape me that this is yet another...) for dynamically generating a data access layer using dynamic .NET languages such as IronRuby, Dynamic VB, etc.

Jasper infers classes from a database by way of an Entity Data Model, but it does it at run-time on the fly.

You could simply point Jasper, using a connection string, to a database and then write queries using Entity SQL or Linq to Entities against it.

Yes, here is where we need to pause. How is this different from what we are doing with LINQ to SQL and Entity Framework? With these, the classes are created at design time and all of the programming against them is done using these strongly typed classes.

With Jasper, we are using the dynamic languages because so that we can write code against classes that don't exist yet. (Note that there are definitely plans to get intellisense to work with this in the same way that it does with LINQ to XML in Visual Basic and with Javascript--both in Orcas.) If you choose to let Jasper build the EDM on the fly (a setting in the connection string) then that will happen when you run your code. A default EDM will be built based on the database that you pointed to and then the queries in your code will work against the EDM. At this stage in the game, you are now doing what you can do in the Entity Framework goo.

Shyam refers to this as "the easy button for Entity Framework."

If you want to have more control over these inferred classes, you can create your EDM in advance with the existing Entity Data Model Wizard and the designer that we will see in the near future. In this case, you would point the connection string to the existing model, rather than tell it to build one on the fly.

But wait there's more. When coding, the main class for working with the inferred classes is the DynamicContextClass. From here, you can drill into the entity classes or build queries (again, using either Entity SQL or LINQ to Entities).

Once you have your data in hand, the new AutoDataSource (for asp.net) and AutoBinder (for WinForms) can be used to bind to datacontrols in your apps. We saw this working with the upcoming ASP.NET ListView control. But again, with the goal of true simplicity, it isn't necessary to write a heck of a lot of databinding code.

In an ASP.NET app, the key elements to doing the databinding are as follows:

1) In the web page markup, you need to create an AutoDataSource:

3) In the markup, create a data control and bind it by simply by setting the ID property to your desired source. Here is an example that binds one property to a listbox and then uses a relationship to populate a details view. When the listbox changes, the detailsview will pick up the correct related data (products for a category). Jasper will search the inferred classes for the properties that match the IDs. You can see how quickly you may want to create your own EDM if your database is not simplistic.

Remember, that is it for databinding... most of the hard work is done automatically.

You can extend the inferred classes by creating specifially named classes with Get and Set properties. eg a class named LastName with properties GetLastName and SetLastName can intercept actions on the LastName field.

Jasper has been added to the MIX sandbox. www.mix07.com

You can also get a download and learn more about jasper and Astoria here.

Pablo's talk on Astoria (called Accessing Data Services in the Cloud) is online already.

Sam and Shayam's talk on Jasper (called Data Driven Web Pages with ADO.NET) is not online quite yet.

You can find the MIX session videos at sessions.mix.com.


TrackBack

TrackBack

http://blogs.devsource.com/cgi-bin/mte/mt-tb.cgi/10894

Post a Comment

 
 

Advertisement

Syndication

Subscribe: