No Free Time

Because my therapist says I need to let things out

Archive for February, 2008

Build Helpers

Posted by andrewmyhre on February 26, 2008

I’ve made a couple of build helper files which may come in handy. They cover compilation, testing and deployment, and hopefully can be reused between projects with minimal need to be rewritten. I’ll share the compilation one today.

Compilation Build Scripts

As background my folder structure looks like this:

/Solution/ClassLibrary1
/Solution/ClassLibrary2
/Solution/Website1
/Solution/Resources
/Solution/Build
/Solution/Build/bin
/Solution/Build/src
/Solution/Build/testlib
/Solution/Build/deploy

Resources is where everything like NAnt, MBUnit, log4net, NCover etc all reside. Various things happen within the Build folder: src is where all projects are copied into before being compiled, bin is where each compiled assembly is placed for easy reference for other assemblies (e.g: where ClassLibrary2 depends on ClassLibrary1), testlib is where all test assemblies are compiled and run, and deploy is where our final compilation will end up.

The reason each assembly is copied into the src folder prior to compilation is so that we can do tricky things like substituting *.config and AssemblyInfo.cs files, as you’ll see below.

The build file starts this way:

    1 <?xml version="1.0"?>
    2 <!--EXTERNAL_PROPERTIES: output.dir;AssemblyName;debug;assembly.label-->
    3 <project name="general compilation">
    4   <target name="clean" >
    5     <delete dir="${output.dir}"/>
    6   </target>
    7
    8   <target name="init" depends="clean" >
    9     <mkdir dir="${output.dir}" />
   10     <mkdir dir="${output.dir}/bin" />
   11   </target>

Straight forward. Note that the ${output.dir}, ${AssemblyName}, ${debug} and ${assembly.label} properties are expected to be set – these will be set from your calling build file. ${output.dir} can simply be “c:pathSolutionBuild”. ${AssemblyName} is just the name of the assembly you want to compile at that time.

Assembly compilation:

   13 <target name="general.compile.assembly" description="compiles a satellite assembly">
   14     <echo message="*******************************" />
   15     <echo message="***COMPILING ${AssemblyName}" />
   16     <echo message="***TO ${AssemblyOutputFolder}" />
   17     <echo message="*******************************" />
   18
   19     <delete dir="${output.dir}src${AssemblyName}" />
   20
   21     <copy todir="${output.dir}src" flatten="false">
   22       <fileset>
   23         <include name="${AssemblyName}***.*" />
   24         <exclude name="${AssemblyName}bin" />
   25         <exclude name="${AssemblyName}config" />
   26         <exclude name="${AssemblyName}**AssemblyInfo.cs" />
   27       </fileset>
   28     </copy>
   29
   30     <call target="general.labelassembly" />
   31
   32     <csc target="library" output="${output.dir}bin${AssemblyName}.dll" debug="${debug}">
   33     <sources>
   34       <include name="${output.dir}src${AssemblyName}/**/*.cs" />
   35     </sources>
   36     <references refid="assembly.resources" />
   37     </csc>
   38     <copy file="${output.dir}bin${AssemblyName}.dll" tofile="${AssemblyOutputFolder}${AssemblyName}.dll" />
   39   </target>

As the description says, this target compiles a satellite assembly, or class library. It first deletes the src folder (/Solution/Build/src/AssemblyName) before copying the latest source into it. Then it calls the “general.labelassembly” target, which we’ll see shortly. Finally it compiles all .cs files into a dll.

Note line 36, where the references tag uses assembly.resources. This is because you should call the target like this:

    5     <!-- Class Library 1 -->
    6     <property name="AssemblyName" value="ClassLibrary1" />
    7     <assemblyfileset id="assembly.resources">
    8       <include name="${resources.dir}/log4net.dll" />
    9     </assemblyfileset>
   10     <call target="general.compile.assembly" />

This way you only specify exactly what you need to in order to build the assembly.

Now, websites. First we need to prepare a few things:

   41 <target name="prepare.web" >
   42     <mkdir dir="${output.dir}src${website.name}" />
   43     <echo message="*******************************" />
   44     <echo message="***COMPILING ${website.name}" />
   45     <echo message="*******************************" />
   46
   47     <copy todir="${output.dir}src" flatten="false">
   48       <fileset>
   49         <include name="${website.name}***.*" />
   50         <exclude name="${website.name}config" /> <!-- this are where we put environment-specific config files -->
   51         <exclude name="${website.name}bin*.*" />
   52         <exclude name="${website.name}web.config" />
   53       </fileset>
   54     </copy>
   55     <copy todir="${output.dir}src${website.name}bin" flatten="true">
   56       <fileset>
   57         <include name="${output.dir}bin*.*" />
   58       </fileset>
   59     </copy>
   60     <copy todir="${output.dir}src${website.name}bin" flatten="true">
   61       <fileset refid="website.resources" />
   62     </copy>
   63   </target>

Then we can compile the site itself. Note that we don’t copy the web.config over with the website. This is because I have a seperate target to copy a config file, replacing environment specific variables as it copies. I’ll come to that in a bit.

The next target is straightforward – compile the website to the /Build/Deploy/WebsiteName folder.

   65 <target name="general.compile.website" description="compiles a website" depends="prepare.web">
   66     <mkdir dir="${output.dir}Deploy${website.name}" />
   67     <exec program="aspnet_compiler.exe"
   68         basedir="C:WINDOWSMicrosoft.NETFrameworkv2.0.50727"
   69         workingdir="${output.dir}"
   70         commandline="-u -v /${website.name} -p ${output.dir}src${website.name} ${output.dir}Deploy${website.name}"  />
   71   </target>

Here’s a target used to copy a config file.

   73 <target name="general.compile.website.copyconfig" description="Copies an XML file to the website's web.config, replacing tokens as specific in fileset">
   74     <copy file="${template.sourcefilename}" tofile="${output.dir}Deploy${website.name}web.config">
   75       <filterchain refid="config.settings" />
   76     </copy>
   77   </target>

And finally the target to label the assembly.

   79   <target name="general.labelassembly">
   80     <asminfo output="${output.dir}src${AssemblyName}AssemblyInfo.cs" language="CSharp">
   81       <imports>
   82         <import namespace="System.EnterpriseServices" />
   83         <import namespace="System.Reflection" />
   84         <import namespace="System.Runtime.CompilerServices" />
   85       </imports>
   86       <attributes>
   87         <attribute type="AssemblyVersionAttribute" value=""${assembly.label}"" asis="true" />
   88         <attribute type="AssemblyTitleAttribute" value=""Canon Create"" asis="true" />
   89         <attribute type="AssemblyDescriptionAttribute" value=""assembly for Canon Create"" asis="true" />
   90         <attribute type="AssemblyCopyrightAttribute" value=""Copyright (c) 2008"" asis="true" />
   91         <attribute type="ApplicationNameAttribute" value=""${AssemblyName}"" asis="true" />
   92       </attributes>
   93       <references>
   94         <include name="log4net.dll" />
   95       </references>
   96     </asminfo>
   97   </target>

Using the build scripts

You can invoke the website compiler like so:

   13 <!-- build the frontendwebsite website -->
   14     <property name="website.name" value="FrontEndWebsite" />
   15
   16     <assemblyfileset id="website.resources">
   17       <include name="${resources.dir}/DynamicPDF.Generator.Server.dll" />
   18       <include name="${resources.dir}/DynamicPDF.Merger.Server.dll" />
   19       <include name="${resources.dir}/NetSpell.SpellChecker.dll" />
   20       <include name="${resources.dir}/FreeTextBox.dll" />
   21       <include name="${resources.dir}/log4net.dll" />
   22     </assemblyfileset>
   23     <!-- compile the site -->
   24     <call target="general.compile.website" />

And to copy config settings:

   26     <!-- copy the frontendwebsite web.config with replacing tokens -->
   27     <filterchain id="config.settings">
   28       <replacetokens>
   29         <token key="token.defaultConnectionString" value="server=engelbart;database=CANON_CREATE_V6;uid=sa;pwd="/>
   30         <token key="token.smtpserver" value="10.111.1.55" />
   31         <token key="token.baseSiteUrl" value="http://localhost:4870" />
   32         <token key="token.XHTMLTemplateUploadPath" value="C:Inetpubvirtual2005ProjectsCanonCanonCreate2005FrontEndWebsitexhtmltemplateuploads" />
   33         <token key="token.ConfigurationFilesDirectory" value="C:Inetpubvirtual2005ProjectsCanonCanonCreate2005ConfigurationFiles" />
   34       </replacetokens>
   35     </filterchain>
   36
   37     <!-- copy the frontendwebsite.config.template.xml file to /frontendwebsite/web.config with tokens replaced -->
   38     <property name="template.sourcefilename" value="template.config.FrontEndWebsite.xml" />
   39     <call target="general.compile.website.copyconfig" />

Here’s how I’m labelling my build. Generally I just want to use the CCNetLabel variable passed through from CCNet, but for added flexibility The target expects the ${assembly.label} variable. I simply check for CCNetLabel and copy it to the new variable.

   68 <!-- label the assembly -->
   69     <ifnot propertyexists="CCNetLabel">
   70       <fail message="CCNetLabel property not set, so can't create labelled distribution files" />
   71     </ifnot>
   72     <trycatch>
   73       <try>
   74         <echo message="build number ${CCNetLabel}" />
   75         <property name="assembly.label" value="${CCNetLabel}" />
   76       </try>
   77       <catch>
   78         <property name="assembly.label" value="1.0.0.1" />
   79       </catch>
   80     </trycatch>

Posted in CI, nant | Tagged: , | Leave a Comment »

How to fix TransactionScope “already been implicitly or explicitly committed or aborted” error

Posted by andrewmyhre on February 14, 2008

I got this error while running unit tests my local machine for a codebase which has been stable for a few months. Up til now the unit tests have been running without problems on our build server, but I’m adding to the codebase so I’m running them locally.

The error occurs when we execute any kind of SQL within an open TransactionScope, and then try to commit the transaction. I found my unit tests were failing waaaay more than they should be, and were taking waaay longer than they should to run (some were taking 8 seconds or more to run a simple insert or update test). The error log was giving me the following:

Message: The transaction has already been implicitly or explicitly committed or aborted.

Type: System.Transactions.TransactionException
Source: System.Transactions
TargetSite: Void ProxyException(System.Runtime.InteropServices.COMException)
HelpLink: null
Stack: at System.Transactions.Oletx.OletxTransactionManager.ProxyException(COMException comException)
at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts)
at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx)
at System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx)
at System.Data.SqlClient.SqlInternalConnectionTds.Activate(Transaction transaction)
at System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()

A quick search turned up a forum thread which solved the problem for me – Windows Firewall was messing with the transactions. Turning it off made my unit tests complete quickly and with most tests passing again.

In case that doesn’t help in your situation, here are a number of threads to read for other explanations/solutions:

http://forums.asp.net/t/1017415.aspx
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=167289&MovedStatus=MovedAlreadyApproved&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=124293&SiteId=1

Posted in Uncategorized | 1 Comment »

Design

Posted by andrewmyhre on February 10, 2008

Interesting talk about design on TED.com from Paola Antonelli.

Just had a brain burp while I watched it though. While I respect the idea that design should be part of process, my gut feeling is that design isn’t a process in of itself. I often question my own understanding of design. Do I get it? Yeah, but do I really get it? Surely I could apply it more? Isn’t it just problem solving? People speak about it as if it’s a black art, but isn’t it just a matter of understanding what you’re trying to achieve and the tools you have available to achieve it? What the fuck is design, anyway?

The idea of ‘design’ is closely linked to a plan, or pre-meditation. It’s knowing what you want to achieve, and trying to do so within the constraints of your environment. It’s not about knowing how to achieve it from the outset (an epiphany), and it’s not about pure experimentation. It’s essentially the application of the scientific method to real life. And in order to engage in that thought process you must first come to the realisation that whatever situation you’re in isn’t ideal. So the antithesis to design must be accepting the status-quo – following rules without question. Ms. Antonelli mentions that designers must be mavericks in order to produce great design, which is another way of saying that design is the process you undergo when you want to take what you have and make it better.

The trouble is, I don’t believe design is something you can teach. Essentially it’s invention, and you can’t teach someone how to invent. Nor can you offer someone a large salary to invent – if they can’t, they can’t.

So what does that make design? A set of tools? A process?

It’s a difficult question. Some would say that design is just a matter of working out what the problem is, and what the solution is, and filling in the blanks in between. Well, what does that make Agile then? Isn’t the entire selling point of Agile that it takes into account that you can never know what the end result will be in advance? Agile is a process, and a tool, but it’s not design. The Waterfall approach is a closer fit to the general idea of design, but why doesn’t it seem to ever work?

What was troubling me during Ms. Antonelli’s talk was that people seem to believe that eventually ‘design’ can solve the grander problems of humanity. Sure, I agree that understanding the issues and deciding to work with what we have to improve life for mankind will be of great benefit. But that doesn’t make the way forward any clearer, does it. That’s just a way of stating what we have to do. It’s not a method, or a process, or a tool. And I don’t think it helps.

I don’t think I get design. But I worry when people try to convince me that design is the key, because when the conversation is over I still haven’t learned anything. Usually the bargain is that for me to learn something about design I have to fork over cash to attend a seminar.

No thanks. I’m a maverick.

Posted in Uncategorized | Tagged: | Leave a Comment »

Mmmm

Posted by andrewmyhre on February 9, 2008

I like this site: http://idehotornot.ning.com/

Not because of the content, but because it scales to my widescreen! Aaaaaaaaahhhhhhhhhh

Posted in Uncategorized | Leave a Comment »

Small NAnt Gotcha

Posted by andrewmyhre on February 7, 2008

Say I have two XML build files. The first is intended to call a target in the second.

Example1.xml:

.cf { font-family: Courier New; font-size: 8pt; color: black; background: white; } .cl { margin: 0px; } .cln { color: #2b91af; } .cb1 { color: blue; } .cb2 { color: #a31515; } .cb3 { color: red; }

    1 <?xml version="1.0"?>
    2 <project name="Master build file" default="build" basedir=".">
    3
    4   <echo message="first" />
    5
    6   <include buildfile="example2.xml" />
    7
    8   <target name="build" description="Main target">
    9     <echo message="second" />
   10     <call target="secondary.target" />
   11   </target>
   12 </project>

Example2.xml:

.cf { font-family: Courier New; font-size: 8pt; color: black; background: white; } .cl { margin: 0px; } .cln { color: #2b91af; } .cb1 { color: blue; } .cb2 { color: #a31515; } .cb3 { color: red; }

    1 <?xml version="1.0"?>
    2
    3 <target name="secondary.target">
    4   <echo message="third" />
    5 </target>

I had expect that the secondary.target target would not be called until after the build target was called. Instead:

.cf { font-family: Courier New; font-size: 8pt; color: black; background: white; } .cl { margin: 0px; }

NAnt 0.85 (Build 0.85.2478.0; release; 14/10/2006)
Copyright (C) 2001-2006 Gerry Shaw
http://nant.sourceforge.net

Buildfile: file:///C:/Inetpub/virtual2005/Projects/Canon/CanonCreate2005/example1.xml
Target framework: Microsoft .NET Framework 2.0
Target(s) specified: build

[echo] first
[echo] third

build:

[echo] second

BUILD FAILED

Target 'secondary.target' does not exist in this project.

Total time: 0 seconds.

Huh? Why did the output go “first”, “third”, then “second”? And why does it say secondary.target doesn’t exist?

The documentation for the <include> task states:

Any global (project level) tasks in the included build file are executed when this task is executed. Tasks in target elements are only executed if that target is executed.

Which means my build file should be executing correctly. It’s in a target, isn’t it?

So I tried wrapping the secondary target in a project tag, and lo and behold:

.cf { font-family: Courier New; font-size: 8pt; color: black; background: white; } .cl { margin: 0px; }

NAnt 0.85 (Build 0.85.2478.0; release; 14/10/2006)
Copyright (C) 2001-2006 Gerry Shaw
http://nant.sourceforge.net

Buildfile: file:///C:/Inetpub/virtual2005/Projects/Canon/CanonCreate2005/example1.xml
Target framework: Microsoft .NET Framework 2.0
Target(s) specified: build

[echo] first

build:

[echo] second

secondary.target:

[echo] third

BUILD SUCCEEDED

Total time: 0 seconds.

So the NAnt docs aren’t entirely complete, are they. So I suppose the tag <project> is really a way of saying “this is build script which I want to control the execution for, instead of just processing the whole file as NAnt reads it”.

Posted in CI, nant | Tagged: , | Leave a Comment »

Now at WordPress

Posted by andrewmyhre on February 6, 2008

Well my old CMS just wasn’t cutting it, so I decided to move to a proper third-party solution. Someone I know said I should really get a blog which can handle commenting. Ironically he suggested Tumblr.

Why on earth would someone implement a blogging platform… WITH NO COMMENTS SYSTEM.

So now I’m here. Frankly I couldn’t care less how extensible Tumblr is. I blog because I want to write about the other cool things I’m doing with my time, and I don’t want to have to suck up some of that time just to get my goddam blog to work. WHO CARES.

Anyway, rant over, regular broadcast will resume.

Posted in Uncategorized | Tagged: | Leave a Comment »

A Nice Day With Microsoft

Posted by andrewmyhre on February 5, 2008

I spent the day today at a Developer Day seminar at Microsoft Campus in Reading with my line manager at my work. We were shown demonstrations of the gamut of Team System functionality; it was very cool.

I had a good idea that we could use the Developer and Test editions to full advantage, but I had a preconception that the Database and Architect editions were just there to complete a ’suite’, and didn’t provide much in the way of helpful functionality.

Turns out the Database edition provides some pretty comprehensive database schema management tools, including schema comparisons, difference scripting, schema version control (a big sell for me) and DB unit testing. I had figured we’d be best to just get into bed with RedGate and build the workings of version control ourselves, but I’m really impressed with what they’ve put together.

Likewise the Architect edition. You have the ability to create two types of model: environment and application. You begin by creating the environment model, including firewalls, DMZ, server platforms (down to service pack versions) and the network interfaces between. Then you design your overall application model – website, web services (including method stubs, return types etc), and databases. You can also provide the base platform requirements of each box in the diagram (Windows 2003 Server with .Net 2.0 and SP 2 perhaps). Finally you have the application generate a project with
method stubs, and then visually map the application components on to the server infrastructure. Visual Studio with then analyse your deployment scenario and inform you of any potential problems.

You could do all of that with pen and paper, and it’s certainly a lot cheaper. It’s the one we’re interested in the least. But it’s cool, and would have come in very handy on the last project we attempted. One of the constraints was that there had to be 3 (count ‘em) seperate proxy web services between our web app and the external post code lookup service we were leveraging. We now have these three services sitting in our project with the ambiguous names of ‘WSProxy1′, ‘WSProxy2′, and ‘WSProxyExternal’ – how nice it would be if this could have been planned out visually with some more thought, or better tools. I shudder to think how a fresh contractor will react when they try to debug results through those services.

So I think we’re going to go ahead and purchase TFS 2008, a few Developer editions and a Test edition. Possibly a DB edition, but I wouldn’t be suprised if we hold off for the time being.

Just a quick word about the Developer edition… not much different to 2005 but TFS 2008 support for Build Definitions (were Build Types) is much, much improved. You can now set up a massive range of configuration options with your build, you can edit an existing build (how that didn’t make it into the 2005 release I’ll never know), and you can set triggers/schedules with the same power as with a Windows scheduler task (which is what it will be under the hood). Also they have released a set of power tools which add real continuous integration of the style of CCNet.

All in all a fantastic day and I’m glad to have taken part. Very appreciative that my work is making a real effort to find and implement the right tools for the job, in fact putting their money where their mouth is. I think I’m in a good spot for 2008.

Incidentally I work for these guys. Oh, and we’re looking for permanent people, if you know anyone.

Posted in tfs | Tagged: | Leave a Comment »

Some TFS, Continuous Integration Related Links

Posted by andrewmyhre on February 4, 2008

Beginning to look into some of my notes from the weekend with a bit more depth. Starting with Continuous Integration, especially regarding TFS.

Some links:

Continuous Integration Using Team Foundation Build – MSDN
Provides an example project on your TFS server which provides a simple CI interface. Source not available unfortunately!

TFSBuildLab

My thoughts, shares … with .Net and Microsoft
Not sure who maintains this blog yet but it’s .Net and TFS 2008 related.

Continuous Integration in Team Build for OrcasTips for upgrading from TFS 2005 to 2008 – Grant Holiday

TFS 2008: A basic guide to Team Build 2008

Why and How to build a Continuous Integration Environment for the .NET platform

Continuous Integration with Cruise Control.NET and Draco.NET by Justin Gehtland

Continuous Integration by Martin Fowler

Boy, this is tough… as soon as I look at one resource I find a dozen more. I’ll never get through my notes at this rate.

Posted in tfs | Tagged: | Leave a Comment »

Alt.Net UK Notes

Posted by andrewmyhre on February 3, 2008

Right, these are the notes I took during the Alt .Net UK conference yesterday. This is literally just me trying to type what I’m hearing, it’s not coherent and probably won’t help anyone. I plan to break out and expand on this information in sections over the next couple of weeks.

There are loads of places where I’ve heard a term for the first time and don’t know how to spell it or what it’s about. There are double question marks in those cases. Where I’ve done that I’d appreciate if someone can send me a note explaining what the hell it’s about.

Enjoy!

Alt .Net UK

Session 1 – Web Services, REST, SOAP

Sebastian & Alan Dean

REST – Architectural Style
Idea began with MILL architecture with constraints applied to result in REST

Must be:
Client-server
Stateless (no app-state)
Cache-constraint – messages must be cacheable across the network
Uniform interface
Must be layered – each client/server don’t need to know about other clients/servers
Code-on-demand – a client can request code to execute on demand e.g: pulling JS into browser

Emphasis on uniform interface between component. Comprises 4 aspects:
-    URI
-    Set of well defined operations GST POST
-    Set of media types text/html, image/jpeg
-    Hypertext is the engine of app state – transition to a different URI to change the app state

WACA?? Apparently a new version of HTTP which is completely RESTFul.
Not sure how to spell or whether it’s a mnemonic

Concept of ‘Content Negotiation’ – client asks server for a media type e.g: text/html
You request against a resource e.g: /foo
HTTP provides a status code and a response.

To do REST properly it’s crucial to learn how HTTP works on the wire.
REST seems to be about getting the most out of HTTP, SOAP blatantly is not.
How cool would a REST web reference plugin for Visual Studio be?

Perhaps it’s not about REST vs SOAP. Maybe more about REST *OR* SOAP.
Maybe SOAP is the logical extension of super feature-packed, bloated HTTP.

A lot of so-called ‘RESTFul’ site frameworks are derogatively called ‘GETFul’, not true REST e.g: Flickr.

REST should be ‘SAFE’. You should be able to get the same resource repeatedly. A GET post should not result in a state change. PUT is intended to change state – ‘put’ data on the server e.g: edit details for a product.
POST is an unrestrained verb, you essentially send SOME data to the server without any knowledge or expectaition of what it’s going to do, and server provides a response i.e: what it did.
With PUT you are specifying what you want to happen.

Usage *should* be something like:
PUT /customers/andrew.myhre
Server either says OK that’s fine or no you can’t (exists or something)

e.g: a wiki:
/Hello <- a page with data

PUT /hello
Content-Type: text/plain
…. Data to PUT ….

The server then updates the resource /hello with the data.

The concept becomes unclear when you need to delete. PUT and POST verbs don’t make sense when deleting. Appending verbs using semi-colons is one approach though:
/customer/andrew.myhre;delete

What’s missing is a way for REST services to describe themselves.
HTTP Verbs can be standardised whereas object data structures need to be declared per service for other apps to work with them.

One approach is to only allow POST/PUT to a single page in your application which basically ‘does’ ‘something’ with ‘data’ – > it’s basically a factory method which calls resources and does actions on them.

WADDLE / WADL??

Resources should be self-describing. Apparently this should be done through the

tag.

Major benefit of SOAP is that it’s protocol agnostic: you could and mail a SOAP request.

When creating a wizard-style interface with REST, you would add data from each step to a form package which would only be POSTed to the server after the final step. How is validation performed at each step?

Given the current state of toolsets it’s usually a choice of either/or when considering REST and SOAP.

REST is really targeted with the WWW, not so much with intranets/enterprise apps. Web Services are the other way around, focussed on enterprise apps. The two approaches have completely different goals.

Comment that you shouldn’t expect the tool to solve your problem, your approach should solve the problem. Yeah kinda.

How did steven get on with his REST wrapper for SOAP services?

Atom Media types … ?

How would service discovery be implemented with REST?

Suggestions that it would be implemented as a media type.
I have to disagree, to me  media types are ‘views’ on a resource. Providing a particular view that describes how to interact WITH the resource is not the same as a view ON the resource.
I think a new HTTP verb is required.

Speakers propose that any application that supports add-ins and can access HTTP can be REST client. REST services can be self-describing by including content in a response e.g: a JavaScript file included in a page or an HTML form.

Check out LiveWriter.
It uses atom/xml to communicate with any supported blog.
The reason it can do this is because the contract is not specified by the blog site but by the media type.
The blog doesn’t need to describe anything about itself for LiveWriter to know how to communicate with it.

‘Squid’ ? Linux (there is a windows distro) is a reverse proxy. Also ‘Varnish’.
Increases website performance by orders of magnitude, providing your HTTP is implemented correctly.

Session 2 – Castle, Monorail vs MVC, Future of WebForms

WebForms are generally tightly coupled. You have to expend a lot of effort and have discipline to create a loosely coupled WebForms app.

You can add MonoRail to an existing site without upsetting existing WebForms. You just map a new page file extension to the MonoRail Page Controller.

Because of the controller implementation in MVC you can migrate individual pages over to MVC. MasterPages can be reused providing you have implemented solely to deal with common HTML, layout and style.

There are two patterns of using MVC – active and passive.
Active allows for communication from server to client to inform of changes in state, which can’t be implemented with over HTTP. This applies to win forms and allows for scenarios like asynchronous processing.

http://del.icio.us/alan.dean/mvc

Must check out MonoRail and Spring.Net
Tesco have taken the approach of building a sophisticated front-end with a rubbish WebForms admin. ‘Tis a cost-effective decision.

SharePoint development seems to be very difficult.
Heard a few horror stories where Sharepoint portal development has been a major loss, including one where a team of Microsoft developers were creating a site with MOSS 2007 which they found extremely difficult to complete.

Check out MediaWiki
‘CUYAHOGA’ portal framework – uses NHibernate.
Castle ActiveRecord.

Session 3 – LINQ, ORM, NHibernate

Limitations in LINQ:
-    linq is more limited than nhibernate in terms of relationship mapping
-    not clear yet whether there will be Linq implementations for other database

Linq SELECT expressions need to parse the code tree when they execute? Apparently this is slow and clunky.

Someone is writing a Linq to NHibernate provider.

NHibernate approach is to write the domain first and then the persistence.

The Entity Framework does not support ‘persistence ignorance’.

Check out Astoria

NHibernate doesn’t have the support or development team behind it that LINQ does.

Check out SPOIL.
NHibernate HQL JOIN FETCH clause is very important for optimising join lookups.

Is it possible to implement your entities as structs, map with NHibernate and move all business logic into a different namespace (eg: Tasks).

Interceptors can be used in NHibernate for auditing and could be used to keep basic fields like DateModified up to date on all domain objects without needing to be implemented per object.

Look up ‘Object Databases’

E-Book ‘NHibernate In Action’

Session 4 – Automation

Scott Cowan

Build Automation

Nant tasks allow you to write C# code to perform build tasks.

RAKE allows you to write build scripts in Ruby.

BeyondCompare – merge tool, apparently very good.

TFSBuildLab – a CruiseControl.net like plug-in for Visual Studio

TeamCity is free for up to 5 users.

There’s a SCRUM template called E-SCRUM (might actually be Scrum for Team System)

Custom Visual Studio project templates might be a good way to decrease startup time for new projects. There are probably project templates out there which would be useful.

CIFactory is a tool to create Continuous Integration environments.

TFS Build Center
Brian Harry/Harris – MVP let library of build tools for TFS.
Ron Howard

Practical Project Automation – book about Java tools for automation.

Check out Final Builder

Posted in .net | Tagged: | Leave a Comment »

Alt.Net UK Warmdown

Posted by andrewmyhre on February 2, 2008

Just arrived back from the Alt.Net UK conference. Unfortunately I couldn’t join everyone else for drinks (god knows I wanted a few by the end), but I got loads out of the day itself.

Thanks to everyone who came and made it an inspiring day, thanks to the organisers, Alan and Roy, Michelle and her team for keeping everything running smoothly and making us feel welcome, and of course Conchango for providing the venue and taking interest in the event! The discussions were all well informed and earnest, and I came away feeling like I’ve got a lot to learn but equally that I’m on the right track. Basically it’s good to know that there are others out there. Also had a few cool conversations and even may have managed to help someone out with their project (I hope!).

I’ve got a Word document will all my notes so I’ll put together a proper post with all the gore, but right now Real Life intervenes (prior commitments, hence I couldn’t join the others at the pub) so it’ll have to wait until tomorrow.

So a big THANK YOU to everyone involved. Looking forward to the next one.

P.S: I think I might be going to Mix 08 in Las Vegas. Fingers crossed.

Posted in .net | Tagged: | Leave a Comment »