PDC 2009 - Being in Windows Azure:)
18 November 09 11:13 PM | mszCool | 0 Comments   

At PDC in the expo-hall they have a container as it will be used as deployment-unit in the new Microsoft-Data Centers such as the Chicago data center. Pretty cool, we’ve been looking at this one... pretty funny;)

PICT3800 PICT3809 PICT3807

PDC 2009 – In my opinion a more consistent platform story than last year… Windows AppFabric & Co
18 November 09 08:15 PM | mszCool | 0 Comments   

While Max is blogging on codefest.at about todays key note, where Steven Sinofsky came up with a Windows 7 Acer Laptop as a gift for every attendee, I thought it’s a good time for a short note.

In my very personal opinion, compared to last year’s PDC Microsoft’s overall platform story is much more consistent than last year. It’s great to see, how the symmetric platform story (on-premise & cloud) is evolving and is really getting into a strong and easy-to-understand picture.

In my opinion some of the strongest announcements during yesterday’s sessions were the following:

  • Windows AppFabric – finally our project codenamed “Dublin” has a roadmap with some cool investments and ideas. Providing a common deployment, monitoring and caching-infrastructure for WCF, WF and applications is a very good step. And in 2010 we will see AppFabric being included in Windows Azure providing the same feature-set as we have it on-premise.
  • Common management possibilities for on-premise and cloud-based applications hosted in Windows Azure through System Center.
  • Launch of the Windows Identity Foundation (WIF) and the fact that ADFS v2 will get into RC this calendar year and into RTM early 2010.

I am especially conviced by Windows AppFabric as application-server bits built on-top of IIS. Windows AppFabric as a first deliverable for the on-premise world puts together things we know from “Dublin” (WCF and WF management and monitoring tools on-top of IIS 7) and Velocity (distributed caching framework).

And further things are planned in the road map. Especially the long-term vision Microsoft presented yesterday in terms of having a common app-server infrastructure that unifies deployment, management, monitoring, caching etc. across on-premise and cloud-based applications sounds cool. Great is the idea and the vision of bringing the concept of roles such as web roles and worker roles we know from Windows Azure into the on-premise world, as well. Therefore we then would have a fully unified model between the cloud and the on-premise world. That’s really promising…

Also the announcement, that BizTalk Server will integrate with AppFabric and leverage the monitoring and management functionality. That’s nice as then BizTalk will be able to leverage the integrated distributed caching features, the management features etc. Also with BizTalk 2009 R2, the team will add Visual Studio 2010 and .NET Framework 4.0 support – at least promised at PDC 2009;) We’ll see where this journey will go...

I really hope that Microsoft is able to get these ideas on the ground fast:) At least the first bits are available, already:

Windows AppFabric Beta 1 home page:
http://msdn.microsoft.com/en-us/windowsserver/ee695849.aspx

Windows AppFabric for the Cloud home page:
http://www.microsoft.com/windowsazure/developers/dotnetservices/

Windows Identity Framework RTW:
http://www.microsoft.com/wif

BizTalk Server Roadmap including outlook on WCF/WF support
http://www.microsoft.com/biztalk/en/us/roadmap.aspx
News on Infoworld.com about BizTalk 2009 R2

Live from PDC 2009 in L.A. – Windows Identity Foundation Released and further cool announcements…
18 November 09 01:06 AM | mszCool | 0 Comments   

image This morning at PDC 2009 I joined a session from Mr. Identity himself, Kim Cameron. Kim gave a very interesting update on Microsoft’s Identity strategies.

PICT3681 For me, THE most important announcement was the release-to-web of the Windows Identity Foundation.

http://www.microsoft.com/wif

With that, building claims-aware applications on the .NET platform for heterogeneous environments gets reality. And guess what, now at PDC 2009 they also announced what I’ve been waiting for a while now as customers are requesting that again and again:

  • PICT3696 Microsoft Dynamics CRM “5” will support claims based on WIF for on-premise, hosted and cloud-instances.
  • SharePoint 2010 now has officially announced, that they will have claims-support built-into the SharePoint-platform. That means, using SharePoint in heterogeneous environments will get much easier. To give you a short impression, just see the image right to this bullet-point from a session I am attending right now on claims in SharePoint 2010...

A few further announcements I found really interesting in addition to the “cases” SharePoint 2010 and CRM “5”, that were mentioned in the key note today, as well, are

  • PICT3685 Work on a REST-based authentication kit to support claims for simpler, REST-based scenarios (AJAX etc.) called OAuth Web Resource Authorization Protocol (WRAP) where Microsoft, Google and Yahoo are working together (interesting, but cool;))
  • Support for Simple Web Tokens (SWT) based on OAuth WRAP.
  • LiveID will become an OpenID provider during the calendar year 2010 as you can see in the image above.
  • CardSpace and OpenID alignment in terms to be able to select an OpenID as an easy-to-understand information card from your digital CardSpace wallet in CY 2010.

These are pretty cool news for anyone interested or working on claims-based security...

ARC305 Downloads – My Session @ TechEd Europe in Berlin on “Always Responsive Apps & Services”
11 November 09 04:46 PM | mszCool | 1 Comments   

Right before my session is going to start here in Berlin at 5.30 p.m. I found time to upload my demos and slides. The session is all about approaches and thoughts we implemented in a project together with Frequentis AG, a globally active ISV building solutions for public safety. These solutions span air traffic control, maritime communications, police- and fire-department control and communication etc.

All the approaches and information from the session is from a whitepaper I’ve published earlier and I’ve created together with architects from Frequentis.

I’ve published the PoC which is the demo-solution I use for the session earlier, but for TechEd I updated the PoC the whole solution to Visual Studio 2010 Beta 2.

Click here to download the Proof-of-Concept demo app (VS2010 b2).

Click here to download a PDF of my presentation.

Click here to get to the whitepaper we’ve published with Frequentis.

Important Notes for testing

If you want to test the PoC you need the following bits installed on your machine:

Visual Studio 2010 Beta 2

Microsoft CCR and DSS Runtime Toolkit

SQL Server Express Edition (DB-scripts included in the PoC download)

If you don’t have Microsoft CCR installed, then you can remove the CcrManager.cs class in the AsyncDemo.JobLibrary project in the Shared-folder of the solution. Furthermore you need to remove the references to the Microsoft.Ccr.*.dll assemblies.

Have much fun, I hope you enjoy(ed) my session:)

3rd Interoperability Council on November 5th
09 November 09 07:07 PM | mszCool | 0 Comments   

Last week, on November 5th 2009, we had our 3rd Interoperability Council in the Microsoft Innovation Center in Vienna. The council is an Interop. Council 5.11.2009 029independent group of technology experts that discusses current interoperability-challenges between the Microsoft platform and other platforms.

Of course a special focus of this group are local and regional standards as global standards are mostly addressed by the Microsoft corporation, itself. During the meetings we typically discuss current issues and try to identify ways (processes, approaches etc.) for solving these problems together. We are really running this in a very pragmatic way – as soon as the council identifies benefits for all parties (customers, partners, Microsoft), we try to find ways for taking on the challenges.

Results from the council of the previous months

The council was founded with his first meeting on February 10th 2009. In this first meeting we also identified a few potential challenges. For two of them we organized what we call interoperability labs, for one I’ve written an article and published it on my blog last week.

In a lab we typically setup 2-3 workshops of 1-2 days with a small  sub-group of the council and experts the members of the council are brining into the game. During these labs we either really work on concrete concepts or even source code (depending on the type of Interop. Council 5.11.2009 025the lab) to solve a certain, strategically important challenge. The idea is really to bring together a group of bright people in a very pragmatic way and try to find ways for dealing with interop-challenges identified by the council. If we come up with concrete results then it’s a success, if not, then we know at least, which further actions we would need to take for dealing with a challenge, how big the necessary investment would be and whether driving further investigations is worthwhile or not! Fortunately with the previous labs we were successful. The results of our council are remarkable:

e-card Interop-Lab

Published Open Source Components
Published a business-article (German) on our team-blog
Published a technical article of the results on my blog

e-Government Portal-Connection-Protocol

Published Open Source Components
Whitepaper on supporting this Austrian eGovernment standard

Identity Interoperability

Article on Identity Interoperability (incl. PoC with Metro/WSIT)

If you are interested, then just read on our team-blog on the council (German, only). Now were going into the next phase and looking for further, important interop-challenges. Let’s see what happens and what the council will come up with in the next months!

Cheers
Mario

Identity Interop Update for our Interoperability Council: ADFS v2 and WIF Interop with Sun OpenSSO, Novell Access Manager, CA, OpenID and Sun Metro / WSIT
05 November 09 02:30 PM | mszCool | 0 Comments   

As today we’re going to host our 3rd Microsoft Austria Interoperability Council, I thought that in addition to our existing results we’re presenting today, it’s a good time to publish an update of my Identity Interoperability Demos and samples I created earlier this year.

Furthermore, based on the feedback of members from our interop-council, I’d like to provide a few links with more information on Identity Interoperability between Microsoft Windows Identity Framework (WIF) and Active Directory Federation Services v2 (ADFS v2- both formerly codenamed Geneva Framework and Geneva Server).

The Foundation – OASIS Identity Metasystem

Primarily the foundation for all these interoperability thoughts is the Identity Metasystem vision originally started by Kim Cameron (Microsoft – see article on MSDN). More information on the official standards can be found on the following link:

http://docs.oasis-open.org/imi/identity/v1.0/identity.html

Sun Metro / WSIT Interoperability

The interop-identity PoC I’ve created demonstrates interoperability with Sun Metro / Web Services Interoperability Toolkit. For the PoC you need a Glassfish v2 application sever to host a Java-based Relying Party and integrate this RP with a .NET-based Security-Token-Service (STS) and a .NET-based client. The PoC shows, how you can integrate Java-based services in a Windows-based security-infrastructure based on standards.

Click here to download the lates version of my ID-Interop-PoC

Click here to view my previous blog-entry on how-to setup the PoC

Note, that the download package is a little big larger this time. You don’t need to download any additional bits. Everything including all Java-Pre-Requisites is included, except Microsoft Geneva Beta 2 (click here to download).

Interoperability with CA, Novell Access Manager, Sun Open SSO

While working with colleagues (Michael Steinböck, Dominik Paiha from Microsoft) on a proposal for a customer (who is also a member of the council) on identity interoperability, we’ve collected a number of additional resources on identity interoperability. First and foremost I would like to mention papers on interop between Sun Open SSO, Novell Access Manager and CA.

Click here to download Interop-Whitepapers for ADFS v2 (Geneva)

OpenID Interoperability with Microsoft ADFS v2 and WIF

Also a question continuously asked is the interoperability between the Microsoft-platform and OpenID. Of course OpenID can be used as a means of authentication on top of a WIF/ADFSv2-based STS.

Thanks to Matias Woloski who is working very close with Microsoft’s patterns & practices team, you can find more information and a conceptual view below (click image to enlarge):

Click to read Matias’ blog entry on OpenID integration

Click to get to DotNetOpenAuth, a library for .NET-OpenID-integration

Download .NET Open Auth here

20091105_OpenIDInterop[1] 

Novell Bandit Project provides Information-Card Interoperability

bandit-logo In partnership with Microsoft, Novell is working on an initiative called “The Bandit Project”. This initative provides components and source code to implement a complete Identity Metasystem-based solution with STS, RP and even identity selectors (DigitalMe) for clients. To get these components to ensure complete interoperability of your Java- and browser-based components and end user experience on Linux, click the link below:

http://www.bandit-project.org/

Identity Interoperability with IBM Tivoli

At last year’s PDC 2008, Vittorio Bertocci and Kim Cameron demonstrated interoperability with IBM Tivoli access manager and ADFS v2 / Geneva Framework.

Take a look at Vittorio’s blog here for more details.

Click to view the session, directly, and get the info from live-demos.

Interoperability between Shibboleth and ADFS

Microsoft published a guide on interoperability between Shibboleth and the Microsoft platform for it’s previous version of Active Directory Federation Services, already. Of course this guide is still available.

Download Shibboleth – ADFS Interop here.

With ADFS v2, Microsoft is implementing the SAML 2 protocol in addition to the WS-* protocols which are available in both, ADFS v2 and the Windows Identity Framework. Having that said, interoperability will be given for Shibboleth and ADFS v2, as well. I’ve found the following references on this interoperability and I’ll continue my search to find or build more concrete step-by-step guides and samples on this kind of interoperability:

Geneva and SAML 2 from Don Schmidt of the identity-team

SAML 2 protocol and Shibboleth Interop-Announcement

Patterns & Practices Identity and Access Guide

Finally I wanted to share one last, extremely important resource. My friend Eugenio Pace from the Microsoft patterns and practices team in Redmond is currently working on a PnP-guide on identity and access management using ADFS v2 and WIF. This guide is currently under development and is published as a open project on www.codeplex.com. That means, feel free to start reading through the guide and provide the PnP team with feedback as much as you can and about all the things you would love to read there.

They are also working on a guidance on how-to implement BOTH, single-sign-on (which is available out-of-the-box in Geneva) and single-sign-off, which is a very special challenge, typically!"

Click here to get to the guides workspace on codeplex.

Click here to get to Eugenio’s blog.

Final thoughts

I think, these are some of the most important pieces of information, architects and developers need when it comes to thinking about identity interoperability. I personally strongly believe in all the parts of the identity metasystem vision and claims-based security. I also see, that most of the vendors are (slowly) moving towards this direction with their products and offerings.

So stay tuned, keep your eye on all these things.

Cheers
Mario

Internet Explorer 8 – All-In-One-Demo for Web Slices, Accelerators and Open Search Integration
30 October 09 07:23 PM | mszCool | 0 Comments   

Today based on some customer project requirements, Max and I together created a very simple and easy-to-understand all-in-one demo to show, how-to integrate Internet Explorer 8 features into your own web sites.

Download the sample web site here!

As for us the localization of the content for our local audience was core, we published the whole documentation in German on our local team-blog including detailed explanations and code-snippets.

Take a look at the article in German on our team-blog here!

Generally speaking, in my opinion these new little gimmicks in IE8 are pretty cool for end users and are more than easy to be integrated into your web pages... and they do not disturb any other browsers, at all. So for me that’s just a win-win-situation...

Microsoft Office 2007 – Update Registration Info Tool for my Cousin…
29 October 09 12:11 AM | mszCool | 0 Comments   

My cousin wanted to update the registration-information specified while installing Microsoft Office 2007. When he asked me I realized, that for the default values of user name and the initials Office 2007 offers a UI – but it doesn’t provide a possibility to update the company name. Furthermore I realized, that PowerPoint reads the information from the Installer-Data registry-hive.

So I created a little tool for him to update all registration information to have the right default values for Word, Excel and PowerPoint (haven’t tested with the other tools;)).

Download the source code for the tool here.

Download the binary for executing the tool directly, here.

I know, it’s not an architect’s job writing such little tools... but almost too often I love doing these little things:)) ... little fun stuff:))

Windows Communication Foundation and SOAP with Attachments Message Encoder built in Interop-Lab with SVC (Sozialversicherungs-Chipkarten Betriebs- und Errichtungsgesellschaft m.b.H.))
19 October 09 09:00 AM | mszCool | 0 Comments   

As some of you know I am the founder and owner of the Austrian Microsoft Interoperability Council. The council itself is a group of experts and influencers on the Austrian market that is working together with us for identifying interoperability challenges between the Microsoft-platform and other platforms based on local, regional and global standards.

One of the aforementioned local standards in Austria is the interface for programmatically accessing and using services offered by the Austrian National Insurance through their electronic health care card (e-card). These interfaces offer a variety of services that allows medical software to integrate with offerings from the Austrian National Insurance. Essentially these services are built as a set of web services that can be called from medical applications. Using these web services from the Microsoft-platform (and from other platforms) is essentially very easy - with two exceptions!

Two services allow uploading and downloading electronic documents as attachments to the actual SOAP-message. Examples are electronic referrals or Medication Approval Service (= special medication has to be approved by controlling doctors of health insurance institutions). These web-services use SOAP-With-Attachments for adding the electronic documents as attachments to the actual web service message. SOAP-With-Attachments is an older standard for attaching binary data to web service messages which is still valid. It gets replaced slowly by newer standards such as MTOM. Therefore the current version of WCF and future versions of WCF do not support SOAP-With-Attachments - WCF comes with an MTOM message encoder, only.

The missing encoder affects every doctor software and hospital software vendor of the Austrian market that builds his software on top of the Microsoft-platform incl. .NET. And most of the vendors are building their doctor software on top of the Microsoft-platform; therefore they are all affected if they don't want to parse messages manually.

Together with the company that is running and building the services for the Austrian National Insurance, SVC Chipkarten Betriebs und Errichtungsgesellschaft m.b.H., we organized an interoperability lab within our interoperability initiative to solve this problem for the Austrian doctor- and hospital-software vendors. For doing so, in this lab together we built a SOAP-With-Attachments message encoder sample for WCF and tested it against the affected services together with the e-card.

Of course, based on the principles of our interoperability council and initiative, we published the results of this interoperability lab as open source samples on the Microsoft codeplex-platform.

Click here to go to the Codeplex workspace and download the sources.

Please note that these components are sample-components, therefore using and building on-top of these components is at one's own risk and there will be no official support by SVC or Microsoft.

Using the Encoder

Using the encoder is pretty simple. First of all you need to add a reference to the encoder project we're providing in this workspace. After you've done that you can configure your WCF-service to use the encoder. Note that both ends, the service and the client, need to use the same encoder! Here is some sample configuration

   1: <configuration>
   2:   <system.serviceModel>
   3:     <extensions>
   4:       <bindingElementExtensions>
   5:         <add name="swaMessageEncoding"
   6:              type="Microsoft.Austria.WcfHelpers.SoapWithAttachments.SwaMessageEncodingElement, 
   7:                    Microsoft.Austria.WcfHelpers.SoapWithAttachments" />
   8:       </bindingElementExtensions>
   9:     </extensions>
  10:     <bindings>
  11:       <customBinding>
  12:         <binding name="SwaTestBinding">
  13:           <swaMessageEncoding innerMessageEncoding="textMessageEncoding">
  14:           </swaMessageEncoding>
  15:           <httpTransport maxBufferSize="62914560"
  16:                          maxReceivedMessageSize="62914560"
  17:                          authenticationScheme="Anonymous"
  18:                          proxyAuthenticationScheme="Anonymous"
  19:                          useDefaultWebProxy="true" />
  20:         </binding>
  21:       </customBinding>
  22:     </bindings>
  23:     <client>
  24:       <endpoint address="http://localhost/fakeservice/"
  25:                 binding="customBinding"
  26:                 bindingConfiguration="SwaTestBinding"
  27:                 contract="IMyContract" name="MyServiceEndPointName" />
  28:     </client>
  29:   </system.serviceModel>
  30: </configuration>

After you have done that you can leverage the OperationContext of WCF to attach binaries to outgoing messages or retrieve binaries received by incoming messages. The most important for clients is, that you need to setup an operation-context before calling a service with your generated proxy as follows:

   1: using (OperationContextScope Scope = 
   2:         new OperationContextScope(Client.InnerChannel))
   3: {
   4: }

Note that these lines-of-code are necessary for clients, only, as in your services you usually have an OperationContext available, already. After you have your operation context, it is as simple as follows to attach binaries to outgoing messages or get binaries from incoming messages:

   1: // Add outoing attachment
   2: OperationContext.Current.OutgoingMessageProperties
   3:                          [SwaEncoderConstants.AttachmentProperty] = ZipContents;
   4:  
   5: // Receive incoming attachment
   6: byte[] b = (byte[])OperationContext.Current.IncomingMessageProperties[
   7:                                          SwaEncoderConstants.AttachmentProperty];

Note, that my implementation currently supports single attachments, only. But of course as this is an open source sample feel free to download the source code and extend it as you need it.

Final Words

In my opinion this is a great result that can be achieved simply through an open discussion and by exchanging experience, idea and knowledge in our interoperability council. This work was an exceptional partnership that (hopefully) helps hundreds of medical software vendors - this is the kind of impact I love to see out of the interop-initiative we're running in Austria - results that help a large part of the local software market!

DevCamp 2009 – My Session on Always Responsive Applications and Services covering .NET 4.0 Task Parallel Library and CCR with Connection to a Real-World Scenario
15 October 09 11:57 AM | mszCool | 0 Comments   

Maybe some of you have read the Whitepaper I’ve written together with two architects from Frequentis AG (Ulrich Hüttinger and Stefan Domnanovits) a few months ago. At the DevCamp 2009 Conference I baked that into a session now!

Download the paper by clicking here if you haven’t read it, yet.

Finally after giving a presentation at TechReay, Microsoft’s internal conference for technical and strategic education, I managed to give a “fine-tuned” version of the session for the first time in Europe – at our local Developer Camp 2009 conference organized by key-partners of Microsoft in Austria.

If you’re interested in seeing the concepts of the paper in action using .NET 4.0 Task Parallel Library, then check out the presentation material and the running demo solution.

Download the Demo and Presentation here!!

The demo solution isn’t an easy thing, it’s really a little prototype to show the job/queue/command pattern using Task parallel library in an end-2-end-fashion:

  • client doing his tasks with Jobs in the background to be always responsive
  • little service bus example sitting in the middle coordinating the communication between all working positions and a few back end services.
  • back end services leveraging the “job-pattern” as well for asynchronous and scalable processing of incoming requests.

Note that the sample also includes a CCR-based implementation. If you don’t have CCR/DSS installed on your machine, just comment-out the CcrManager-class in the JobLibrary-assembly.

As promised I will provide the back-port to Visual Studio 2008 containing just the CCR-based implementation so that those who don’t have Visual Studio 2010, yet, will have a chance to take a look at the sample, as well!

If you have any questions, feel free asking me!!!

DevCamp 2009 Conference – Key Note on Windows Azure with Step-By-Step Guide in Slides on how-to get your Azure Token!!
15 October 09 11:35 AM | mszCool | 2 Comments   

It was a great pleasure for me to be part of the opening key note at our 3rd Developer Camp conference organized by some of our key partners in Austria (Techtalk, Cubido, CSS and Kentiko).

During this key note we introduced the Windows Azure platform to about 170 developers. Note that I also have a detailed description baked into the slides including screen shots to show you, how you can get access tokens for Windows Azure to test out the platform before the billing starts after PDC this November.

You can download the key note material incl. demos here.

Below are the direct URLs for requesting tokens for Windows Azure and SQL Azure:

Step 0: Register for Microsoft Connect if you haven’t done, yet
https://connect.microsoft.com/profile.aspx

Step 1: Fill out the sourvey “Register for Azure Services” on connect
http://go.microsoft.com/fwlink/?LinkID=129453
Note that for each Live-ID you can fill-out the survey just one time.

Step 2: Register for SQL Azure
http://go.microsoft.com/fwlink/?LinkID=149681&clcid=0x09

Step 3: Usually it takes about 48 – 72 hours before you get the confirmation (depending on the interest of users it might take longer).

Step 4: After you’ve received the keys, sign-in to Windows Azure
http://lx.azure.microsoft.com/fs

Step 5: Activate your Azure Account with the tokens by clicking on the account tab or navigate to it directly and enter your tokens:
https://windows.azure.com/cloud/account.aspx

Step 6: Activate Your SQL Azure Account with the token received by navigating to the SQL Azure homepage
https://sql.azure.com/InvitationCode.aspx

ASP.NET MVC Demo Application – Austrian Re-MIX Conference from October 1st 2009 – Updating (complex) object hierarchies using ModelBinder
02 October 09 06:17 PM | mszCool | 0 Comments   

Yesterday we had our Austrian version of the Re-MIX conference in the Hilton Hotel at Stadtpark in Vienna. It was a great conference combined with a superb architect forum together with Simon Guest, who unveiled his thoughts on cloud computing… but more on that in a separate post, this one is about the ASP.NET MVC session I delivered in the late afternoon in the web dev track!

An ASP.NET MVC Walkthrough & Updating object hierarchies…

In my session “Introducing the ASP.NET MVC Web Development Framework” inspired by Phil Haack’s session at the last MIX-conference I demonstrated, what development with the ASP.NET MVC framework looks like.

Download the sample here

Download the slides here

In the session I created a simple application for displaying, modifying and adding events with event deliveries, from scratch. The following graphic shows the entity data model we’ve been working with:

image

As you can see, a single Event has multiple deliveries at different locations. While implementing the controller actions for adding new events and modifying existing events I was challenged by the question, “how the model binder updates object hierarchies”. And the point is – it doesn’t, automatically…

Based on Phil Haack’s tip on binding collections on his blog and based on a posting from Graham O’Neale here I completed my idea in this example. Below are the steps for combining the concepts from the previously mentioned blog entries:

1.) In my views for Editing and Adding events, add HTML and script - a table that will be dynamically expanded with new items through JavaScript for each new child-item I want to create (event delivery in my case – the parts in red are the important ones in the view):

<fieldset>
    <legend>Fields</legend>
    <p>
     <label for="Title">Title:</label>
     <%= Html.TextBox("Title") %>
     <%= Html.ValidationMessage("Title", "*") %>
    </p>
    <p>
     <label for="Description">Description:</label>
     <%= Html.TextBox("Description") %>
     <%= Html.ValidationMessage("Description", "*") %>
    </p>
</fieldset>

<table id="DeliveryTable">
    <tr>
        <th>
            Delivery Begin Date
        </th>
        <th>
            Delivery End Date
        </th>
    </tr>
</table>

<p>
    <input type="button" value="Add Delivery"
          
onclick="javascript:AddDelivery()" /> <br />
    <input type="submit" value="Create" />
</p>

<script type="text/javascript" language="javascript">

function AddDelivery() {

    // Add a row to the table
    var DeliveryTableBody = 
     document.getElementById
(
      "DeliveryTable").getElementsByTagName(
        "tbody").item(0);
    var ItemCount =
       DeliveryTableBody.childNodes.length - 1;

    var newChild = document.createElement("tr");
    var col1 = document.createElement("td");
    col1.innerHTML = 
        "<input type='text' 
         name='Event.Deliveries[" 
          + ItemCount + "].BeginDate' />";
    var col2 = document.createElement("td");
    col2.innerHTML = "<input type='text' 
         name='Event.Deliveries[" + ItemCount + 
         "].EndDate' />";
    newChild.appendChild(col1);
    newChild.appendChild(col2);
    DeliveryTableBody.appendChild(newChild);
}

</script>

2.) In my action method for adding events in the EventController I simply was required to update the signature of the action-method with the Form-postback-collection and a separate call to update model as shown below:

[Authorize]
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Add(
       [Bind(Exclude="EventId")] Event ev,

       FormCollection postValues
)
{
    //
    // Validate incoming stuff
    //
    if (string.IsNullOrEmpty(ev.Title))
        ModelState.AddModelError("Title",
                   
"Title cannot be empty!");
    if (string.IsNullOrEmpty(ev.Description))
        ModelState.AddModelError("Description",
        "Please enter a description for your event!");
    //
    // Validation succeeded?
    // If yes, add the event, otherwise
    // return to the view
    //
    if (ModelState.IsValid)
    {
        DataContext.AddToEvent(ev);
 
       UpdateModel<IEnumerable<EventDelivery>>(
             ev.Deliveries, "Event.Deliveries");
        DataContext.SaveChanges();

        return RedirectToAction("Index");
    }
    else
    {
        return View();
    }
}

3.) When modifying existing items, the whole thing gets more tricky when working with the ADO.NET Entity Framework. Why? Simply because the ASP.NET MVC default model binder, when updating collections, unfortunately clears them and re-fills them with the items posted back in the Form postback-collection. That breaks the ADO.NET Entity Framework association set (the ASP.NET MVC model binder does not know about associations). Now you have two possibilities, either modify the source code of ASP.NET MVC (if possible I would stay with the thing as it gets delivered) or apply a little trick as I did. I just created a temporary Event, filled it from scratch with the postback-parameters and then copied the values to the existing and to new items as below. Of course the whole thing needs refinement (especially when mapping to existing items in collections), but I think it’s at least a starting point!

[Authorize]
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Edit(int eventId,
                
FormCollection postValues)
{
    Event CurrentEvent = 
    (from e in DataContext.Event.Include("Deliveries")
     where e.EventId == eventId
     select e).FirstOrDefault();

    if (CurrentEvent != null)
    {
        Event Temp = new Event();
        UpdateModel(Temp, "Event", 
           new string[] { "Title",
                          "Description" });
        UpdateModel(Temp.Deliveries, 
          "Event.Deliveries", 
          new string[] { "BeginDate",
                         "EndDate" });
        CopyEvent(CurrentEvent, Temp);

        DataContext.SaveChanges();

        return RedirectToAction("Index");
    }
    else
    {
        ModelState.AddModelError("General", "...");
        return View();
    }
}

I hope that’s a helpful posting for anyone who’s facing the same challenges when working with MVC:) Nevertheless, for those who want to have full control over HTML and want to have better testing possibilities, this framework is the right choice. If you’re rather the “productivity-kind-of-developer”, sticking with web forms might be the more convenient solution...

Presentation at Microsoft TechReady in the US on Always Responsive Applications and Services with samples using CCR (Concurrency and Coordination Runtime) as well as .NET 4.0 Task Parallel Library
31 July 09 01:00 AM | mszCool | 0 Comments   

Today in the morning I gave a presentation at Microsoft’s largest internal conference for employees in Seattle, WA (called TechReady, about 5000-6000 Micorsoft employees are there on technical education).

The presentation I gave is essentially based on the whitepaper I’ve written and we’ve published a few weeks ago together with Frequenits AG on always responsive and scalable apps and services. You can find more details as well as the paper for download here.

While the presentation is strictly confidential, I can publish the demo scenarios. Therefore click the link below if you are interested in a complete scenario that shows asynchronous processing within clients and services as well as across services… of course I do not cover all possible “exceptions”, but it’s a starting point.

Click here to download the demo
(for Visual Studio 2010 Beta 1, only, I will provide a VS 2008 version with CCR-only implementations soon)

The demo scenario supports a few arguments discussed in my whitepaper as well as the presentation:

  • Performance comparison between Peer-2-Peer and Service-bus based communication metaphors.
  • Base classes for implementing the Command/Job/Queue patterns discussed in the whitepaper.
  • And finally – a mapping of these patterns to .NET Framework technologies that definitely help implementing the patterns themselves. I include two implementations, one that uses the Concurrency and Coordination Runtime from the Microsoft Robotics Studio and another one that uses the .NET Framework Task Parallel Library that we are going to publish with the .NET Framework 4.0. To switch between those two implementations, just modify the JobManagerFactory in the AsyncDemo.JobLibrary project to use one or the other implementation.

The project with Frequentis definitely showed me, that Asynchronous programming and thinking is not just for the sake of performance, it’s also for “responsiveness” and “availability”. The neat thing is, that simply by keeping a few things in mind, these things can go hand-in-hand.

Nevertheless, it was very special for me delivering this session at TechReady. Seven years ago, right before I started working for Microsoft in October 2002, Seattle was the place where I attended the first Microsoft conference of my life (and the first conference in the US, at all). And it was in the very same location as TechReady this year – in the Washington State and Convention Center, in the Sheraton Hotel and Hyatt Hotel in Seattle.

My session was in one of the Grand Ball Rooms in the Sheraton with about 100 attendees… and back in August 2002 I had my room in the Sheraton at the Windows .NET Server 2003 conference… at that time I would have never thought that I will hold a session in the same location at any time:) So this was special for me! And I hope it was not for the last time!

Technical University of Vienna – Presentation from last Week – Building a Micro-Blog-Engine with ASP.NET 3.5 and ASP.NET AJAX
16 June 09 08:23 PM | mszCool | 1 Comments   

While being here in Redmond with customers at our Lead Enterprise Architect Conference I realized that I still owe students from a lecture I gave last week the presentation and demo-downloads. Therefore I am catching up with this now;)

During the lecture I introduced ASP.NET foundational concepts such as the architecture of the runtime (Modules, Handlers...), Server Controls and the Web Forms programming model as well as ASP.NET AJAX and the latest release of the AJAX control toolkit.

mszCools MicroBlog Demo - Windows Internet Explorer

You can download the presentation and the source code for this little sample application from the link below. For successfully testing the application you need the following bits installed on your machine:

That’s essentially it, after you’ve these running you need to execute the included database script (Database.sql creates the tables, only, Database_withData.sql creates the tables with some sample data), modify the connection strings in the web.config file to point to your SQL Server instance and database. If you have SQL Server Express Edition installed you can leave all settings in your web.config as they are because SQL Server Express Edition by default installs with the “(local)\SQLEXPRESS” instance name.

Click here to download the source code and presentation!

Have much fun, if you have any questions feel free getting in touch with me through this blog!

Mario

The .NET Client Profile and a List of Included Assemblies
28 May 09 02:26 PM | mszCool | 2 Comments   

The .NET Client Profile is a very interesting extension made available with the release of .NET Framework 3.5. If you’re interested into more details, follow these link to the official documentation!

As a subset of the full .NET Framework package containing client-side functionality, only, it should make the deployment of the .NET Framework for client-only applications in corporate networks easier (30 MB are easier to deploy, maintain and patch than the full Framework with a footprint of more than 100 MB).

So far I was not really challenged with reasons for using the .NET Client Profile from customers – but now it has been the case three different times in series where the deployment of the full framework was a problem for client-only based applications.

Of course one of the first questions customers are asking is: “Which assemblies are included in the client profile and are therefore available for client developers?”

The answer: you can find a list of client-profile assemblies for each version, .NET 2.0, .NET 3.0 and .NET 3.5, in files called “Client.xml” in the following directories on your system:

%windir%\Microsoft.NET\Framework\v2.0.50727\SubsetList\Client.xml

%programfiles%\Reference Assemblies\Microsoft\Framework\v3.0\SubsetList\Client.xml

%programfiles%\Reference Assemblies\Microsoft\Framework\v3.5\SubsetList\Client.xml

Furthermore you can tell Visual Studio 2008 to check your project-references at compile-time by enabling the “Client-only Framework subset” option in the project-properties dialog. In that case Visual Studio comes up with a compiler warning for each assembly you’ve referenced that is not available in the client profile as you can see below:

image

To get more details on how-to deploy .NET Client Applications using the client-profile just take a closer look at this MSDN-documentation for the .NET Client Profile!

Hope that’s something useful…

Filed under:
More Posts Next page »

Search

This Blog

Syndication

Page view tracker