Welcome to MSDN Blogs Sign in | Join | Help

Getting really started with Mce

This post is long overdue. I was held up with activities on CCF 2009 SP1 release, which will be out shortly. Let us get started with installing Mce.

Installing Mce

Mce is a core component of CCF framework. You can choose to install Mce framework components by selecting the “MCE Components” option under Framework in CCF 2009 installer as shown below

 image

Mce software factory and DSLs are present under Developer Tools and Samples section in the installer as shown below

 image

Please note that you should have Guidance Automation Extension version 1.4 installed for using Mce Software Factory. You can download it from http://www.microsoft.com/downloads/details.aspx?FamilyId=DF79C099-4753-4A59-91E3-5020D9714E4E&displaylang=en

image

Verifying Mce Installation

Mce framework is nothing but a set of .NET assemblies and you can find these in the Framework directory under your CCF 2009 installation folder.

image

To verify Mce software factory installation go to Add or Remove programs Applet in control panel and make sure you have the following components installed. If you have both Visual Studio 2005 and 2008 you will see Software Factory, WorkUnit and Logical View DSLs installed separately for 2005 and 2008.

image

Make sure that there is new Solution type “MCE Solution” in the New Project dialog in Visual Studio under “Guidance Packages”

image

After you create a Mce Solution you should see three menu options to create specific Mce project types.

image

In the Add new Item dialog you should see Item Templates corresponding to LogicalView and WorkUnit DSLs

image

In the next post I will show you how to create your first multi-channel enabled application

Posted by arkum | 1 Comments

Getting started with Mce

Understanding UI Process

Before we delve into Mce let us try to dissect the term UI process. A UI process should have its controller logic, in our case it is going to be Windows Workflow. Since a controller interacts with the views as well, we need to hold a reference to the views participating in the UI-Process. Next is the data (a.k.a Model in MVC). Hang on, the UI process that we are talking here has to be reusable across channels, hence it cannot be holding references to the views it driving.

There are multiple ways of fixing this problem, the most common is using a set of fixed interface that every participating view has to implement and controller (Workflow) communicates to the view(s) through this interface. This looks fine when you are developing a fresh set of user interface elements. What if you would like to re-use some of the views  (for e.g. windows user controls, web user controls etc) from your existing application? Re-writing each view to implement the interface is not going to be that easy. Another approach is to write the controller logic against a set of UI abstractions. i.e. your controller logic will be written against a set of user interface abstractions instead of an interface or the views themselves, let us call this abstraction as a Logical View.

WorkUnit

A reusable UI process contains the controller logic + a set of logical views (against which controller logic is written) . This concept is abstracted as a WorkUnit in Mce. Hereafter I will not be using the term UI process a lot , instead you will see references to WorkUnit a lot. A WorkUnit in Mce represents a reusable navigation logic written using the Workflow foundation workflow and associated Logical Views. I deliberately omitted the discussion about data here, but we will come back to how data  is handled in a WorkUnit in Mce.

LogicalView

As mentioned earlier, LogicalView is a channel independent abstraction of a Physical View (Windows form, Web User control, etc.). Hence a LogicalView contains properties (name and data type), events the view can raise and commands that you can perform on the view (or else functions that you can call on the view, if you have an instance of the view).

Navigational Event

In Mce a Navigational Event represents channel independent abstraction of an event that the physical view will raise, for e.g. if the user clicks the next button in the physical view, you may want your controller to react a Navigational Event called "Next". In short you can write your controller logic against logical views and navigational events from those logical views.

Navigational Workflow

Mce Navigational Workflow is the controller logic that you write using Windows Workflow foundation. You can write state machine or sequential workflows, state machines are the ones most commonly used.

Where is the Model?

We talked about controller and views. How about model/data?. In Mce data that the controller interacts is actually represented as properties in the LogicalView itself. Hence the navigational workflow that you write is actually a controller + data/Model. This is done for the obvious reason of moving the controller logic across channels. When you move the controller logic from one channel to another you get the updated data values as well.

Enough of this diatribe, in my next post we will get our hands dirty with Mce in CCF 2009, and I will be covering more concepts and related terminologies as we proceed

Posted by arkum | 0 Comments
Filed under: ,

Introducing CCF2009 and Mce

UI Process

Not a lot has been talked about UI Processes. You do a live search or google search for UI process and first result you get is Microsoft UI process application block. I tried Wikipedia for a standard definition without any luck. The only definition I could find is again from Microsoft UI Process application block tutorial which is

  • A user interface process — A set of user-related activities that achieve a goal.

 

Microsoft UI Process Application block is the popular framework in .NET which allows you to implement UI Process functionalities in your application. But if you look at the server side counterpart (I mean, Business process orchestration) we have many standards products and frameworks ranging from BizTalk to many ESB frameworks. Lets see why it pays to care about UI Process as well

MVC and UI Process

As the definition implies UI Process defines a navigational logic that you perform to achieve a goal (e.g. pay your Credit card bills online, Set archiving rules in outlook etc.).  To abstract away this navigational logic, we can use good old MVC pattern. Hence often when you talk about UI Processes you invariably end up talking about MVC and how you can centralize the controller logic

Controller and Windows Workflow Foundation

Windows workflow foundation’s support for creating state machines makes it an excellent framework for creating our controller logic. You can think of the navigational logic in a UI process as a set of state transitions that the views undergo in response to user events. Workflow Foundation’s excellent designer support makes it more compelling to use it to define your controller logic

Reusing the controller logic

Why should we ever reuse our controller logic? Enterprises are developing applications that already support multiple channels of interaction and most of them have ambitious plans for supporting more channels in future.  A channel here means the medium that user interacts with your application. E.g.  Web, Windows, Mobile are all possible channels.  There are two compelling reasons for creating reusable controller logic.

1.       To support more channels in future without re-writing your controller logic.

2.       Modify the controller logic centrally and at once and reflect it on multiple channels simultaneously

Most of the complex processes an enterprise has, do not necessarily start and end in one channel, instead they span across multiple channels. In this case how do you carry forward your navigational logic from one channel to other? Again Windows Workflow Foundation provides excellent support with passivation and rehydration of the state of the workflow. This means that if you write your controller logic (Navigation logic) using Windows Workflow Foundation you may be able to passivate the workflow in one channel and rehydrate in another channel. But again the workflow has to be channel agnostic.

Once you find that the reusability aspect of your controller logic is important, you start thinking how do I write my controller logic (State Machine Navigational Workflow) in a channel agnostic way? For e.g. you write a state machine workflow that drives a set of windows forms and you want the same workflow to drive a set of web forms or WPF forms. The best way to do is to create your workflow against a set of UI abstractions and depending on the channel the workflow is running it can drive either a set of windows forms or web forms or WPF forms.

CCF2009 and Mce framework

CCF2009 ships with Multi Channel Engine (Mce) framework which helps you to create channel agnostic workflows for your controller logic. Mce defines a set of UI abstractions and helps you to define your navigational workflow (controller logic) in a channel agnostic manner. In this blog I will be talking about how you can leverage CCF and Mce to create channel independent reusable UI Process for your application

 
Page view tracker