Saturday, 26 April 2008

Software, a factory approach - getting started

This is the third post in this series, you can find the landing page here
The code for this step of the series can be downloaded here.

First step in the creation of the tracker platform is creating the visual studio project, so open up your favorite IDE and get cracking..

Create a project

File\New\Project leads you to the following:
1. create model project

An ok later we have the following in our solution explorer:

2. solution explorer

 

DTO

The next step is the creation of the Data Transfer Objects, the messages that are exposed to your services clients.

Right click on the Tracker project and choose Add\New Model

3. add datamodel

This leads you to an empty designer surface, with a toolbox looking like this:

4. Toolbox

Of note here is the fault contract, to which i'll return later.

The data contract tools allow you to model your data contracts (no big surprise there ).
I think the interface is pretty straightforward, so you shouldn't have too much problems getting this running. 

First off I created the data contracts specified in the previous post, plus some more support classes (name, address and so on).

Second step is to add the required properties to each data contract. Use the aggregation tool when adding another contract as a property.

Please note that at this stage (before choosing the implementation technology) you don't need to specify the Order property on the properties, as it's not certain you really need to. (I'll get back to this in a later post).

5. property detail

The only (minor) gripe I have is with the defining of the type.
having to open a pop up window to get to System.int64 seems a bit ... cumbersome.
  6. type selector

The image below depicts my finished model diagram. 
7. datamodel

 

When you right click on the diagram and choose Validate, you'll get two validation errors, saying that you've not chosen any implementation technology and that the projectmapping is empty.  This is normal, don't worry about it :).

So now we have successfully created a data model using the wssf data contract designer!  In the next post we'll go on to create the services.

0 comments: