SnCore!

Development Process

Introduction

This page will guide you through the SnCore development process. At first it may look complicated, but it's actually not hard to get going and it's event easier to write useful code quickly and error-free since most of the complex infrastructure has been completely figured out for you.

Prerequisites

Source Code

  1. Download and install a Subversion client from http://subversion.tigris.org/.
  2. Create a new directory, eg. C:\Source.
  3. Anonymous read-only access is enabled. Please e-mail dblock at dblock dot org for write access.
  4. Check out the source code with svn checkout svn://svn.vestris.com/sncore

Installation

Follow the normal Installation (Getting Started). Visual Studio will create the websites for you, so you can skip that step. Once you have your SnCore website running you're ready to go.

Windows Vista

On Windows Vista, some security restrictions must be lifted.

  • Edit Physical Path Credentials in Advanced Settings and set a specific account to run the virtual directory under.
  • Set r/w permissions for the NETWORK SERVICE account on the SnCore.Web/Bin, SnCore.MobileWeb, SnCore.Web/IsapiRewrite and SnCore.MobileWeb/IsapiRewrite directories.
  • In registry, create HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\SnCoreWeb and SnCoreMobileWeb.

Data LifeCycle

Most functionality in the system is data-driven. For example, you won't find a method to send a message, but you will find a complete API to Create, Retrieve, Update and Delete a message (CRUD).

  1. Add a new SQL table and generate NHibernate class and mapping for it. This is all you have to do to be able to create, retrieve update and delete rows in the database. The generated code is entirely in the automatically generated SnCore.Data project. You never have to deal with actual SQL code. For example, add a Thing table, which generates a Thing C# class. Read Data (Puzzle and NHibernate) for implenentation details. Write unit tests for the data and managed layer in the SnCore.Data.Tests project.
  2. Create a managed layer for your new class in SnCore.Services. You must create a so called transit class, in this case TransitThing and a managed class ManagedTransitThing. This layer is usuall a straightforward stub with several interesting methods.
    • The managed object is aware of the NHibernate session (the data connection). It can hence implement any side effects needed for CreateOrUpdate and Delete. These are typically updating the Modified column of the class, but may be more complex when an object has relationships.
    • The transit object can be constructed from the managed object with a, for the purpose of our example, GetTransitThing method. The transit object is used to return a flat structure through web services. It seems redundant, but it is the easiest way to strip any sensitive data and to combine multiple objects in one to expose to ASP.NET data binding and to separate what goes between layers.
    You should write unit tests for the data and managed layer in the SnCore.Services.Tests project.
  3. Create a new web service or methods within an existing web service. These are typically, for a class Thing, GetThingById, CreateOrUpdateThing, DeleteThingById, GetThings, etc. Permissions are checked within the web services using the user ticket.
  4. Create ASP.NET pages, such as ThingsManage.aspx, ThingEdit.aspx, etc.
© Vestris Inc., 2006-2007, All Rights Reserved | SnCore | Wed Mar 5 09:56:21 2008 | Doxygen 1.5.4