BloggersGuides.net
The unofficial product documentation

Oslo, WCF, WF & Dublin PDC Bits Review

One of the advantages attending a conference in the USA when you are from Europe is you have a lot of free time on your hands to play around with new technology. The disadvantage is that this time is usually between four and eight in the morning when you can’t sleep, and with the packed schedule of the conference activities and networking with others in the evenings it leaves you shattered by the end of the week.

I have used some of this jetlag induced free time to take a look at some of the "bits" that were distributed at the conference by the Microsoft Connected Systems Division (CSD). I have taken a quick run through of what is on the image, and will give you a few pointers about getting started with Oslo, Dublin, and the other .net 4.0 CSD goodness. Bear in mind that it's very early days (quite literally in my case), so some of this info may not be completely accurate, but hopefully it's worth reading if you plan on taking a look at the new bits. I’ve also recorded a webcast with a 20 minute talk-through and some very simple demos.

You should also bear in mind that a lot of the stuff is pre-alpha, meaning it was compiled from the latest builds that the various teams in the CSD had a couple of weeks before PDC. You may find that stuff crashes, does not behave as you would expect, and there may be sparse documentation. You will also notice that there are quite a few rough edges around some of the user interfaces. This is to be expected, and I am pleased that the people in CSD have chosen to give us a build to experiment with and gather feedback rather than waiting another half year or so before letting us get our hands on it. Be patient and think positive, this is the beginning of a very exciting journey...

I’ve also done a webcast with a quick tour if the image and demos of the main components.

Running the Image

The image file size is about 15GB, and has a base install of Windows Server 2008, with a Vista like desktop theme, that has been customized to provide a more friendly desktop experience. This seems to be all the rage right now; I have a similar duel-boot on my laptop that I find great to work with once you get it set up, more info on that here.

You will need some pretty serious hardware for the image to run effectively, on my laptop it was adequate for taking a brief tour, but it would be a painful experience to do any serious work with it. Running the image on an external USB drive (or a separate physical internal hard dive) will improve things greatly as Windows can be heavy on your C dive when you are using a lot of memory. To really enjoy using the image, you will probably need a workstation class PC. People have been raving about Hyper-V for running virtual images, so this might be worth looking at if you are running Server 2008 x64 as your host OS. It’s worth having 4G ram, so you can assign at least 2G to the virtual image.

The image has been created with a base VHD image (PDC08-CSD.vhd) and a difference VHD image (PDC08-CSD-WorkDisk.vhd) which will store all changes that are made to the hard drive as you work with the image. The VPC configuration file (PDC08-CSD.vmc) is configured to load the difference image, meaning that the file size will grow as you work with the image. As this can lead to a very large difference image, you may want to modify the VPC configuration to use the base image directly. To do this, in the VPC settings, select PDC08-CSD.vhd as the Hard Disk 1 image, you will also need to remove the read-only attribute from PDC08-CSD.vhd. Once you have modified the base image, the diff drive will be worthless, I’m not sure if any important changes were added on the diff drive, but I didn’t notice anything, and the small size indicates it can’t contain that many changes.

I also turned off the undo disks option, as I made a copy of the original image. Undo disks are cool, but it can take a long time to merge changes if you have been doing a lot of work, which can be a pain if you need to shut down in a hurry.

Unwrapping the Bits

The desktop background contains a number of links that will open up various applications and the hands-on labs. I've got into the habit of using the start menu and explorer more as I often have applications running that hide these links. I pinned useful stuff like IntelliPad, Quadrant, IIS Manager, Visual Studio etc to the start menu for easy access.

The main components that are installed on the image are as follows:

·         The preliminary release of software for code name “Oslo” and code name “Dublin”, including:

o   “Oslo” repository

o   “Oslo” SDK

o   “Quadrant”

o   “Dublin”

o   XAML Import/Export tool

·         Documentation for code name “Oslo” and code name “Dublin”, including:

o   Help

o   Hand-On Labs

·         Windows Server® 2008 Standard operating system without Hyper-V, including:

o   Internet Information Services (IIS) 7.0

o   .NET Framework 3.0 (includes ASP.NET)

o   Windows® Communication Foundation

o   Windows Communication Foundation Test tools

o   Windows Workflow Foundation

·         Microsoft® Visual Studio® 2010 Workflow Designer

·         Microsoft .NET Framework 4.0

·         Microsoft SQL Server® 2008 Enterprise Evaluation

·         Microsoft .NET Framework 3.5 with Service Pack 1 (SP1)

·         Microsoft Visual Studio 2010 Team System

·         Administration Pack for IIS 7.0 CTP2

Visual Studio 2010

I’d been prepared for a ribbon toolbar when I fired this up for the first time, but the general environment seems very similar to Visual Studio 2008, just goes to show not all the rumours you hear are true (at least not yet anyway). There are a few very exciting new features in this build that are worth exploring. Bear in mind that this build of Visual Studio was put together by the CSD team, so most of the new functionality is “Connected Systems” related. You will not find these components on the other Visual Studio 2010 virtual image.

Windows Workflow Foundation (WF) 4.0

The most dramatic change you will notice in Visual Studio is the new WF design experience. The sequential workflow designer has a completely different appearance to that of previous versions. In WF 3.0, the sequential designer was very similar to the BizTalk Server orchestration designer, using the same general layout, and many of the “shapes” in BizTalk were available as “activities” in WF. In .net 4.0 the activity designer now uses Windows Presentation Foundation (WPF) to provide a very different experience for designing sequential workflows. If you have worked with WF in previous versions, it may take you a while to get the hang of the new designer, and your first impressions may not be positive. As I mentioned earlier, it is still very early days, the final release will almost certainly be an improved version of what we are working with now.

The other big change you will notice is the inclusion of a flowchart workflow designer. This allows developers to lay out the activities in a more free-form way than in the sequential designer. I took a quick test drive and found that the shape placement was a little too free-form for my liking, and moving the shapes to line them up was a bit hit and miss. I also found the low-resolution on my laptop was not ideal for working with this designer.

Both of the workflow designers use a popup dialog box for defining workflow variables and parameters, and in WF 4.0 these are all declared in the workflow XAML, which is a very welcome addition. There is a zoom slider and a mini-map for navigating large workflows.

Another thing you may pick up on is the lack of activities included in the Workflow Toolbox. Activities like Delay, While and If are missing, which will limit the workflow scenarios that can be developed. There are some additional activities, Assign, Interop, Persist, DbQuery, DbUpdate, and ClientOperation and ServerOperation for web service integration.

A couple of features I really liked were the WPF activity designers and the improved designer hosting. In .net 3.0 and 3.5 I found building custom activity designers a fairly painful process, and very often just left custom activities with the default designer. In WF 4.0 the designer uses WPF, making it easy and fun to create custom activities. If you are not a WPF expert you can do something very simple, if you know WPF, you can easily create some very nice looking activities.

Designer hosting is a breeze; the lab will walk you through the process in about 20 minutes, which is a massive improvement on the previous versions.

There has also been a fairly major change in the class libraries in W¤ 4.0. I’ve not had a detailed look at it yet, but it seems like the structure of the core class hierarchy has been changed significantly.

Windows Communication Foundation (WCF) 4.0

There have been some exciting developments in the use of XAML for building declarative services in WCF 4.0. XAML as previously been extensively used in WPF applications, and there was the option to declare workflows declaratively in WF. We now have the support for declarative services in WCF, which is a welcome addition. You can investigate this by creating a new DeclarativeSequentialServiceLibrary project in Visual Studio 10, which will contain a declarative workflow service named Service1.xamlx. The designer and tools for this workflow seem pretty basic at present, for example I have not found a way to add xamlx workflows other than copy and renaming the original template. The service contract editor is also pretty basic, and will hopefully be significantly improved to allow better productivity when working with more complex contracts.

Codename “M” Project Template

There is an additional ModelingProject template type that is used for creating “M” based modelling projects. I have only really used IntelliPad to work simple prototypes with the “M” language, but for more complicated scenarios, Visual Studio will be the way to go. The Models project that was used for creating the repository database is available in the samples section if you want to see a large “M” project in Visual Studio.

Oslo

Oslo consists of three main components a repository database, a modelling language (codename "M"), and a "Universal Editor" (codename "Quadrant"). There is also a new text editor called IntelliPad, a new modelling project template in Visual Studio, and a "M" compiler. The image contains early builds of all three of these technologies.

Oslo Repository Database

The Oslo repository database has been installed in the SQL Server 2008 instance on the image.  To view the database, open the SQL Server 2008 Management Studio and select it. If you expand the table structure, you will see there are large number of tables relating to the various artefacts that can be stored in the repository.

The schema names feature of SQL has been used to create a storage structure that reflects some of the net class library namespace. If you are a WCF developer you should take a look at the System.ServiceModel section and check out the tables used to store WCF related information. These tables will be used by the Quadrant editing toolbox to allow users to model service contracts and persist the models to the repository database.

The information in the repository database is intended to be “transparent”, meaning it should be easy to query and modify with custom tools. This is a welcome change, as the BizTalk databases were “owned” by Microsoft, it seems like the Repository will be more open both in terms of data content and structure. There seems to be quite a number of models present in the database, but it is designed to be extensible by using the “M” modelling language to design data models that can then be imported to the repository.

IntelliPad

IntelliPad is a text editor that can be sued for prototyping and developing models using the “M” language, and domain specific languages using the “Mg” language. There were a lot of rumours sating that IntelliPad would be “Emacs.net”, but as I’ve never used Emacs, I could not make the comparison.

IntelliPad provides a good environment for prototyping “M” and “Mg” scenarios, providing quick feedback on what the developer is typing. The experience falls somewhere between Notepad and Visual Studio, resulting in a lightweight application that provides features like syntax colour encoding, and basic IntelliSense.

My favourite feature of IntelliPad is the “Dynamic Parsing”, which will show the SQL output that is created from you “M” instantly as you edit the code. This is a really nice way to learn “M” as you see the results of code immediately, allowing you to experiment freely with the language.

"M"

 “M” is a text based declarative data modelling language aimed at “curly brace” programmers. It initially started out being called “D”, but was changes to “M” shortly before PDC. “M” was created for declaring the models that are present in the repository database. There is a project in the samples folder that appears to be the “M” source files that have been used to create the repository, but I have not confirmed this.

The best way to start learning “M” is to use IntelliPad to declare a model, and then see the representation of that model in SQL. The “M” compiler can currently create two forms of SQL.

·         Rich – For importing models into the repository

·         Reach – Standard SQL for using in a regular databases

My immediate thoughts when using “M” were that it would be a great way of modelling regular relational databases in SQL Server. This view has been echoed by others that have worked with “M”. One of the reasons for using a text based language for modelling is that most programmers find that code is much more productive that working with graphical tools, and this is certainly the case with “M”. It took me about 30 minutes to get the basics of “M”, and a few hours to explore a few of the language features, and start creating simple models. I would imagine most developers will pick it up very quickly.

M Code

The following “M” code declares types for Employee and Department. Extents for those types are then defined, and relations between these extents defined.

module BloggersGuides

{

    // An Employee type

    type Employee

    {

        Id : Integer32;

        FirstName : Text;

        LastName : Text;

        Department : Department;

    } where identity Id;

    

    // An Employees extent containing zero or more employees.

    // Each employee belongs to a department.  

    Employees : Employee* where item.Department in Departments;

   

 

    // A Department type   

    type Department

    {

        Id : Integer32;

        Name : Text;

        Manager : Employee;

    } where identity Id;

   

    // A Departments extend, each department has a manager

    Departments : Department* where item.Manager in Employees;

}

 

Reach SQL Created by “M” Model

When the “M” model is compiled into “Reach” SQL, the following code is created. This can then be used to create the database that can be used to store instances of the employees and organizations.

set xact_abort on;

go

 

begin transaction;

go

 

set ansi_nulls on;

go

 

create schema [BloggersGuides];

go

 

create table [BloggersGuides].[Employees]

(

  [Id] int not null,

  [Department] int not null,

  [FirstName] nvarchar(max) not null,

  [LastName] nvarchar(max) not null,

  constraint [PK_Employees] primary key clustered ([Id])

);

go

 

create table [BloggersGuides].[Departments]

(

  [Id] int not null,

  [Manager] int not null,

  [Name] nvarchar(max) not null,

  constraint [PK_Departments] primary key clustered ([Id]),

  constraint [FK_Departments_Manager_BloggersGuides_Employees] foreign key ([Manager]) references [BloggersGuides].[Employees] ([Id])

);

go

 

alter table [BloggersGuides].[Employees]

  add constraint [FK_Employees_Department_BloggersGuides_Departments] foreign key ([Department]) references [BloggersGuides].[Departments] ([Id]);

go

 

commit transaction;

go

 

Quadrant

Quadrant (or “Q” to follow the James Bond naming convention) is an application for editing content in the repository database. A very early prototype of Quadrant made a brief appearance at the SOA & BPM conference in Redmond in October 2007, there is a photo of this presentation here. Since then the development of Quadrant has been kept under wraps, as Microsoft were not releasing much public information about Oslo. From the screenshot below it can be seen that Quadrant has changed substantially in that time.

Quadrant borrows the ribbon interface from Microsoft Office, as it is targeted at “Business Analyses” as well as architects and developers. Whilst “M” is used to define models, Quadrant is used to create and manage instances of models.

There are a number of models in the repository database, and it is possible to view these models and manage the instances of these models.

Hands-on Labs

 There are a number of hands-on-labs that you can run through to get an idea of how things work. They cover the basics of most of the technology on the image, and take about an hour each on average to run through.

When working with the Visual Studio based labs I like to have the instructions in Visual Studio. To do this:

·         Open the lab instructions in Word

·         Save the document as HTML filtered

·         Open the HTML file in IE

·         Start Visual Studio and view the web browser

·         Paste the link form IT into the VS web browser

·         Create a splitter window so you can see the instructions while you work

Documentation

If in doubt, read the documentation. BizTalk Server 2004 had a bit of a reputation for lacking somewhat in the documentation department when it was first released. The PDC08-CSD image seems to have quite  bit of documentation available, though it varies in depth quite a bit for the different technologies.

As the CHM format has been used it's possible to copy the documentation onto your host PC and read through it without having to have the image running, this is a great advantage if your laptop is anything like mine. There seem to be quite a few "How to" walkthroughs that you can try out to learn how thing work, some of these seem close copies of the hands-on-lab, but others are different. There is a lot of detail in some palaces, basic detail in others, and a few pages here and there that are just placeholders, hopefully this will be expanded in future builds. I personally think it's challenging to have to figure some stuff out yourself, it gives you a deeper understanding of what is going on, kind of like back in the early days of BizTalk Server 2004.

Conclusions

I'm sure I'm not the only one who has been getting their hands messy with these new bits, so I'd love to hear from anyone else that has some ideas to share. As the NDAs have been lifted somewhat, people can now talk openly about this technology and share ideas, opinions, and experiences on their blogs. I will look at getting a new version of "The Bloggers Guide to Oslo & Connected Systems" out as soon as there is some more content on line. If you would like to contribute, let me know, I'm sure the next few months will see some outstanding contributions from the Connected Systems developer community.

Powered by Community Server (Commercial Edition), by Telligent Systems