RSS 2.0
 Sunday, February 15, 2009
00_AppArch

Recently Microsoft Patterns & Practices released an updated version of the Application Architecture Guide. This guide is an invaluable source of information for anyone creating .NET applications. If you are looking for ways to structure your application, for challenges of specific application types or for non-functional requirements, you should read this document. Below is a fragment of the introduction: 

“The purpose of the Application Architecture Guide 2.0 is to improve your effectiveness when building applications on the Microsoft platform. The primary audience for this guide is solution architects and development leads. The guide provides design-level guidance for the architecture and design of applications built on the Microsoft .NET platform. It focuses on the most common types of applications and on partitioning application functionality into layers, components, and services, and also walks through their key design characteristics.”

The document consists of 387 pages, which may seem big. If there is just one thing you should take away from the guide, I would say it is the following diagram. It is the reference architecture of a general application that has layers for presentation, services, business and data logic. It also connects to data sources and other services and has cross-cutting concerns like security and operations.

05_RefArch

Immediately after the guide appeared Clemens wrote a great post about AppArch guide 2.0 and Visual Studio 2010. Since I realized that most are now working in Visual Studio 2008, I thought I would create some visuals in the current technology. So to start I created a new solution and added an Application Diagram that would contain all elements. Normally when designing top-down you create a conceptual design, which you can also do by adding a System Diagram as the conceptual design and for each of the elements on your conceptual design add other System Diagrams. The below image is what you end up with: A diagram in Visual Studio that contains all your layers of the above reference architecture.

02_ConceptDiag

In each of the system diagrams that represent the layers you can now add components from the reference architecture. For instance add service interfaces and message types to the services layer. For the presentation it could look like this.

03_PresLayer 

Normally you can not add Class Libraries to diagrams. To be able to use the red shape, you can use power tools for VSTS Architecture Edition, which were developed for Beta2 but they work fine in Visual Studio 2008 RTM and SP1.

When you are done your application diagram will look similar to this. I think this approach is great to create levels of abstraction: The diagram containing the layers describes how you separate layers and the application diagram shows the actual projects.

01_AppDiag_cut 06_Sln

When you right-click on the application diagram you can select “implement all applications”, which will generate projects and references for all items in the diagram. Your solution is now almost done. The one thing missing compared to the reference architecture is the cross-cutting concerns, for which you can use Enterprise Library. Enterprise Library is a great framework that takes care of plumbing for caching, data access, etc.  Just add EntLib, or your preferred framework, to your solution and you are ready to go. Remember, if you have any questions, check out the AppArch guide and the knowledge base.

Sunday, February 15, 2009 10:23:03 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] - Trackback
Development | VSTS
 Sunday, February 01, 2009

If you are developing on an x64 machine, you may receive an error when installing Visual Studio 2008 Service Pack 1:

 VS2008SP1InstallError

After opening the log you see this detailed message: “VC_IA64Runtime.exe - Exe installer's log file/hint (%temp%\dd_VC_IA64Runtime*.txt|%temp%\..\dd_VC_IA64Runtime*.txt) does not exist or is invalid”.

VS2008SP1InstallLog

The solution for me was to uninstall the Remote Debugger from Add/Remove Programs and then install Service Pack 1.

For additional information on getting remote debugging back to work, see this article http://msdn.microsoft.com/en-us/library/y7f5zaaa.aspx 

The long story was that:

  • I started applying this recent download: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=98e83614-c30a-4b75-9e05-0a9c3fbdd20d. Each of the three downloads was followed by a reboot. No luck.
  • I tried downloading the Service Pack again and also tried the EXE installer.
  • I tried copying the contents of the ISO to the harddisk when I saw an error stating that the installer tried to create a folder on the source drive. Obviously this does not work since the source drive is a read-only mounted ISO just as a DVD would be.
  • I tried applying the C++ runtime separately as the above error message is related to that.
  • I tried uninstalling the .NET Framework 3.5 SP1 components that I installed while they were in Community Technology Preview, amongst which ADO.NET Entity Framework and ASP.NET 3.5 Extensions.
  • Also the Patch Removal Tool failed, pointing to an issue with the Remote Debugger: “CleanupBlock (UnAdvertiseFeatures) failed on product (Microsoft Visual Studio 2008 Remote Debugger - ENU).”
Sunday, February 01, 2009 2:00:02 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] - Trackback
Visual Studio
 Wednesday, January 14, 2009

MicrosoftSurfaceLogo

Microsoft Surface is touch technology implemented in hardware such as a desk or a table. This sounds great for techies as we saw at PDC, where thousands of attendees all wanted to get their hands on the surface devices placed throughout the conference building. More and more it gets interesting in retail and finance industries too. Steve Clayton recently blogged about how BMW and Barclays Bank use it.

Here is a new video that shows a practical application of Surface in which you really see great graphics come to live. 

Surface

See the YouTube video

Wednesday, January 14, 2009 3:20:40 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] - Trackback

 Monday, December 15, 2008

Last week I presented at an internal event and at the SDN Event. Both presentations were on Live Mesh. LiveMeshLogin

I have been a fan since I saw a video on Channel 9. It showed synchronization that made me think of Groove, where Live Mesh has a programmable object model. Little did we know about Live Mesh being a part of the Windows Azure framework. So when I went to the Professional Developer Conference in October, I was very anxious to see Live Mesh sessions.

Ori Amiga the PM of Live Mesh did some great sessions. He also created a few movies on Channel 9, one of which is awesome showing his car that is part of the mesh.

In short Windows Azure is Microsoft's operating system for the cloud on which there is functionality for developing applications in .NET that store data in a database. .NET Services consist of Access Control, service bus and workflow. SQL Services have functionality for relational data and other BI functionality is coming. Third there are Live Services, providing familiar services that you've known from the upgraded Windows Live family such as Mail, Calendar, Contacts, Search, Earth, etc.

Live Mesh is a great sample application that demonstrates the use of services and storage in the cloud and also provides great consumer functionality. You start by installing the client on your PC and that automatically adds the device to your mesh. There also is an installer for Windows Mobile, that adds limited Mesh functionality to your device.

OK, so you have installed the client on your devices. Now you can explore your Mesh both online and through the client. They both show shared folders, your devices and news that informs about file and user changes. You can invite other users to share those files. The folders are not only synchronized over your devices, but also in the cloud. By default you get 5GB of storage. The good thing about your files in the cloud is that it is stored outside of your devices, and also that you can access your files in your online desktop.

Enough text for now, just have a look and try it. If you want to create applications that take advantage of your Live Mesh, you can get access to the Live Mesh for developers.

Monday, December 15, 2008 7:21:29 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] - Trackback
Development
 Tuesday, December 02, 2008

Last month was the SAF2008 in San Francisco, CA. They have had some impressive speakers (Simon Guest, Jack Greenfield, ...) and topics (Delivering Architectural Guidance, Growing Architect Communities, ...).

What strikes me most is the focus on the cloud platform in a very business functional way. The presentation on Multi-Enterprise Business Applications is a great example of that, where you see a story you realize straight-away and just a few slides later you see where the internet service bus comes in. The good thing the MEBA sessions also notices is that ISB is just in its early stages. There are services to be added to create manageable and trustable processes in the cloud, which are described as "Higher Level Services" taking care of

  • Party Management
  • Service Choreography
  • Business Process
  • Community Management

Great stuff that gets me thinking...

The slides are available on the new Architect Center. http://architect-center.com/groups/saf/media/default.aspx

Last year's content seems to be still available (including recordings) http://msdn.microsoft.com/en-us/architecture/bb267380.aspx

Tuesday, December 02, 2008 1:33:50 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] - Trackback
Development
 Sunday, November 16, 2008

If you are a daily user of Team Foundation Server, I am sure you know the great TFS Power Tools that are released regularly by the product team. The latest version includes integration of Office Communicator Server in the Team Explorer. Check out the screenshot below: There is a new node in the Team Project tree that says Team Members, in which you can see groups and users that have access to a team project. Since I am logged in to Office Communicator, I can see the same availability indicators. When I right-click on a team member, I can have a video conversation or start a VOIP call and all other options that OCS offers. Great stuff!

 

Ocs_TFS

 

For more info go to: http://blogs.msdn.com/bharry/archive/2008/10/01/preview-of-the-next-tfs-power-tools-release.aspx And to install the TFS Power Tools immediately you can download them from http://www.microsoft.com/downloads/details.aspx?FamilyId=FBD14EEA-781F-45A1-8C46-9F6BA2F68BF0&displaylang=en.

Update: An entire community has started developing and sharing ideas around Team Members. The Skype extension sounds great. http://blogs.msdn.com/bharry/archive/2008/11/13/extending-the-new-tfs-team-members-power-tool.aspx

Sunday, November 16, 2008 9:14:17 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] - Trackback
Team Foundation Server | TFS
 Wednesday, October 29, 2008

It must be hard to be a developer and not having heard about the Professional Developer Conference in Los Angeles. Yesterday and today were amazing and a lot of interesting stuff was announced and demonstrated:

Windows Azure - the operating system in the cloud. I like the links Steve Clayton has gathered http://blogs.msdn.com/stevecla01/archive/2008/10/28/an-azure-grab-bag.aspx

Live Mesh - a part of live services that can be used to store data and contacts in the cloud and to share them amongst your devices. https://developer.mesh-ctp.com/Welcome/default.aspx

Office Web Applications - Your favorite application web-enabled http://blogs.msdn.com/mikewalker/archive/2008/10/28/office-web-applications.aspx

And lots of more stuff like mounting .vhd files in Windows 7, creating great reports in VSTS2010, creating textual DSLs in Oslo, etc. If I would have to summarize it, it would be the photo below which I took during yesterday's keynote. This image underlines the Microsoft message of Software + Services again: You can choose whether you want your app (or parts of it) in the cloud or not.

DSC_2275_s

Wednesday, October 29, 2008 8:33:32 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [1] - Trackback
Development | Software Factories
 Friday, October 17, 2008

Now that you have installed Enterprise Library 4.0 and the source you are ready to play with EntLib to get to know the application blocks and corresponding configuration.

Let's start by creating a console application: Start Visual Studio 2008, click File | New Project, select C# console application, enter a name and click OK.

Your first step is to add references to the EntLib dlls. Right-click References, select Add Reference and select the following files:

  • Enterprise Library Data Access Application Block (Microsoft.Practices.EnterpriseLibrary.Data.dll)
  • Enterprise Library Exception Handling Application Block (Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll)
  • Enterprise Library Logging Application Block (Microsoft.Practices.EnterpriseLibrary.Logging.dll)
  • Enterprise Library Shared Library (Microsoft.Practices.EnterpriseLibrary.Common.dll)

Add the following using statements to the top of your program.cs.

using System.Data;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling;
using Microsoft.Practices.EnterpriseLibrary.Logging;

 

First we are going to get data from a database. To do this, we need a database to get data from. In this scenario I am using the Northwind sample database. We like to perform data access using stored procedures and for that I created the following procedure:

USE [Northwind]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[SelectCustomers] 
AS
SELECT Customers.CustomerID, Customers.CompanyName, Customers.City
FROM Customers

Next go back to your program.cs and in your main method enter:

Database database = DatabaseFactory.CreateDatabase("Northwind");
DataSet ds = database.ExecuteDataSet("SelectCustomers");

What you just did is create a new database object through a database factory and a create database method that takes the configured connectionstring as parameter.

To actually see the data, you can add the following:

int i = ds.Tables[0].Rows.Count;

foreach (DataRow dr in ds.Tables[0].Rows)
{
    Console.WriteLine(dr[1].ToString() + " - " + dr[2].ToString());
}

Console.ReadLine();

All you have to do now is create a configure Enterprise Library so that it knows where to find the Northwind database and how to access it. Add an app.config file to your solution and open it either by double clicking it or by opening it in the EntLib Configuration Editor.

If you only see an Enterprise Library Configuration node, right-click it and select New Application. On the application right-click and select New | Data Access Application Block. Expand the Data Access Application Block node, right-click the Connection Strings node and select New Connection String. Rename the new connection string to Northwind, which you used in code, and enter the following ConnectionString: Database=Northwind;Server=(local)\SQLEXPRESS;Integrated Security=SSPI. This string assumes that your database is called Northwind, you are using a local version of SQL Express and you connect to it using integrated security. Accept the default ProviderName and save the configuration.

Now in Visual Studio you can press F5 to run the application and see the result.

 DaTest1

To summarize you have created a console application that references Enterprise Library, uses configurable settings to connect to the database and performs data access in just 2 lines of code.

Next we will add code to handle exceptions and to log them.

Friday, October 17, 2008 7:54:34 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] - Trackback
Development
Archive
<February 2009>
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
1234567
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Pieter de Bruin
Sign In
Statistics
Total Posts: 128
This Year: 3
This Month: 1
This Week: 0
Comments: 78
Themes
Pick a theme:
All Content © 2010, Pieter de Bruin
DasBlog theme 'Business' created by Christoph De Baene (delarou)