IntroductionLive Mesh

In March I went to the Microsoft TechDays in Belgium. The last session I attended was about Microsoft’s Live Services and the Live Framework used for programming against these services. To showcase all this the Live Mesh service was used.

Live Mesh allows you to easily synchronize files with all of your devices. I tend to visualize it as an online hard drive or repository where I can deposit files which I wish to share amongst my devices such as my laptop at work, my PDA…etc.

You simply have to sign up for a Mesh account and install the Live Mesh client on the devices you want to synchronize. Once the client has been installed all that remains is to add a local folder to Live Mesh. The client will then make sure this folder is synchronized automatically between all of your devices.

Your Live Mesh account allows you to manage the connected devices and Live Mesh folders. For example you can opt to choose between which devices you want to synchronize a certain folder.

When you place a new file into a Live Mesh folder, the client will upload this file to your online Mesh account. The clients on your other devices will be notified as soon as they are up and running and will synchronize with your online Mesh account. So you always have a copy of your data floating around somewhere on the cloud.

There is more to it than this, but this is the gist of it. The goal of this article is to demonstrate just how easy it is to use the Live Framework to program against the Live Mesh service. With a small amount of code you’ll be able to create folders and store files in your Mesh account.

Read the rest of this entry »

Introductiondatabase-access1

For this article / tutorial I will demonstrate a quick and easy way on how to use data access objects (DAO’s) with the Entity Framework.

These data access objects form a layer between the business logic and the database access technology. The idea is that the business logic should remain ignorant of the technology used to access the database. Using this “DAO pattern” you can more easily interchange this backing technology.

In the text to come this will be demonstrated by setting up a simple domain model which will be modelled using the Entity Framework. Next a layer of DAO’s will be created on top of this domain model.

The business logic will only use these DAO’s to request or send back data from or to the underlying data store. How these CRUD operations are handled is entirely up to the implementation of the DAO’s and should be of no concert to the business logic.

By decoupling the business objects from the backing data store you can more easily switch to another database access technology such as for say Linq To Sql.

Read the rest of this entry »

IntroductionWeb Development

It’s been a good two months since the last post. Today I finally found some spare time to write a new article about .NET. This will be the first article on this blog focusing solely on the Entity Framework. More in particular about using the Entity Framework in different environments such as Windows Applications and in an ASP.NET environment.

The Entity Framework has some drawbacks that will hopefully be addressed in the second release, but in its current state it’s already a really useful technology to use for database access.

This article will not discuss every feature of the Entity Framework as that would entail writing an entire book. The primary focus is on how to deal with the ObjectContext in different environments such as a regular Windows Application and a Web Application (ASP.NET). Let’s get started…

Read the rest of this entry »

MVP: Model View Presenter

December 14, 2008

IntroductionOOADug

Last week I was reading some articles about using WCF, the Entity Framework and how to transport entities across the service boundary. One of the articles I encountered included a demo project that made use of the Model View Presenter (MVP) pattern.

Having explored the demo project I thought it might be interesting to write an article about this pattern. Your favorite search engine will happily supply you with a plethora of links to other articles that explain this pattern thoroughly.

For this article I’ve decided to supply a concrete implemention and to focus less on the theory behind the pattern.

Let’s roll…

Read the rest of this entry »

IntroductionWeb Development

The purpose of this article is to create a slick looking and easy to use menu for an ASP.NET enabled website. In order to accomplish this we’ll use the standard functionality of the ASP.NET Menu web control and enhance the look purely by using Cascading Style Sheets (CSS).

For those of you familiar with CSS the title of this article will surely ring a bell. The CSS used to enhance the look and feel of the ASP.NET Menu control is decribed in a widely known article on A List Apart, entitled “Sliding Doors of CSS“.

The CSS used to improve the look and feel of the menu is thoroughly explained in the article on A List Apart. Credit when credit is due. Thank Douglas Bowman for supplying us with the CSS. Be sure to read his article first if you are not familiar with it.

The focus of this article is on how to simulate such a menu in an ASP.NET environment. Let’s get started…

Read the rest of this entry »

Introduction

The WCF platform allows for great extensibility by allowing you to plugin any number of extensions at various points in the WCF pipeline. These points, aptly named extensibility points, can be found at predefined locations in the various layers that make up WCF.

This article focuses on one of the extension points in particular, namely parameter inspectors. Injecting a Parameter Inspector in the WCF pipeline at the client or service side will allow you to check, modify or reject (in short validate) any of the parameters that are going to be sent to the service or are received at the service end.

But first a short word on the WCF pipeline…

Read the rest of this entry »

Strategy Pattern

August 24, 2008

IntroductionOOADug

This week I was at last able to find some spare time to write a new article. It’s been three months already since the last one. I’ve been preoccupied with studying for .NET exams (MCTS) among other things hence the delay.

To get back on track I thought I’d finish an article for which I’ve had the code lying around for quite some time. This article is the second one in the Sudoku series. This series explains a couple of design patterns using a Sudoku game as an example. You can find the first article, which details the Flyweight pattern here. Be sure to take a look at it and download its source code.

Let’s get started with the design pattern at the heart of this article, namely the Strategy pattern…

Read the rest of this entry »

HardwareIntroduction

A couple of weeks ago I was asked to write an assembly which should contain the necessary code for communicating with a payment terminal for a Point of Sale (POS) application. As you may have guessed from reading the title, the device in question is the Omni 3750 terminal. This terminal is produced by Verifone, check out the link if you require more information about this piece of hardware.

Although Verifone distributes this terminal in several countries supprisingly little can be found on the internet regarding communicating wih this device from any programming language whatsoever. The only thing I found was a rather short post on a Delphi forum. Together with some documents I received from the distributor of the Omni terminal here in Belgium this was enough to get me started.

This article concentrates on communicating with this device by using the SerialPort type and adhering to the required protocol. Hopefully this addition to the internet will save some people time in figuring this out.

Let’s get started…

Read the rest of this entry »

Introduction

Whenever I design a service I have the habbit of wrapping the client-side proxy in a helper class. This shields the end-user from having to deal with the proxy directly and with the clean up code.

The service references and coherent helper classes are put in a seperate class library. Such a helper class provides public methods that delegate to the protected proxy property. If more than one client application uses the service then you can just reference this code library and reuse the helper classes.

An example of this can be found in my “A Combination of WCF Essentials” article. One reader asked the following question:

Interesting article, in particular the part about wrapping the proxy. I’m thinking of wrapping a proxy in a class library, but can’t figure out how to expose the async methods of the proxy to the users of the dll. Do You have any suggestions regarding that?

This article focuses on accomplishing just that. So let’s get started…

Read the rest of this entry »

WCF Data Types

April 20, 2008

Introduction

Since I posted this WCF article last week some people found my blog by typing in keywords such as “WCF Return As Dictionary” in various search engines.

Controlling the way Collection and Dictionary types used by a Wcf service are represented on the client is actually very easy. In this short article, two methods are demonstrated on how to achieve this.

Let’s get started…

Read the rest of this entry »