Tuesday, November 19, 2013

NuGet.PackageNPublish - The Roadmap

To date, development progress on NuGet.PackageNPublish has been pretty erratic. Fundamentally, this is due to it being my pet project, and changes / fixes / enhancements have only been forthcoming when and if I personally need them.

As we approach 13,000 downloads of the tooling (thanks, all), I figure I ought to have come up with some kind of roadmap - so here are my thoughts

v0.8

This will bring the tooling up to date and use v0.8.0.2 of the NuGet.PackageNPublish nuget package, fixing the following issues:


I'm basically there with v0.8 - just final tidy ups and the release note to do - tho' I've been promising that release for a good month now - sorry.

v0.9

This is the time to shake things up a bit - specifically, I planning on dropping support for the VS2010-flavour VSIX build project, replacing it with a VS2013-flavour one. This will mean that the tooling can only be build on VS2013 and above, but I don't think that's too much of a step forward.

Also, I have a mad plan to add two new project templates to the tooling:

  • Octopus Deploy Package
    This project template is basically the equivalent functionality to adding OctoPack to a web project, but broken out into it's own packaging project.

  • Octopus Deploy Azure PackageThis project template is what I demonstrated (manually) at DDD East Anglia and DDD North 2013 this year - a packaging project that's designed to take the output from an Azure cloud project and package it for OctopusDeploy.


v1.0

This is the big one - I plan on finally fixing the single most troublesome issue with NuGet.PackageNPublish:


With that fixed, I'm of the opinion that the tooling would at last be "feature complete" (hence the v1 release). 

So that's my plan... and I'm very much open to your comments on it, and on what the focus of the v2 stream should be!

Monday, October 21, 2013

DDDNorth 2013 - A retrospective

So it's the morning after the DDDNorth before, and for a change I'm going to write my retrospective with the event fresh in my mind.


Update & Admission: It took more than that morning to finish this post!!

I'd flown up to Newcastle the night before, and stayed the night in The Roker Hotel along with a few of the usual suspects, so in spite of a fairly late pre-DDD night in the bar, a bracing early morning run along the front and a good Full-English breakfast (with proper Black Pudding) ensured I was refreshed and ready for the day.


Catching a lift over to the venue (thanks Dave) got me to the venue bang on time.  



Early Morning on a Saturday


The venue for DDDNorth was the University of Sunderland campus at St Peters - using the library and its cafe as the central meeting point, sponsor showcase and general chat area, with sessions in that building, the David Goldman Informatics Centre and the Sir Tom Cowie Lecture theatre. 

The speaker room was in the Informatics Centre, so that was where I headed first, just in time to hear the speaker briefing and grab my (very nice, and Sage sponsored) purple speaker's t-shirt. Pleasantries over it was straight over to the library building for my first session. This time, I was much more comfortable with my presentation and equipment, and was on after lunch, so could properly enjoy DDDNorth as a delegate as well as a speaker.

First up was Phillip Trelford.


F# Eye for the C# Guy


Given that F# was added to VS2010, I'm amazed I've not even written "Hello World" with the language, so this introduction was always going to be new information to me.

Phil's presentation style is one full of energy, and I think he bagged the first ponies of the day in about the first 5 minutes, making the point that whilst it's often considered a language for "Financial / City" types, the 'F' is actually for FUN.


"F# is a statically typed, functional first, object orientated, open source .Net language, based on OCAML and available in VS and Xamarin studio."

Phil then went on to compare a 40-50 line implementation of an immutable POCO with first the 12 line and then a ONE line F# implementation. And then followed this up with examples of unit testing F# using effectively plain english tests via the TickSpec package, and "metaprogramming" samples using the F# quoting syntax ( <@ some code @> ) and the Unquote NuGet package.


"F# code is consistently shorter, easier to read, easier to refactor
and contains fewer bugs than its C# equivalent."

I was fairly skeptical when Phil stated that 30,000 lines of C++ code (for an unnamed financial system) had been replaced by only 200-300 lines of F# until he demonstrated a fully functional spreadsheet written in less than that!

Finally, he showed some of the "even funner" aspects of F# - including Pacman and Mario written in F# and cross-compiled to Javascript using Funscript.

I think that the F# eco-system is one to watch, and am very glad to have had such an engaging introduction from Phil - even without his "F# language jobs pay more" slide!


Scaling Systems: Architectures that Grow


Kendal Miller's session was a no-code, all-content affair that was entertaining, enlightening, and provided a 4-point guide to the issues surrounding scaling enterprise-level systems. The fact that I ended up with over 6 pages of notes is testament to how well he engages his audience.

First up was a mantra to code by:


"Time you spend making your software scale is time you're NOT spending delivering functionality."

Kendal then described how most applications (web or otherwise) will fail to scale out of the box, but when considering scalability you need to target the lowest practical numbers for response and loading as "scaling costs REAL money". The techniques usually applied to the problems of scalability he described as only "tactics" - understanding the key principles first is more important.

Kendal then described the four key factors to scaling - 3 that enable you to scale, and one that throws a spanner in the works of all four - Kendal's ACD/C factors:

  • A - Asynchronicity

    Do work - just NOT in your critical path. Defer it to later, or do it ahead of time.

  • C - Caching

    Don't do any work you don't have to - the fastest query you can ever run is the one you only ever have to run once.

  • D - Distribution

    Share the work between as many workers as you can - this is the easy route.

and the kicker

  • C - Consistency

    Agreeing on the level of consistency REQUIRED is the compromise that has to be made.

Kendal then went on to explain these all in much more detail, with great anecdotes to support his opinions - including describing how Amazon do basically NO work at all at the point of you placing and order, and how a he once lost an entire tractor in spite of what his inventory system said. 

I loved Kendal's session, and will be pushing ACD/C hard at work.

Last up before lunch was Richard Fennel's

Automation is not the end of the Story

Richard started by setting the scene with what he considers the minimum for build automation


  • Continuous Integration
    • Unit Tests
  • Nightly FULL builds
    • Static analysis
      • FxCop, CAP.Net, SpCop, StyleCop
    • Signing & Obfuscation
    • Deployment packaging
  • Manual release builds
He then went on to discuss what "deployment workflow" considerations should be made - in particular who can sign off a build as acceptable and who can promote between environments.

"Your build should be a bridge to the operations team - a shared language"

Finally, Richard gave a whistle-stop tour of some of the tools that are available when taking your build process beyond the desktop, including


  • ALM Rangers TFS Build Best Practice
  • Lab Management
  • OctopusDeploy
  • MS Virtual Machine Manager 2012
  • ALM Rangers VM Factory
  • Puppet
  • Chef
  • DevOps Workbench (Beta)

Richard's talk was informative and thought-provoking, and gave pointers to some tools I wasn't aware of and will definitely investigate - and it was a good precursor to my talk on OctopusDeploy.

Lunch was the usual brown bag sandwich affair, and with very nice sandwiches too, which I spent in the Library Cafe catching up with Eric Nelson and others. I had to make my excuses and leave a bit early because I wanted to check out the equipment in my room, as I was up next with

An Introduction to Octopus Deployment

This was my talk in which I covered the basics of WHY you need automated, repeatable, controlled deployments and WHAT OctopusDeploy is and HOW it provides a very nice out-of-the-box solution.

I demonstrated deploying a web app using OctoPack to package it and the Tentacle deployment method for "local" servers, alongside the SFTP method for "remote" servers (in my case an Azure WebSite).

Finally I showed how Azure deployments require a specific flavour of OctopusDeploy package, and how my NuGet.PackageNPublish tooling could be tweaked to create it.

All the resources, projects, slide decks, etc can be found in the GitHub repository.

I must admit to a certain amount of trepidation - amongst the 30 or so audience were the inimitable Liam Westley (who kindly acted as my room monitor) and Richard Fennel. Given how attentive (and non-heckling) both were I think it went well - and it was lovely to receive a tweet the next day from another attendee saying that they would be using OctopusDeploy soon because of my talk.


Update: The feedback scores are in - and very positive. I promise to talk louder next time tho'!

Finally, I moved just into the next room to hear Liam Westley talk about

Event Store


Event Store was created by Greg Young (of CQRS fame), and is an open-source document database written in C# with an embedded Javascript v8 engine that can be installed in single-node or High-Availability modes.

Liam quoted Jeff Attwood, saying

"OR Mapping was the Vietnam of Computer Science"

and went on to describe how metadata within a software system can often be as important as, or even more important than the data on which the system operates - and yet it is most often lumped together with that data in some kind of relational store.

Event store addresses this by providing a tighter focus - it's create & read ONLY, there are NO updates and NO deletes - the data is immutable in perpetuity.

It provides a simple, performant ReSTful api over HTTP or TCP using AtomPub as the representation. As such it's designed to be cached, and provides automatic versioning and an implicit CQRS / message queueing architecture.

"Indexes" (and you have to use that description lightly) are provided with data projections implemented using a Javascript derived domain language.

Liam then went on to demonstrate how to set up Event Store (including the oh-so-important

netsh http add uracl url=http://*.2213/ user=<serviceUser>

to enable access to the Event Store service.

Next up were demonstrations of projections against the DDDNorth agenda data that showcased how data can be transformed into "streams" of filtered, sorted or aggregated derived data - which is where the power of the software is really manifest. And not forgetting to start Event Store with the --run-projections=ALL option.

All in all, Liam managed to pack a lot of demos of a new and exciting addition to the software developer's toolkit into a short time - yet more to investigate.

Close

The day ended with the usual thanks, swag and farewells - including Sage giving a Surface Pro away, a NDCLondon Golden Ticket (won by Dave!) and Microsoft a MSDN license.

The young lad who won the latter was a student at Sunderland, and was initially non-plussed by the small package. When he asked "So what's this worth?" and being given the answer it was a joy to see his reaction - first shock at the monetary value, then what looked like abject terror at the value of the associated licenses, and then finally the slow realisation that he'd been given the tools to really make the most of his calling to software development. 

I could think of no greater illustration then of how powerful the DDD movement can be - bringing together devs from all backgrounds and levels to learn and share in our community.

Andy Westgarth had once again provided a perfect day, marshalling a great array of sponsors, providing a great venue and a great line up of speakers. The crowd rounded it off by giving him a rousing ovation - ultimately absolutely deserved.

Roll on next year - somewhere in the North West.








Tuesday, October 08, 2013

Announcing NuGet.TfsBuild - Private package repository support for TfsBuild

TLDR: NuGet.TfsBuild is a new NuGet package that works with NuGet Package Restore so that private (protected) package repositories can be used with TF Build Services.



A couple of months ago, as an experiment at work, we set up a real project on the cloud-hosted TFService. The goal was to see whether the entire project could be run in the cloud - from work item management, source code control, builds and automated testing. 


Because this was a "REAL" project, we were leveraging NuGet packages from our internal NuGet server - ones that contain proprietary code and couldn't just be shoved onto a public NuGet server. So the packages had to be sourced from a private, protected NuGet server - specifically a private MyGet feed created for the purpose.

But that's where we hit a bit of a snag - we wanted to use TF Build Services to avoid having any specific build server (virtual or physical) - but that means not being able to configure additional NuGet package sources.

You'd think that you could just add the package source to the nuget.exe.config chat gets checked in when Package Restore is enabled - the problem is that the credentials for a private package source are encrypted in the file using a key that's specific to the specific user on the specific machine that's doing the build.

And that would never work with TF Build.

Our solution - a NuGet package that adds an additional build step to the project that reads the package source and credentials from the MSBuild parameters - i.e. from the build DEFINITION rather than either the source, or machine configuration.

The upshot - it just works. The private package source is configured at the start of the build, just before PackageRestore kicks in for the first project being built (usually your "primary" project).

So today I'm very pleased to announce that Landmark Information Group ( http://www.landmark.co.uk /http://twitter.com/LandmarkUK ) have released this little helper package on NuGet.org, with the source code released under the Apache 2.0 license on GitHub.




Fork it, fix it, raise issues, generate pull requests, use it and enjoy it!

Wednesday, July 31, 2013

Wednesday Quickie - When VS Bites... Itself.

This one caught me today... When loading a crashdump into Visual Studio, the IDE can get its knickers in a twist and cache all the symbol files in the same folder as devenv.exe.

That'd be fine, but the symbol files are cached in folders with the same name as the DLL - so the IDE creates a FOLDER named System.dll (etc) in its own folder - and next time you try and start Visual Studio you get this...


Unpleasant, for sure. Fortunately, I found a Connect discussion that showed the problem, and it's easy enough to fix by deleting all the (obvious) cache folders from C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE.

Just annoying, and I'm sure I've still got more clart to clear from the IDE directory. (sigh)

Wednesday, July 10, 2013

DDD East Anglia - A Retrospective


With no DDD South West this year, the first DDD event of 2013 was the inaugural DDD East Anglia. Held in The Hauser Forum on Cambridge University's West Cambridge site, the location was excellent for me as I have family living close by. So on a bright Saturday morning, I skirted around William Gates to park up behind Roger Needham (the buildings, that is), before joining a trickle of other early risers heading for the event.

Sign in was painless - Phil Pursglove & the team had used EventBrite to manage the ticketing, and had pre-ticketed the speakers - and then it was into the Speaker's room to drop off my bag before finding that essential first cup of coffee and a couple of very nice Danishes to start my day. Catching up with old DDD friends Chris Alcock and Michaela Murray meant I missed the speaker briefing (sorry Phil!), and had to sneak into the back of the "Welcome & Housekeeping" introduction.



Session 1

First up on the agenda was a choice of "SignalR: Ready for Real-time" with Dave Sussman, "Async C# 5.0 - Patterns for Real-World Use" with Liam Westley or Pragmatic Dependency Injection with Ian Russell. I'd already seen Chris Alcock's SignalR talk at DDDSW4, and Liam's Async Patterns at DDDNorth2, and have lost count of the number of times I've given a DI talk at work myself, so took the opportunity of treble-checking my own presentation deck and samples in the Speaker room, and to check out the contents of the goodie-bag.

For the first 10 minutes or so, it was a place of quiet work and contemplation - until Mark Rendle arrived (following a hair-raising left-rear Pirelli blow-out on the motorway the night before), and re-kindled what was clearly an on-going wind-up session with Rob Ashton that at one point had me practically in tears with laughter.


Session 2

With my presentation ready (and that one last-minute important mega-slide added to the deck), I headed into the first of the three seminar rooms to hear Chris O'Dell talk about how they have embraced continuous delivery and Kanban at 7Digital.

Chris described their development process, and how they've moved from what was once a painful waterfall process to a highly agile, fast-sprint, multi-track development process where live releases happen almost all-day, every day (except after 4pm and on a Friday)


The key take-aways were:

  • To ensure that Tech Debt is highly visible.
  • To visualise tasks as soon as they are identified
  • To move Product Owners PHYSICALLY nearer to (or even better embedded within) the development team
  • To foster a no-blame culture
  • To hold twice-weekly cross-team show-n-tell sessions to enable cross-pollination.
  • To promote retrospectives, particularly for management
  • To radiate metrics and visualise them - the more the better - displaying them on monitors all around the office, and continually updated to the minute.
  • To analyse cycle time for changes per feature and the number of features completed per sprint or per month as the prime KPIs.
Chris described how adopting this process doesn't happen overnight, in fact it took many months to bed in at 7 Digital. Pair programming and TDD with LOTS of unit tests and plenty of acceptance tests accelerated the process - and advocated inverting the "Testing Triangle", so that your process relies more on unit tests and automated integration tests than end-to-end tests.


At 7 Digital, the teams are cross-functional, but focused on a fairly small cross-section of the overall component set (7 Digital use small-API service based components), but there's a fair amount of movement between teams - allowing staff to dip into any component they find interesting or to get a broader view of the whole.

Their deployment process is entirely automated - a small fix can go from analysis to deployed in a couple of hours, and Chris emphasised that the ability to do a scripted "roll-back" is essential (although like many companies, roll-back is actually a roll-forward of a previous release at 7 Digital).

They have a blue/green flip-flop deployment process - similar to the Azure Production / Staging system, and use feature switches (where features are enabled in the code-base via configuration) rather than having code-branches in source control. A vital part of the process is running smoke-tests on the deployed code to verify basic functionality immediately rather than waiting for a user to be impacted by a fault.

Their acceptance tests are all Cucumber and browser based, and are the fundamental quality gate - breaking an acceptance test for a new or existing feature is guaranteed to raise red-flags.

I really liked Chris' presentation - it provided an insightful from-the-trenches view of how Kanban and continuous deployment can be made to work well, enabling a continuous flow of feartures being released..

Session 3

Session 3 was Rob Ashton's "Testing MVC" presentation - fast-paced to the point of almost being manic, funny, thoroughly enjoyable, and containing a good number of ponies to boot, Rob was effectively a proponent of exactly the opposite of Chris's methods, arguing against inverting the testing pyramid, and of doing "barely enough" to ship a workable product. All the same, Rob still gave a plethora of hints and tips, including:
  • Always write a statement of intent (feature / scenario) first.
  • The most important thing about testing MVC are speed + feedback
  • PhantomJS is (currently) cool, but DO use WebDriver to run it. Selenium (currently) sucks. 
    • Next month may be different
  • Avoid duplications in UI tests at ALL COSTS.
  • Coypu is the Capybara equivalent for .Net
    • For writing UI automation and abstracting away the client UI
  • There is no excuse for UI tests to be slow
  • Don't bother trying to abstract RavenDB
  • Actions on your model are good
  • Sometimes simple is absolutely good enough.
  • If there's logic in the controller, try pushing it into the model, or a service
  • With simple, facade controllers, you don't need controller tests!
  • Controller actions should never have more than ONE "if" statement
  • All your logic should be abstracted from the MVC framework for testability.
I'd not actually been to one of Rob's talks before, but he's so entertaining, and presents with such enthusiasm that I can see why he's such a popular speaker.

Grok Talks

After Rob, was lunch - the standard fare of a sandwich bag, but a very nice sandwich bag all the same - and Grok Talks.

I missed the first couple, as I was too busy eating and catching up with Liam Westley, but caught an excellent short talk by Richard Dutton on how they write the pit-wall and back office software in the Infiniti Red Bull Racing Formula One team.

I'm hoping he'll submit a full talk for a DDD event, as in the 10 minutes he hinted at a development pace few companies can aspire to, with data sets and data rates that would make most devs blanch, even without 6 hour feature deadlines when races are back to back. 

Session 4

My final session (as an attendee as opposed to a speaker) was Ben Hall's "Startups and Minimal Viable Products". This was a no-code, all slide discussion of taking the lean startup mentality as far as it can go.

Ben is "Hacker-in-Residence" at a startup incubator, and brought a "lot of experience of failing" to his presentation. As such, it was very much about "Quicker, faster, leaner" and getting your idea off the ground... and about knowing when to can the idea without remorse.

He described the mantra of "lean startups" - namely that of going from Idea to Build to Release as quickly as possible. Until the product has been built (or at least convincingly faked), then there's no way to measure its impact and acceptance. And without measuring the success (or failure) of the product, you can't learn or make decisions about it.

With that process in place, then it becomes good to fail - but you need to fail FAST. It's no good hanging onto a failing concept just because YOU like it if its' never going to succeed.

Success, however is not about WHAT you do, but WHY you do it. Ben drew a comparison between Apple who design beautiful products (including beautiful laptops) as opposed to Dell who "just make laptops". The difference is the belief in the vision, not in the implementation.

Part of the success (or immediate failure) of a startup concept can be driven from a "Business Assumption Exercise", which provides a framework for deciding on the basic "Go/No-Go" decision. Ben talked about developing 4 or 5 initial concepts to the wireframe stage before lunch, canning 4 immediately and then developing the last concept in the aftenoon to decide whether it had legs or not.

This kind of velocity is frankly mind-boggling, but I can see how it gets results - the wheat is separated from the chaff at a VERY early stage, and little effort is expended unless there's a very good chance of return on the investment.

After Ben's brain-baking session is was on to the last session of the day... mine.

Session 5

My session - "An Introduction to Octopus Deploy" - was designed as a very light look at an interesting new product that makes deployment of (particularly, but not only) web apps to server clusters easy.

I've uploaded the slide deck here, but hope that the main take-away for the attendees was that
  • Controlled deployment is essential
  • Rollback matters
  • Octopus Deploy is a pretty good turnkey solution for deployment
  • Packaging your software for deployment is pretty easy with NuGet, especially with 
    • OctoPack - for web sites
    • NuGet.PackageNPublish - for Azure (see how I got that in too!)

Closing

After my talk, there was a few minutes of re-organisation of the 3 seminar rooms into one before the closing swag-out. Phil used the DDDSW method of picking feedback sheets - though not as quickly as Guy Smith-Ferrier has done in the past, so there was less of a scrum around the swag table. Redgate again gave away some great software bundles, but the mega-swag of a pair of iPad minis was definitely the icing on the cake in terms of swag.

DDD East Anglia was a great success in my opinion - good location, great talks, fabulous organisation - Phil and the team should be justifiably proud of their achievement.

Do roll on DDDEA 2!






Thursday, June 27, 2013

Thursday Quickie: Installing Windows Drivers for Apple Keyboard, Magic Mouse & Magic Trackpad

Well that was easy!

Unlike previous methods, with the latest release of the BootCamp software, installing drivers for the Apple Keyboard, Wireless Magic Mouse, and Wireless Magic Trackpad couldn't be easier, as all the driver installers are nicely placed in a folder and are ready to go.
  1. Download the BootCamp 5.0.5033 software (http://support.apple.com/kb/DL1638)
  2. Extract the ZIP file somewhere (e.g. c:\temp)
  3. Drill into the following folder
    • c:\temp\BootCamp5.0.5033\BootCamp\Drivers\Apple
  4. Install the drivers
    • AppleKeyboardInstaller64.exe
    • AppleMultiTouchTrackPadInstaller64.exe
    • AppleWirelessMouse64.exe
    • AppleWirelessTrackpad64.exe
  5. Reboot.
The down side (if you consider it as such!) is that Boot Camp 5 only support 64-bit windows. For 32-bit Windows installations you'll need to revert to an older Boot Camp version and a more complex installation process.

The OTHER downside is that the "stuttering mouse" bug still appears to be there for me at least. :(

Tuesday, June 25, 2013

NuGet Package'N'Publish v0.7.0.0 Released


I've just pushed NuGet.PackageNPublish v0.7.0.0 to NuGet and the Visual Studio Extension Gallery.

Source is on github as ever - https://github.com/JoelHT-Landmark/NuGet-PackageNPublish

What's New?

Wednesday, May 22, 2013

Wednesday Quickie: Using BuildUp with Unity

Here's a quick reminder...

When using Unity and its BuildUp() method to fulfil property-injection dependencies, the syntax

container.BuildUp(myObject)

will not in itself work - even though it compiles just fine! Instead, use

container.BuildUp(myObject.GetType(), myObject)

and the property-injection dependencies will be fulfilled.

Thursday, October 04, 2012

NuGet Package'N'Publish v0.6.0.1

I've just pushed NuGet.PackageNPublish v0.6.0.1 to NuGet and the Visual Studio Extension Gallery. This is a fix for the borked v0.6.0.0 I rushed out yesterday - it now really does work in VS2010 and VS2012!

Source is on github as ever - https://github.com/JoelHT-Landmark/NuGet-PackageNPublish

What's New?

  • Builds on VS2012
  • Targets VS2012 and VS2010
  • Includes support for both creating and publishing Symbol packages.
  • Packages the package\content folder by default, and includes that folder in the template.
  • Numerous bug fixes to the NuGetPackageAndPublish.targets file.

Want to know more?

Check out the introduction first - but I'm going to follow this post up with a walkthrough of using the tooling later today.

Monday, September 03, 2012

DDD 10 - A retrospective

Developer Developer Developer 10 has now been and gone, and so I'm once again distilling 15+ pages of notes into a summary as both aide-memoire and commentary on what was (once again) an excellent community event.


I arrived bright and early on Saturday morning at Microsoft in Thames Valley Park - for the first time fresh and relaxed after a mere 15 minutes from home. Bliss.

Registration was quick, easy and efficient and it shows the draw of this event that Building 4's reception was pretty full even at 0820. 

After catching up with a few friends and the odd colleague, I headed to the area in front of Chicago 1 and 2 to find food and coffee - the sausage butties going down a treat

Fortified and ready to go, I was briefly distracted by the O'Reilly book stand - and then quickly divested of cash for a couple of books that I just HAD to buy. "Just keep telling yourself, 'Tax Deductable'..." was the mantra for a lot of people around that table, I think!

With the introduction and housekeeping from Phil Winstanley out of the way, including the announcement of DDD Norfolk East Anglia next summer, it was straight into the first session.


Language pattern anti-patterns, aka "C# - the broken bits" - Jon Skeet


Standing room only for Jon Skeet
Jon's session could well have been billed as "Jon Rants At Cr*p Language Design", but his humour and flair made this a must-see - as the standing-room crowd attested to.

The session was thought-provoking in analysing some of the the oddities of C# in the context of more general principles of language design - the two key take-aways being
  • "Language expresses ideas - it is COMMUNICATION.
  • "C# is generally a well-specified language - others are not"

There were also more specific things to take-away from the session to do with the niceties of C# , including an interesting sample demonstrating how picking a different framework version can give radically different behavior due to changes of co-variance for IEnumerable.

The sock-puppet "Tony The Horse", and "Evil Code Hench-Kitty" had to give centre-stage to "Beary Dorans", however - a bear that glared balefully at delegates from the desk in Chicago 1 for the rest of the day.

Next up was a double act...


Stuart and Simon both with with Phil at Microsoft - and it's a somewhat radical departure that Microsofties were allowed to present at a DDD event. That being said, there was no corporate push, nor branding, in what was a very well thought out talk on the "Rules" of writing ASP.Net MVC the right way.
  1. No Business Logic in MVC Controller actions
  2. Maximum of 15 loc per MVC Controller action.
  3. No base controller class
  4. No Javascript (embedded) in C# code 
  5. Always use strongly-typed views
  6. Minimal logic in views - 1 loop, 1 branch
  7. No javascript in views
  8. No base views.
  9. No behavior in ViewModels
I for one agree with every one of these rules - tho' have to admit to have being guilty of implementing code that breaks all of them. The helper classes presented (and linked here) give solutions to aligning your code with the "Rules" and are something I'm going to be investigating.


Raspberry Pi-lovers
Next up was a change of pace - a session that had (almost) nothing to do with .Net or the code I write day-to-day. 

But as my own Pi has been languishing on my desk at home waiting (literally) for a rainy day for myself and my boys to play with it, this was one that was going to get my mind filled with ideas. And this was another session that was rammed to the rafters.

Garry gave a great intro to the little-computer-that-can that is the Raspberry Pi, and showed a demo of a web-app running on Node.JS on the Pi, with C# Mono worker-processes.

During this session, the power of Twitter was demonstrated when my pen ran out of ink. A speculative tweet resulted in Craig Murphy hand-delivering a RedGate pen to me in the middle of Gary's talk - now that's service!

After the usual sandwich/crisps/fruit/chocolate/can'o'drink lunch, which most people were able to enjoy in the sun in the Building 4 amphitheatre, it was on with more hardcore coding stuff.

Performance & Scalability The StackExchange Way - Marc Gravell

Marc presented some of the issues StackExchange had experienced with ASP.Net MVC sites, and looked at ways to investigate and solve performance problems.

The biggest take-away came from the first couple of minutes, and was that


"Adding servers is NOT a silver bullet."

Marc went on to demo MiniProfiler and show how it can help bring to light both rendering and pipeline issues, and SQL issues. MiniProfiler is definitely something I'm going to investigate and integrate with our standard practices.

He also suggested that devs should borrow from CQRS best-practice and implement a KISS approach - using a lightweight "microORM" such as Dapper.NET for reading from a database, and a full-fat ORM (e.g. EntityFramework) for C_UD operations to allow better optimisation of the most common activities.

Next up was something bang-up-to-date

Windows 8 with XAML and C# - Kris Athi

Kris started slowly, but built up to demo'ing the code needed to really make a Windows 8 Metro Modern application shine, including notifications and the five view states that you need to implement.


Dr Who Cupcake - Nom!
After the final break - with delicious Dr Who cupcakes care of Gibraltar Software, it was the turn of the ineffable Mark Rendle.

Simple.Web 101 - Mark Rendle

Mark was introducing his Simple.Web framework - a kind of "little brother" to Nancy that is even more pragmatic - making RESTful services a doddle.

There were a couple of head-scratching moments as he described the framework, but it's clearly a powerful little beast, and would probably have been a better choice then NancyFx for me in the last month or so had it been properly available. Another one to investigate.

Mark did have to suffer heckling on voxpop.at during his session (that'll teach him to put it on screen), including an atack of Rainbow Ponies (you had to be there!) - but it was all good natured and nicely punctuated the session.


Finally it was time to head outside into the amphitheatre for the traditional swag-out.

Nothing for me in any of the raffles, but others went away with books, ebook vouchers, RedGate stuff and one lucky punter even got a soon-to-be-obsolete-when-Windows-Phone-8-RTMs Nokia Lumia 800 running Windows Phone 7.5! 

But many still wondered why Microsoft didn't want to shift more swag after it's recent re-branding. 

All in all, it was another definite win for the DDD team. Slick organisation, great sessions, and a great community spirit - roll on DDD11.

The DDD 10 Team Swagging Out

Monday, June 11, 2012

Developer Developer Developer South West 4.0 - A Retrospective

I'm rather late to the party with this post - Chris Alcock posted his round-up of DDDSW4 links over the weekend. But for my own recollection this post is probably a good idea.

This was my third DDDSW event - but this time was different - I was a speaker not just a delegate.


6:31 AM - 26 May 12 - Half-way around.
The location in Bristol works for me as it's my old stomping ground from University - I studied Computing for Real-Time Systems at UWE under Rob Williams


It was a toss-up whether I should go to the Friday speaker dinner or catch up with old friends instead - getting together with the old gang won out, but it was probably for the best it wasn't a 3am finish as has happened in previous years! Still, it's a testament to the friendships that you can create in a small startup that two friends I'd not seen in over a decade joined the usual suspects - and that it felt like we still used to hang out every day.


So Saturday dawned with an early start and a 5km run to wake me up and set me up for the day (10km if you believe RunKeeper - I don't!).


Then off to UWE to check in, just in time for the Speakers' briefing - this might have been intimidating for new speakers but for Guy's delivery which was just the right balance of "check it, check it, check it again" and humour - especially at that early hour.


I think as a delegate whilst you appreciate the some effort that goes into making DDDSW work, I for one had very little idea about just how much required to herd speakers to the right place, get swag organised, manage the rooms, etc. Guy Smith-Ferrier and the team do an amazing job.


So after the speaker's briefing I wandered off to what was to be "my" room for the pretty much the whole day. I was speaking in Track 4 in 2Q43 and didn't want to risk not being prepared, so the first order of the day was to check projector connections and ensure my laptop was ready for action. 


Session 1 - "What's new in Entity Framework v5 (beta 1)" - Geff Lombardi

First up on Track 4 was Geff Lombardi, talking on "What's new in Entity Framework v5 (beta 1)". Geff's talk had a good balance of slides and coding (i.e. not too many of the former), and demo'd the new DB migrations features of EF. I'm not quite sure I've got my head around it, or how (or if) I can apply it to my codebase, but Spatial and Enum support will be the first things I'll play with, closely followed by the EF Power Tools.

All good stuff, but I'll admit my mind was really on the next session - mine! So after Geff finished I set up - doing a quick run-through of my slide deck and pre-loading the IIS apps I was going to demontsrate. As the room filled up the nerves really kicked in - and then we were off. 


Session 2 - "Using your NuGet for Fun & Profit" - Joel Hammond-Turner

For any new speaker I can only recommend practice, practice, practice. I'd run my talk no less than 5 times for my colleagues at work, so it was no surprise that the contingent from Landmark that came to DDDSW4 didn't want to come see it again. But practicing on them paid off when speaking in front of the DDDSW delegates - I soon forgot my nerves and cracked on.

I covered the background to our use of NuGet within Landmark, and the challenges we had had to overcome in packaging our internal libraries as NuGet packages - and then demo'd the NuGet.PackageNPublish tooling we'd developed. There was a nice ripple of appreciation when I pointed out that in the time it took to describe how the tooling worked (about 60 seconds), I'd created a packaging project.

Then I covered the options for hosting private NuGet feeds, including file-shares, NuGet.Server, NuGet.Gallery and the two commercial offerings - and had the fact that I'd missed TeamCity's new NuGet functionality!

Questions were asked and answered and towards the end of the session, we were having more of a round-table discussion than a presentation, with Mike Ackah and John Stovin in particular deep in the fray (and winning swag for their contributions).

I finished off with a quick refresher on the HanselFix for when NuGet.org goes down and announced that the NiGet.PackageNPublish tooling had been released as open source under the Apache 2.0 License by my company, Landmark.

Open-sourcing the tooling drew a round of applause that made the whole exercise in getting my session together worth it - it's been a good couple of months' work getting all the clearances and publishing everything. 


Once I was finished and cleared away I looked at the agenda for the first time to see what to go to next - and my first choice was in 2Q43 again. I felt like I was going to be living in that room for the day!


Session 3 - "Unit testing with Visual Studio 11 Beta" - Richard Fennell

Richard is always an excellent speaker, and this session was no exception, covering the new test runner, the always-on tests (very like NCrunch), and the multiple test runner plug-ins. This latter I would say is probably the stand-out feature - the ability to use the test and mocking framework combination best suited to your testing needs will I'm sure only reduce the friction when unit tests aren't quite first-class citizens in the development process (i.e. you're not doing pure TDD).

Next was lunch time - and the DDDSW team did us proud with a choice of sandwiches, crisps, cake, fruit... and hot pasties! Distinctly NOM time. Catching up with my Landmark colleagues outside by the pond, it was clear that all the other sessions that morning had been as good as the ones I'd been to, and it was on recommendation that I went to my next session


Session 4 - "WebSockets and SignalR" - Chris Alcock

Chris obviously made a good impression on his first go, because his repeat track room was absolutely rammed - all the chairs and all the tables along the back were full, and people were hanging in through the doorway to listen in.

Chris gave a great introduction to WebSockets and contrasted that low-level javascript technology with the "nicer" abstraction offered by SignalR. Talking about this with someone else later on, his use of a sample OTHER than the traditional text chat was a big win. For me (and many others, I'd imagine) the possibilities of calling client methods from the server and vice versa through one service API (SignalR) are endless and exciting - and Chris' demo really peaked my interest.

After Chris's session it was time for one of the regular highlights of the DDDSW experience - the cream tea. The food queue always seems to be an interesting experience - this time running into Johnno Nolan, Mark Kirschstein, and others from the Manchester NxtGen crowd. The one problem with any DDD event seems that there's never enough time to catch up with everyone you want to. I even "dissed" my Landmark colleagues and caught up with Chris Alcock & Dave Sussman in the Speakers Lounge. It was slightly surreal sitting there, not as a delegate wanting to dig for more information but as a speaker just shooting the breeze.

Session 5 - N/A

Yep - I never made it to any of the last sessions of the day... Setting the speaker world to rights with Chris & Dave (there's a Rockney band in there somewhere!) just rolled on into Session 5 - and after about 20 minutes in the heat of the Q-Block rooms forced me outside for only the second real bout of fresh air of the day.


I made it back in for the Close and Prize Draw - getting all 300(ish) delegates into that one room at the end really pressed home what a great event Developer Developer Developer South West is. I missed the geek dinner that night too - rescuing my wife from our children being the greater priority - but still came away with memories of a great day of geekery.


And finally...

I've got to thank the audience for my first-ever DDD session - they were very gentle with me - and from the feedback I received I'm pretty damned happy, averaging 8.0 for subject knowledge and 7.32 for presentation skills. And I know exactly how I'm going to improve and update my NuGet session if it get's chosen for DDD 10 in Reading in September! That one I'm NOT going to miss the speaker or geek dinners, either!

My company, Landmark, deserves thanks too, for sponsoring me and open-sourcing the NuGet.PackageNPublish tooling - giving me a great big comfort-blanket of support.

Even though none of my colleagues came to heckle me!


Thursday, May 03, 2012

Thursday Quickie - Lightswitch Build Issues #2 - XAP Signing

Update: 2015-05-20 - No idea why I never published this Quickie! Three years is way too long for a blog post to languish in the Drafts folder!

Wednesday, May 02, 2012

Wednesday Quickie - Getting rid of those darned connection string parameters

This quickie relates to the parameters used by MSDeploy to transform your web.config when a web application or site is deployed.

By default the deployment targets (Microsoft.Web.Publishing.targets) used when building a deployment package for a web app will automatically generate entries for connection strings. The problem is that it chooses really awful tag names for the parameters - for example:






This gave me a problem as the configuration system we use at Landmark to deploy our web apps can't have any spaces in its parameter tags. Fortunately, there's a quick solution.


It's easy enough to add a Parameters.xml file to your project to provide custom parameters - and in that file it's trivial to include a duplicate connection string parameter definition (that doesn't have spaces in the name).


The final part of the puzzle is to prevent the deployment targets from creating the default connection string entries on build. This is achieved by passing in the following (memorably-named) MSBuild parameter:
/parameter:AutoParameterizationWebConfigConnectionStrings=False
The deployment targets no longer add the connection string parameters by default, so you have to do so explicitly in your Parameters.xml file - but now YOU control the parameter name. Done.