Friday, 12 December 2008

Awesome WPF Data Binding Session

Last night saw a great session at NxtGenUG Southampton with Josh Twist showing us his WPF data binding and Expression Blend skills. It was the second time I've seen him do this session and its still great.

For anyone interested Josh's blog is: http://www.thejoyofcode.com

Wednesday, 10 December 2008

Lets Twist Again

If anybody attended Fest '08 this year and you managed to see Josh Twist perform his WPF and data binding magic then you will know that this guy is an excellent speaker who delivers a fun packed informative session that certainly left me thinking "wow...so that is how you are supposed to use all of this Expression Blend stuff".

Well tomorrow sees the return of the Twist to NxtGenUG but this time we have the pleasure of his company down on the south coast in the Southampton region, Josh will be giving us a WPF and data binding refresher with some new stuff for those that managed to catch the Fest 08 session.

Of course there will be the usual pizza and swag and hey as it's the festive may be there will some merriment of some kind.

Hope to see you there

Monday, 24 November 2008

SQL Server 2008 with Eric Nelson

It feels like it's been forever since the last NxtGenUG meeting but as luck would have it this Thursday sees November's instalment. We've got Microsoft Evangelist Eric Nelson coming down to pay us a visit and give a detailed discussion on the new features of SQL Server 2008 that we all might find a little useful.

There will be the usual pizza and of course swag (which may include some SQL Server Standard licenses) if you are lucky.

For more information check it out here and don't forget to register.

Tuesday, 21 October 2008

Another Cracking Session

Last Thursday 16th October saw another great session at NxtGenUG Southampton, Plamen Balkanski and myself discussed Scrum and Agile techniques and end the session with a planning game that was based around a NxtGen pizza machine.

Everyone was split into groups of 5 people and given two iterations of 10 minutes to produce drawings/models of the end product, the whole point of the game is to give people a very brief introduction into what it might feel like to be on an agile team. The response we had from most members was generally positive and they all had fun although some people were a little confused and didn't quite get it.

If any one is interested in the slides they can be found here.

Thursday, 9 October 2008

"Agile" Birthday to Us

So my run of presenting seems to be continuing what with my WatiN nuggets at NxtGenUG Southampton, followed by my WatiN nugget success at Remix 08 and then a recent WatiN nugget at NxtGenUG Cambridge I figured it was may be time for a change. So I am teaming up with a good friend of mine Plamen Balkanski to do a full session on Scrum and Agile methods at NxtGenUG Southampton, it's also the Southampton region's 1st birthday so it should be quite fun with the usual pizza and swag a plenty.

The session will essentially be an introduction to Scrum, what is it all about and why your company may benefit from using it, but we'll also be getting everyone involved in an agile planning game that will ensure that every single attendee will "feel" what it is like to be involved in an Agile project when it is done correctly.

The session is taking place on Thursday 16th October and you can find more details about it here, I look forward to seeing you there.

WatiNCF - Live on CodePlex

I've had a fair bit of interest in my WatiN Controller Framework recently and after attending Remix the other week and seeing Sara Ford (her blog has some awesome Visual Studio tips and tricks) doing a talk about CodePlex and it's new integration with Subversion clients such as Tortoise SVN I decided it was about time I published it, so for anybody that may be interested, the project can be found at http://www.codeplex.com/WatiNCF.

At the moment there aren't any help files apart from my blog and there is no installation file so you'll just have to download the source code and build it for yourself, if I get a bit of time over the coming weeks I'll post a bit more about how you go about using the framework but if you have any immediate questions in the short term just let me know.

Please feel free to add any comments or submit proposals for changes or even contribute to the project if you like, just let me know how you get on with it if it helps you or even if it doesn't.

I hope you find this useful in some way.

Tuesday, 30 September 2008

Rhinos Stampeding Bristol User Group

People in the community are generally quite a friendly bunch but now and again the green eyed monster can creep up on you when you find that a fellow user group has managed to get an absolutely great speaker and this one is no exception.

Our good friend Guy Smith-Ferrier has managed to secure a session with Oren Eini (aka Ayende Rahien), the founder of Rhino Mocks and major contributor to Castle and NHibernate, over at the .NET Developer Network in Bristol. This has come at relatively short notice as Oren is only around for the next couple of weeks. The event takes place on Monday 13th October, more details can be found here.

The session details are as follows:

"Producing Production Quality Software" Abstract:

Working software is no longer the only thing that we need to produce. We need to create a software system that has a chance of surviving in the cruel world of production system, outside the clean room and sterile environment of development and QA. Understanding bottlenecks in the system, preventing cascading failures and recovery strategies have ceased being the problems of the very high end players. With the cost of system downtime being measures in $$$/second, this is an area we have to consider all the way. In this talk we will cover how we can map common weaknesses in the system design, preemptively protect ourselves from them, and produce software systems that can withstand the real world hostile environment.

"Interaction based testing with Rhino Mocks" Abstract:

Beyond the simplest scenarios, all objects had collaborators that they work with. This flies in the face of testing objects in isolation. This is the problem that mock objects were created to solve. In this talk you will learn what mock objects are, how to utilize them and best practices on when / how to utilize them. Rhino Mocks is a mock objects framework for .Net whose core goals are to let the developer rely on the compiler work well with refactoring tools.

Seriously, if you want to hear from a person whom many consider a legend in our industry and you can make it to Bristol on that day, this would be one not to miss!

Sunday, 21 September 2008

Remix '08 and Ready, Steady, Speak Success

I've spent Thursday and Friday at Remix '08 and I must say I had a great time, from the key note by Bill Buxton and Scott Guthrie to the excellent Swag Phrase events at the community stage during the intervals it was a excellent couple of days that were well worth attending.

Admittedly I had already learned a lot about some of the developer talks that were taking place by attending other community events I had attended over the year so I took the opportunity to go to a couple of the design flavoured talks by Bill Buxton and I must say it was well worth it, design certainly is not my strong point and anything I can do to try and improve my understanding of how it should be applied cannot be a bad thing, I managed to pick up of few key points about not trying to design the perfect product in one go and some cheeky little prototyping tricks such as using magnets to mimic working screen shots.

Certainly my highlight of the event was the Ready, Steady, Speak competition. It was my first opportunity to talk to about my chosen subject to a large number of people at a major UK event, I've done a couple of nuggets at NxtGenUG - Southampton from time to time but nothing on this kind of scale. My chosen topic was WatiN and arriving at Remix I was happy with the presentation I had put together. There were six competitors in total taking part in two heats on the Thursday with the top two going through to a final session on the Friday, topics from other competitors included ASP .NET MVC, OAuth, HSL (Hue/Saturation/Luminance), Rasta and using Silverlight to perform cross browser window communication.

In the first heats I was last on which gave me an opportunity to see all of the competition but also for the nerves to build up, and up and up :-). There were four panel judges who passed judgement on each of the presentations and gave some useful comments on how the presentations could be improved, after my first attempt I had a couple of comments about the colour of my hyperlinks and also the fact that I seemed to keep pacing forwards and then backwards which gave away how nervous I was. Thankfully I was voted through to the final and had an opportunity to improve the presentation over night.

The following day the final was at lunch time and I had to perform the same presentation again, I had changed the colour of my hyperlinks and was determined to make use of the entire stage as had been suggested by the judges from the previous heat, this surprisingly had the effect of taking my mind off of how nervous I was and I had a couple of comments from people who had said that my nerves didn't show through so that was could.

So all the presentations were over and it was up to the judges final decision, and they chose me...woo hoo cool! For all of my efforts I won an XBox 360 Elite with three games, nice!

John Mcloughlin and I did plenty of networking and made sure that we gave out as many NxtGen business cards as we could and also drummed up as much swag as possible, we also managed to secure a few sessions for the new year including the potential of a Microsoft Surface demo and talk after we had our own hands on experience of it.

All in all, I thought the Remix event was excellent and well worth attending (possibly slightly influenced by by winning a competition), special thanks goes out to Dave McMahon, Richard Costall and John Price (the NxtGenUG founders) for organising the Ready, Steady, Speak competition and allowing me to have this opportunity.

Wednesday, 10 September 2008

CSLA .NET at NxtGenUG Southampton

Tomorrow night, Thursday 11th September, we've got a great session lined up at NxtGenUG, Andrew Hallmark, Technical Architect from Maritz, is coming over to talk to us about the CSLA .NET framework and code generation tools.

If anyone managed to make to our session on Object Thinking by Alan Dean be sure not to miss this session, essentially Alan spoke about the theory behind Object Thinking and how we should be changing our approaches to developing object oriented. Well Rockford Lhotka, author of the CSLA, has based his "Expert Business Objects" framework upon some of those theories and in my opinion this is the closest you will get to an implementation of true Object Thinking. Even if you think you know CSLA already there may be a few tips and tricks and implementation ideas that you may find useful.

As usual there will be pizza and swag, so what are you waiting for sign up now and come along, see you there.

Monday, 8 September 2008

Ready, Steady, Speak at Remix 08

Next week, 18th and 19th September, sees the arrival of Remix 08 in Brighton and as seems to be the general trend at these big events of late, NxtGenUG are getting really involved and this time they'll be running another Ready, Steady, Speak competition similar to those seen at Tech Ed and the Microsoft 2008 UK Launch.

The general format is as follows:

Contestants will present a 5 min session on a subject of their choice relating to Web Development or Web Design.  They will present in front of the REMIX audience and in front of a panel of judges.  If there are more than a  certain number of contestants (TBD), there will be ‘heats’ earlier in the day with the winners of the heats in a ‘speak-off’ in the evening session.  The ‘speak-off’ will take place as stated in the evening of the first day of MIX and the first prize is an XBox 360 + Goodies!

Prerequisites:

Mandatory

· Speakers must NOT have previously presented ‘full sessions’ at DDD, TechEd, DevWeek, SDN, SQLBITS, VBUG Conference, NxtGenUG FEST or any similar such conferences.

· Speakers must create a new session of their own with new material which can be based on existing material but cannot be a simple copy of it.

· Speakers must limit their session to as close to 5 mins as possible( overrunning time will cause the speaker to be marked down.)

· Speakers must not have previously won Speaker Idol or “Ready Steady Speak” UK Launch – Sorry to James Coulter J!

· Speakers must state their desire to enter the competition by no later than COP Monday 15th September 2008.

Desirable

· Speakers should provide if at all possible their own laptop, but one can be provided if necessary.  The speaker should notify the organisers of any software prerequisites.

· Speakers should have spoken previously at a User Group meeting even if only for a 10 min mini-session or ‘nugget’.  This is NOT mandatory

To show my support and get a bit of exposure to a larger audience for speaking, I have offered to join in the fun and take part in the competition with a slightly re-worked version of my WatiN nugget that I performed in Southampton last month. So I'll be spending the next couple of weeks getting really nervous and trying to figure out the best presentation I can muster.

Remix 08 looks set to be a great event including at least one session from Scott Guthrie, I'll be there and it would be good to see some of you there too (if not only for the moral support!).

Friday, 22 August 2008

WatiN, Ajax and some Extension Methods

Whilst I've been working with WatiN over the past couple of months I have encountered a few issues especially that unfortunately WatiN was unable to solve straight out of the box, so I thought I would knock a post together that contains the extension methods I have managed to cobble together from various sources on the Internet and a little bit from my own head.

WaitUntilEnabled

I encountered this issue whilst working with the CascadingDropDown provided by the Ajax Control Toolkit, now WatiN does provide a function called WaitUntil which allows you to pass in the name of the attribute you want to examine and the value that you expect the attribute to become, unfortunately however, it seems the CascadingDropDown adds a "disabled" attribute with a value of "true" to the html page. The drop down list then becomes enabled when the disabled attribute no longer exists or is set to false. Therefore it was necessary to write an extension method that waited until the control no longer had a "disabled" property with a value of "true. The method is as follows:

        /// <summary>
///
Waits until the specified element is enabled within the web page.
/// </summary>
/// <param name="element">
The element.</param>
public static T WaitUntilEnabled<T>(this IElement element) where T : class
{
var timer = new SimpleTimer(IE.Settings.WaitForCompleteTimeOut);

do
{
var value = element.GetAttributeValue("disabled");

if (value != "True" &&
value != "true")
{
return element as T;
}
Thread.Sleep(200);
}
while (!timer.Elapsed);

throw new TimeoutException("Waited too long for " + element.Id + " to become enabled");
}



UPDATED 15/09/08: Whilst preparing for my Ready, Steady, Speak session at Remix I came across a small bug where the value retrieved for the disabled attribute was "True" instead of "true" as initially thought, I don't know what caused the difference to occur but I have added the additional check anyway.



The usage of this method is as follows:



        ie.SelectList(Find.ById("MyCascadingDropDown")).WaitUntilEnabled().Select("AValue");



IfExists



This is just an extension method I wrote to make it a little easier to work with elements that don't exist:



        /// <summary>
///
Checks whether the element exists, if so performs the specified action,
/// otherwise just returns the current element object.
/// </summary>
/// <typeparam name="T">
The type of element to check for existence.</typeparam>
/// <param name="element">
The element.</param>
/// <param name="action">
The action.</param>
/// <returns></returns>
public static T IfExists<T>(this Element element, Action<T> action) where T : class
{
if (element.Exists)
{
action(element as T);
}

return element as T;
}


This method can be used as follows:



        ie.TextField(Find.ById("MyTextField")).IfExists<TextField>(e => e.TypeText("AValue"));


 


WaitForAsyncPostBackToComplete



If you are working with controls within an update panel you will inevitably come across a situation where a value is changed via an async postback and whilst that postback is taking place WatiN will try and perform another action which results in an error.The solution to this problem was found after searching the Internet for a little while and I came across this post which explains the problem in a little more detail.



I have modified the original method slightly to make it an extension for the IE browser object, it is used to determine whether the current page is within an asynchronous postback, unfortunately in order to use this method the page you are testing needs to have a JavaScript method defined so if you don't have control over the website you could be a little stuck, here is the Javascript:




<script type="text/javascript">      
var
prm = Sys.WebForms.PageRequestManager.getInstance();
function IsPageInAsyncPostback()
{
return prm.get_isInAsyncPostBack();
}
</script>




The C# method implementation is as follows:



        /// <summary>
///
Waits for async post back to complete.
/// </summary>
/// <param name="ie">
The ie instance to use.
</param>
public static void WaitForAsyncPostBackToComplete(this IE ie)
{
bool isInPostback = true;
while (isInPostback)
{
isInPostback = Convert.ToBoolean(ie.Eval("IsPageInAsyncPostback();"));
if (isInPostback)
{
Thread.Sleep(200);
//sleep for 200ms and query again
}
}
}


After a kind comment from Jo (see below), I have modified this as there is no need to place the IsPageInAsyncPostback method inside of the page, I just needed to modify the Eval method to make the entire call, as follows:



        /// <summary>
///
Waits for async post back to complete.
/// </summary>
/// <param name="ie">
The ie instance to use.</param>
public static void WaitForAsyncPostBackToComplete(this IBrowser ie)
{
switch (ie.BrowserType)
{
case BrowserType.InternetExplorer:
{
bool isInPostback = true;
while (isInPostback)
{
isInPostback = Convert.ToBoolean(ie.Eval("Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();"));
if (isInPostback)
{
Thread.Sleep(200); //sleep for 200ms and query again
}
}
break;
}
}
}



And can be used like this:



            SelectList list = ie.SelectList(Find.ById("MySelectList"));
list.Option("TestOption").Select();

ie.WaitForAsyncPostBackToComplete();

SelectList childList = ie.SelectList(Find.ById("MyChildSelectList"));
list.Option("TestChildOption").Select();



ByPartialId



The final useful method is ByPartialId, this is merely a wrapper around a regular expression but it does save quite a bit of typing and needing to remember the regular expression syntax. I found this on Ayende Rahien's blog:



        /// <summary>
///
Gets an attribute constraint using a partial id.
/// </summary>
/// <param name="partialElementId">
The partial element id.</param>
/// <returns></returns>
public static AttributeConstraint ByPartialId(string partialElementId)
{
return Find.ById(new Regex(".*" + partialElementId + "$"));
}


 

Foundations Of Programming - eBook Review

I was recently catching up on some articles from the Code Better RSS feed and came across this Foundations of Programming eBook, which is essentially a composition of a number of Karl Seguin's posts on the code better site all neatly presented in an eBook, best of all it's free. I had missed many of Karl's original posts so I decided to download it, take a look and give it a quick review if anyone is interested.

Chapter 1: ALT .NET - this chapter gives quite a nice overview of what ALT .NET is all about, why it exists and where it fits within the community. It also contains some explanations for all of those little acronyms and terms that you hear bouncing around all over place, items such as YAGNI (You Aren't Going to Need It!) and DRY (Don't Repeat Yourself), Coupling, Last Responsible Moment.

Chapter 2: Domain Driven Design - a brief introduction into what DDD is and how it differs from Data-Centric design. Karl uses very simple code samples to get his point across but these do the job well and the tips and tricks section is well worth a read to refresh your knowledge on typical patterns and practices you should be following when developing software applications.

Chapter 3 - Persistence - it seems that the concept of persistence and persistence ignorance is a bit of a buzz word at the moment, what with various discussions about Entity Framework vs NHibernate etc (just Google these terms and you'll come up with some discussion or another). In this chapter Karl neatly summarises the main issue in-hand i.e. the Object-Relational Impedance Mismatch and continues to discuss the use of Data Mappers and, with the use of some example code, highlights the drawbacks of using manual mapping (hand writing the code to perform the mapping of relational to object data), which had I not been convinced of already, this chapter would have pushed me to look for alternatives. I think the title of this chapter is a little misleading as it does mainly focus on manual data mapping and I was expecting the chapter to go into more details about other persistence mechanisms available, I'll keep reading and see where it takes me.

Chapter 4 - Dependency Injection - this section discusses the balance between decoupling and coupling of items within an application, introduces the concept of unit testing which requires at least some form of decoupling and details how the Dependency Injection pattern can be used. The chapter  also focuses on the StructureMap dependency injection tool written by fellow CodeBetter blogger Jeremy Miller, there are plenty of other DI frameworks out there such as Castle Windsor, Unity, ObjectBuilder each has their own pro's and con's so I leave it to you to make a decision on which might be the most preferable for your situation.

Chapter 5 - Unit Testing - the previous chapter briefly introduced unit testing as a way of introducing the need for decoupling within a system, this section delves a little more into unit testing and why should we use it, I especially liked the section on "Why Wasn't I Unit Testing 3 Years Ago?" which rang very true to me. Karl then goes on to discuss unit testing and the tools you need to do it, these include NUnit, TestDriven .NET and RhinoMocks and he details simple some code examples to give the reader and idea of the kind of things you can do with them.

One point worthy of note is that Karl mentions that UI testing "is complicated and suffers from very tight coupling" which is true, but I would definitely recommend looking into integrating WatiN into your continuous integration build process, the tests are not be as fast as unit tests so you may want to use them in a separate build process but I believe that can be equally invaluable to ensure the UI meets the needs of the user.

Also, when it comes to testing of the database, I have recently found some success in using a LINQ to SQL data context which exposes the stored procedures within the database can be extremely useful for testing individual stored procedures and ensuring they perform as expected (may be I'll do a blog about that some day).

Chapter 6 - Object Relational Mappers - starting head on with details about the Stored Procedures vs Inline SQL debate, Karl explains some of the key points involved in this discussion and argues the reasons for inline SQL over stored procs which leads on to the use of an object relational mapping tool. I for one agree with Karl's arguments and believe that the use of an O/R Mapper should be a developers first port of call and then stream line to use stored procs when bottle necks appear. The chapter then moves on and describes how to configure and use NHibernate for your O/R Mappings, recently I have had a lot of experience of LINQ to SQL and I find this to be pretty useful even though it probably lacks a level of abstraction that tools such as NHibernate would provide, it certainly does the job if your just focusing of SQL Server databases in a smallish application.

Chapter 7 - Back to Basics: Memory - I personally believe every developer should read this section even if its just to recap your knowledge on these items, it's always good to keep an idea of what the memory usage of your application in your mind even when in a managed environment. Karl covers all of the areas you would expect to see such as Boxing, ByRef, Managed Memory Leaks, Fragmentation and Pinning and the use of IDisposable. The chapter is relatively brief considering the subject matter but it is easy to read and digest, compared to CLR via C# (I book I would thoroughly recommend you get if you haven't got it already) Karl's is a lot more lightweight but serves the purpose of getting developers thinking about the things that matter.

Chapter 8 - Back to Basics: Exceptions - the suggested exception handling is simply two rules 1) Only handle exceptions that you can actually do something about, and 2) You can't do anything about the vast majority of exceptions and Karl goes on to state that "Most new developers do the exact opposite of the first rule, and fight hopelessly against the second. I believe he is right, exception handling can actually be quite an overwhelming concept and developers can easily be too defensive when dealing with them. Karl continues to highlight what to do when handling exceptions that you can do something with also asserts that exception swallowing is bad. The chapter continues to detail how to throw exceptions and the subtle differences this can have on the stack trace, when to throw exceptions i.e. in exceptional circumstances or when expected behaviour cannot be executed. Finally, the chapter rounds up with a section on custom exceptions.

Chapter 9 - Back to Basics: Proxy This and Proxy That - the chapter looks inheritance and polymorphism in terms of the Proxy Domain Pattern and how this is used within NHibernate to handle lazy loading of objects. There is an interesting side note about NHibernate which is that it is considered to be a frictionless or transparent O/R Mapper because it doesn't require modification of any of your domain classes, although if you require lazy loading then you must mark all of your methods as virtual but you still don't have to add NHibernate specific constructs to your classes. The chapter then turns into a discussion about the lazy loading capabilities of NHibernate and how the proxy pattern is used to achieve this. The intention of the chapter was to make the reader think about what methods should and shouldn't be virtual, I am not sure whether this was achieved but it certainly got me thinking a little bit more about looking into NHibernate.

Chapter 10 - Wrapping It Up - this final chapter simply summarises the contents of the eBook and Karl gives what I consider to be a good list of core principles to good software engineering, I have summarised these as follows (see the eBook for more detail):

  • The most flexible solution is the simplest (YAGNI, DRY, KISS and explicitness)
  • Coupling is unavoidable, but must be minimised
  • You are responsible for the code you write, test your code because this helps you identify bad coupling, find awkwardness in your API, document behaviour and expectations, and lets you make small and radical changes with far greater confidence and far less risk
  • It's more fun developing projects using agile and iterative development
  • Always look for alternatives and learn all of the time

I must say I really enjoyed reading this eBook, so much so that it inspired me to write this review of it. At only 79 pages it is manageable and IMO makes some absolutely valid points about how to "Code Better", reading this eBook will be a great learning aid for those wanting to progress their programming knowledge and a stark reminder for those with a greater knowledge that it is always worth reminding yourself of your coding principles, practices and understanding of the underlying framework that you work with everyday.

The eBook has opened my eyes to the way of the ALT .NETer and I am now far more interested in learning about NHibernate and how it could make my life as a programmer a better place to be. Some might say that the focus on NHibernate should not be considered as a "Foundation of Programming" but the principles that lie behind the development of NHibernate certainly should be. All in all I would definitely recommend reading this eBook when you have a spare  5 minutes.

WatiN Nugget at NxtGen Southampton

So last night I managed to get through my nugget on WatiN relatively unscathed, the demo overran which I was a little disappointed about but I hope everybody took something from it.

I was in a small dilemma prior to performing the nugget as I wanted to talk about how great WatiN is and demonstrate what you can do with it but in the back of my mind I knew that it is very easy for you WatiN tests to become large in number and unmaintainable, so I wanted to talk about the controller framework I have been developing to give people an idea of the kind of things you can do to make sure your tests do not get out of hand.

I shall be performing this nugget again at the Cambridge NxtGenUG, its titled Not Wifeswap, Coordinator Swap, the title doesn't really tell you what its about but basically John and I are going to perform the session we did last night up at the Microsoft Research Centre where the Cambridge boys are based.

So the main lessons learned from last nights session were I think that 15 minutes isn't long enough (by a long way) to talk about best practices of writing WatiN tests, so I shall just focus on what WatiN can do, may be show a few more of the functions for working Ajax based web sites and then just point people to my blog for more information about the framework etc. If anyone reading my blog attended the event last night, I'd be really interested in your feedback.

Wednesday, 20 August 2008

WatiN Controller Framework - Part I

A little while back I blogged about setting up and using WatiN and detailed how to create a simple unit test and also use the WatiN Test Recorder to create a simple test run. I also mentioned that I was working on a controller framework to aid in the development of automated web application tests and make it a bit easier to knock up tests for new web applications. This post is the first in a series ( I am not sure how long the series will be yet but I'll let you know when I know) of posts that will explain the framework together with reasons why I have chosen to do things in a particular way.

I originally started working on my controller framework a couple of months ago and I was about a week or two into development when I came across this WATiN/R Testing Design Pattern article, which discusses the importance of separating the logic for controlling the page from the tests themselves ensuring that you have maximum re-usability of your page controlling logic. This was also one of the driving forces behind my framework but rather than using static classes and I wanted a more fluent interface that allowed my domain specific controllers to easily flow from one controller to the next making my tests even easier to read, something like this:

        [TestMethod]
public void ChangeEmployeeDetails()
{
Northwind
.GoToEmployees()
.ViewDetails("Davolio,Nancy")
.ChangeDetails(new EmployeeDetails()
{
FirstName = "Test",
LastName = "Employee",
ReportsTo = "Steven Buchanan"
});
}



The application I was working on was a very large web site that contained a lot of wizard logic and when we were adding new functionality to the wizards we seemed to be spending a great deal of time entering dummy data just to get to the point in the wizard that we really wanted to test. For example, a typical wizard would be (each step containing its own validation logic meaning that specific data must be entered):




  1. Enter Member Details i.e. first name last name, date of birth, contact phone number etc


  2. Enter Address Details


  3. Enter Marketing Information


  4. Enter Package Details


  5. Enter Payment Details


  6. Show Package Summary


  7. Finish the wizard



Frequently throughout development of the application we were required to make modifications to these wizards with new user requirements etc, so in order to modify something on step 5 Enter Payment Details, and for us to test the UI functionality it would be necessary enter all of the details for steps 1 to 4 time and time again which soon became very repetitive, tiresome and boring. Also, our application is multi-lingual so there was a requirement to be able to automate the site using different language and regional settings.



So with this in mind I set about creating a framework of controllers that allowed me to concentrate on adding the functionality for automating parts of the web site without repeating a bunch of unit test code. The base controllers are quite simple, here is a class diagram showing the relationships:



image



As can be seen in the image above, there are three page controllers:




  •  HomePageController<T> - this serves as the main entry point into the web site and should represent the first page that a user would be directed to when they arrive at the web site, there should only ever be one home page controller per web site. The HomePageController<T> is the only controller that maintains an instance of the WatiN.Core.IE object, any call made to the Browser property of the HomePageController<T> will either a) use an existing IE instance, b) search for an existing IE instance that matches a pre-defined base URL or c) create a new instance of IE and navigate to the pre-defined home page.


  • PageController<T> - any other page within the web site should be represented by controller that inherits from the PageController<T> class unless the page contains a wizard in which case the WizardPageController<T> should be used. The PageController<T> base class provides some simple methods that enable easier use of a fluent interface


  • WizardPageController<T> - any page that contains a wizard should inherit from this controller as this base class provides functionality that enables easy manipulation of the wizard on the page from within the unit tests.



As mentioned in my previous post setting up and using WatiN, I shall be using the Northwind ASP .NET Sample web site with Ajax to demonstrate how you would create a simple controller framework, the following image is a snap shot of the Northwind home page:



image



And this image shows some of the controllers I have created for the Northwind web site:



image



As you can see, the NorthwindController inherits from the HomePageController<T> class serving as the entry point into the web site, when the controller is defined a custom attribute is used to define what the base URL for the web site is and also what the name of the home page is:



[Url("http://localhost/Northwind", "Default.aspx")]
public class NorthwindController : HomePageController<NorthwindController> {}



The NorthwindController contains properties that are controllers for other parts of the web site such as the Employees page, Supplier page etc, I have also added a SampleWizard page to the site to demonstrate the use of a wizard page controller. Each property simply returns a new instance of the required controller type on each get request and looks something like this:



public EmployeeController EmployeeController
{
get { return new EmployeeController(this, this); }
}


The NorthwindController also exposes methods with the following name signature PageController<T> GoTo<PageName>(). Each of these methods implement the WatiN logic necessary to navigate to the relevant page within the web site and then returns the page controller that represents that page, this allows the fluent interface to be used from within the unit tests, a typical method might look like this:



        public EmployeeController GoToEmployees()
{
Browser.Link(Find.ByText("Employees")).Click();
return EmployeeController;
}


So the GoTo method simply uses the page controllers Browser instance (WatiN) to find a hyper link with the text value of "Employees" (this could equally look for a hyperlink with an ID) and then clicks the link, after clicking the link the EmployeeController is returned allowing the test writer to immediately take control of the page that is being navigated to. If the link doesn't go to a page that can be controlled by the EmployeeController then the test will fail and the developer will know that something has been changed incorrectly.



The subsequent page controllers also expose GoTo methods when the page they represent contain links to other parts of the web site and they will generally also methods that expose the functionality available on that page. I think the easiest way to demonstrate this is show you an image of the Northwind Employees.aspx page:



image



Looking at this page you can see a couple of functions that would need to be exposed by the EmployeeController, these would include InsertNewEmployee, ViewEmployeeDetails and EditEmployeeDetails, in this example we shall focus on the ViewEmployeeDetails method. So in order to view the details of an employee we need to know what the name of the employee is, so this defines the parameter that will be required on our method and we must also find the "Details" link that is in the table row that contains the name of the employee. The resultant method call looks something like this:



        public EmployeeDetailsController ViewEmployeeDetails(string employeeName)
{
((TableCell) Browser.Span(Find.ByText(employeeName)).Parent).ParentTableRow.Link(Find.ByText("Details")).Click();
return EmployeeDetailsController;
}


The method uses the page controller's Browser (via WatiN) to find a span via it's text value containing the name of the required employee. We then need to get the span's parent (a table cell) and obtain the table cell's parent row, using this row we then look for the hyperlink that contains the text "Details" and click it. After clicking the details link the page will be redirected to the Employee Details page and therefore returns the EmployeeDetailsController which then exposes the functionality available on this page. The Employee Details page looks like this:



image



Therefore, the EmployeeDetailsController exposes a method called ChangeDetails which takes a EmployeeDetails class as a parameter. This class simply serves the purpose of holding all of the information that could be changed for any given employee. The ChangeDetails method looks something like this:



        public EmployeeController ChangeDetails(EmployeeDetails details)
{
Browser.TextField(ByPartialId("txtFirstname")).IfExists<TextField>(tf => tf.TypeText(details.FirstName));
Browser.TextField(ByPartialId("txtLastname")).IfExists<TextField>(tf => tf.TypeText(details.LastName));
Browser.SelectList(ByPartialId("ddReportsTo")).IfExists<SelectList>(tf => tf.Select(details.ReportsTo));
Browser.Button(ByPartialId("btEdit")).Click();
//...further fields removed for brevity
return GoToEmployees();
}


As can be seen, this method takes the EmployeeDetails class, using the page controller's Browser (via WatiN) finds the relevant controls on the page and uses the values contained within the EmployeeDetails class to enter the details. Finally, the save button is clicked and the user is returned to the Employees page. The IfExists<T> method is an extension method that I have added that enables testing whether a WatiN element exists prior to performing a relevant action, this is not part of the WatiN install, I shall cover some of the extension methods and helpers that I have needed in a later post.



Conclusion



In this post I have given you a simple introduction to the WatiN controller framework and how you would use it within your WatiN test development. I shall be creating some more posts about various things, including controlling wizards with the WizardPageController and WatiN Extension Methods and Helpers, I encountered during development of the controller framework so stay tuned.



The source code for this is not currently on CodePlex or SourceForge but if people are interested in learning more and seeing the source code just leave a comment and if there is enough interest I shall post the code to one of these sites or just throw up a zip file. Oh and by the way if anyone can think of a better name for this I would appreciate it, there is currently WatiN, Wax, WatiN Fixture, Watin Controller Framework doesn't quite fit and I think the acronym WCF has already been taken? :-).

Thursday, 14 August 2008

Setting up and using WatiN

I am going to be doing a 10 minute nugget about WatiN at NxtGenUG Southampton on Thursday 21st August, so as I was preparing for it, I thought I would put together a little post about the relevant details.

So to get started with WatiN you need some basic tools:

  • WatiN Framework - this can be downloaded from here, at the time of writing the current RTM version is 1.2.1 but version 2.0 is available as a CTP, I shall be focusing on version 1.2.1 for my nugget. Simply download the MSI/zip of your choice, I have chosen the WatiN-1.2.1.4000-net-2.0.msi.
  • WatiN Test Recorder - this is really useful for getting you started with writing WatiN tests, it can be downloaded from here. This is currently at version 1.0.1b and as far as I know there is only a single download.
  • IE Developer Toolbar - WatiN 1.2.1 only supports IE, but 2.0 has support for FireFox. This is an essential tool for any kind of web development let alone for use when developing WatiN tests, it lets you inspect the html elements of a web page by simply pointing and clicking at the element you want to inspect. This can be downloaded from here.

These are the basic tools you will need but to make some real use of WatiN you will want to combine it with your favourite unit test framework, I've chosen MS Test simply because its the test tool of choice at my current place of work but WatiN will work with other tools such as NUnit etc.

Writing Your First WatiN Test

Once you've installed the above tools its time to start writing your first WatiN test, because my demonstration is going to be in a hall with no access to the Internet I need to use a locally hosted web site so I thought I would download a Northwind ASP .NET Sample web site with Ajax, now this is certainly not the prettiest web site or even the most functional but hey, it serves the purpose :-). Once you've downloaded the zip file, simply extract it to a location of your choice and setup an IIS application, remembering to change the connection string in the web.config to point to your version of the Northwind database.

Using VS2008 create a new test project called Northwind.Watin.Tests, delete theimage AuthoringTests.txt and rename the UnitTest1.cs file to something like NorthwindTests.cs.

Next we need to add a reference to our installed WatiN.Core assembly, the installer places the file in C:\Program Files\WatiN\1.2.1-net-2.0\bin folder but you can move it elsewhere if you desire.

We shall create a test method called GoToNorthwind that will simply perform the job of creating a Internet Explorer instance, entering the url of our Northwind application in the address bar and navigating to our Northwind web site. Ensure that you have added the

using WatiN.Core;



at the top of the page and the create a test method that looks something like this:



        [TestMethod]
public void GoToNorthwind()
{
using(var ie = new IE())
{
ie.GoTo("http://localhost/Northwind/default.aspx");
Assert.IsTrue(ie.ContainsText("Northwind"));
}
}



So quite simply this test creates a new instance of IE, which is essentially an automation wrapper around Internet explorer, enters the url specified and in the address bar and then asserts that the IE instance contains the text "Northwind", obviously we could have done a bit more of test here but you get the picture.





Using WatiN Test Recorder to Create a Test



This time we'll use the WatiN Test Recorder to create the same test, launch an instance of the recorder, it should look something like the following, next in the "Test Name" text box type the name of the test "GoToNorthwind" and click the Record button, this will start recording the test.



image



Type the url into the address bar http://localhost/Northwind/default.aspx and watch the good things happen, you will notice that the main pane of the application navigates to the desired url whilst the text box under the test name shows the WatiN test script required to achieve this functionality.



image



Simple eh? In my experience I have found that this tool is really good for the development of tests during the early stages of developing tests but as you get more used to the syntax of key words of WatiN your dependency on this tool becomes less and less, I would thoroughly recommend exploring this tool further to get a better understanding of the kinds of things that WatiN can do, however you will soon start to realise that the tests you are creating using this tool are not very reusable or maintainable.



At this point you need to start looking at a way to make your tests reusable and easily maintainable, I'll be giving you one way to do this in my next post in this series.

Wednesday, 13 August 2008

Pigs and Chickens

So you are in an emerging agile team fighting against the ingrained waterfall style development that has existed for years, you are still in the early stages of getting everything working and feeling right, suddenly people are being referred to Pigs and Chickens but has anyone actually explained to you why? Well, it all comes from a story that Ken Schwaber started in the early days of Scrum, it goes something like this:

A chicken and a pig are brainstorming...

Chicken: Let's start a restaurant!

Pig: What would we call it?

Chicken: Ham n' Eggs!

Pig: No thanks. I'd be committed, but you'd only be involved!

"The real issue for a Scrum is who is committed to the project and accountable for deliverables. The committed get to talk at the daily Scrum meeting. They are the pigs and their butts are on the line. We could call them contributors if we don't like pig terminology. " - Jeff Sutherland

"People who are not committed to the project and are not accountable for deliverables at the meeting do not get to talk. They are excess overhead for the meeting. They might be called eavesdroppers if you don't like chickens. Whatever we call them it should have a negative connotation because they tend to sap productivity. They are really suckers or parasites that live off the work of others. Sorry to be political incorrect but others should come up with a euphemism that conveys the right balance between being "nice" and communicating clearly that eavesdroppers must minimize their impact on the productivity of the team. " - Jeff Sutherland

Read more on this in the following article by Jeff Sutherland which explains things in a little more detail: scrum pigs and chickens, also J.D. Meier has an interesting idea on how to turn chickens into pigs.

Monday, 21 July 2008

Silverlight 2.0 Assault Course is nearly here

Saturday 26th July sees the arrival of the South Coasts greatest Silverlight training course where attendees get a whole day of access to presentations by speakers such as Richard Costall, Chris Hay and Mike Bonner as well a whole bunch of hands on labs where you get to play around with the technologies in the presence of the people that know and are on hand to ask all the questions you could ever think of.

Of course the day will include the usual pizza and swag as you have come to expect from all of your NxtGen events. There are only a few places left so if you fancy topping up your technology quota and learning all about the fantastic business applications and opportunities that Silverlight 2.0 will bring to the world wide web sign up now. The event is taking place at the Immediacy premises in Poole, Dorset.

Friday, 18 July 2008

It MOSS'd have been good, but it's over now!

Last night saw another great session at NxtGen Southampton with Dave McMahon co-founder of NxtGen kindly making his way down to the sunny south coast all the way from Birmingham.

The session kicked off with a nugget on ELMAH by James Driscoll one of our region members. This looked really interesting and definitely requires further investigation, ELMAH stands for Error Logging Modules and Handlers and it is essentially a completely pluggable error logging framework that can be added to any asp .net web application with the need to re-compile or re-deploy, just change a few configuration settings and you are off. This is something I would certainly consider for my next asp .net application or as James so rightly said last night "even if you inherit a dodgy application that doesn't really have any error logging functionality built in, just plugin in ELMAH and the basics are covered". A more in depth article on ELMAH can be found at Using HTTP Modules and Handlers to Create Pluggable ASP.NET Components which was written by Scott Mitchell of 4GuysFromRolla.

Dave then stepped up to the plate and delivered what I felt was a very truthful and interesting talk on his experiences with Microsoft Office SharePoint Server (MOSS). Dave clarified the differences between a Site and a Site Collection and tried to bring some sense or understanding to some of the terms and phrases used by Microsoft in SharePoint, namely the term "GhostableInLibrary" which I am still not sure I truly understand what this does :-).

Working his magic with various batch files Dave then gave us a variety of hints and tips on how to deploy a SharePoint installation to over 2000 web sites using STSADM.

He gave a brief overview of the disparate set of tools that are used to develop a SharePoint site including, but not limited to, Visual Studio and SharePoint Designer and pointed us in the direction of a few helper tools including an addin for Visual Studio the name of which escapes me but I shall update this post when I get hold of some links to Dave's resources. He then should us how to create a SharePoint Feature/Solution together with a recommended workflow using the variety of tools necessary to develop and deploy the new feature to sites.

As usual, the night also included plenty of pizza and a host of swag items given away including a set of Telerik web controls, a JetBrains Resharper License, some a Programming Linq book, some Microsoft socks and plenty of other goodies. Once again another great session, many thanks to Dave and James.

Wednesday, 18 June 2008

Silverlight Assault Course Announced

It's official the NxtGenUG Southampton Silverlight Assault Course date has been announced, find out more here. It's all going to be taking place on Saturday 26th July 2008 at the Immediacy premises in Poole, Dorset.

If you are interested in learning all about Silverlight 2.0 then this is the day for you, it will be packed full of short presentation sessions and plenty of hands on labs with some experts such as Richard Costall, Chris Hay and Mike Bonner all kicking about to lend a hand where necessary.

This event is going to be full of great content and off course there will be loads of pizza and swag to boot, so for a mere £40 this is an absolute steal, sign up now and don't miss out as spaces are limited.

Monday, 9 June 2008

Changing a Class Library Project to a Test Project

I was moving some unit tests between assemblies today so that we could isolate some smoke tests from the more scenario type watin tests and for some reason MS Test wasn't picking up the tests contained within my new assembly.

It then dawned on me I hadn't created a Test Project using  the File | New | Project wizard, I had created a Class Library instead. So I simply needed to change the project type of the new assembly, I searched high an low for a way to do this in VS2008 with no luck, if anyone can point me in the direction of doing this via the IDE I would be grateful.

image

Anyway, I changed the project type the old fashioned way by editing the XML, select the Edit Project File option from the context menu on an existing Test Project, in the XML look for something that looks like this :

<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>



Copy this, then go to your Class Library project select the Edit Project File option on the context menu and insert the project type guid xml section. Next just reload the projects back into VS2008 and you will have all of the unit tests from the Class Library assembly available to run.

Wednesday, 14 May 2008

MS Test Re-Enabling Ignored Tests

In our current development environment we use MS Test for our unit testing and one thing that has been bugging me for a while is that if you remove the Ignore attribute from a test method, recompile and then try and run the test nothing happens and but you get a message in the status bar saying "No tests were run because no tests are loaded or the selected tests are disabled".

So I didn't really understand what that meant and usually ended closing Visual Studio, re-opening it and seeing if that fixed the problem, it didn't so I finally googled it and came across this MSDN article, in which it nicely explains that after adding the IgnoreAttribute to the unit test "The test is disabled. In the Properties window, the Test Enabled property is automatically set to False."

Now what should happen is when you remove the IgnoreAttribute the Test Enabled property is automatically set to True. However this does not seem to the case so after removing the IgnoreAttribute you need to either:

1. Open the Test View, select the ignored test, press F4 to display the properties window and set the Test Enabled property to True.

image

Or

2. Open the Test List Editor, selected the ignored test, right click and select "Enable" from the context menu.

image

I hope this helps anyone with future MS Test issues.

Tuesday, 22 April 2008

Automatic Properties and Structs

I was merrily creating my first struct since the advent of automatic properties and figured it would be nice and easy, so continued and created the following:

public struct UserNamePasswordPair
{
public string UserName { get; set; }
public string Password { get; set; }

public UserNamePasswordPair(string userName, string password)
{
UserName = userName;
Password = password;
}
}



To my disappointment I got a compiler error:



"The 'this' object cannot be used before all of its fields are assigned to"



This was very disappointing and I thought surely Microsoft wouldn't have forgotten to allow automatic properties on structs and it turns out they haven't, looking further down the error list I see a useful message:



"Backing field for automatically implemented property 'UserNamePasswordPair.UserName' must be fully assigned before control is returned to the caller. Consider calling the default constructor from a constructor initializer."



Ah ha, fair enough, so I simply added the call to the default constructor and bobs you uncle it compiled, yeh!



public struct UserNamePasswordPair
{
public string UserName { get; set; }
public string Password { get; set; }

public UserNamePasswordPair(string userName, string password)
: this()
{
UserName = userName;
Password = password;
}
}

Silverlight Assault Course - Bournemouth

Us guys at NxtGenUG - Southampton have been putting our heads together to create a complete day of Silverlight, we figured the best way to learn all this new technology is to get your hands on it and play with it whilst in the presence of people that know and can help answer your questions.  The great thing for me is that this event will be based in Bournemouth which is my home town!

Keep your eye on the NxtGenUG event list for more details on the final date of this. We are thinking that the day will consist of a bunch of hands on labs that give you some typical walk through scenarios allowing you to understand how things happen in Silverlight. There will also be key speakers that will deliver talks on the different aspects of Silverlight and how they fit within the current development world.

This is still in the planning stages but we are looking to get this all together within the next couple of months, I was just wondering whether anybody has some suggestions on the kind of content you would like in an event like this, please feel free to add comments with your suggestions.

Cheers

DDD7 - Date Released

I've now been given the nod that the date for DDD7 has been officially released, it is going to be Saturday 22nd November 2008 although the website hasn't been updated yet.

Saturday, 19 April 2008

Cool desktop switcher application

After the recent arrival of my new son Jacob, the inevitable huge amount of photos have been taken and my library has started to grow and grow. Now, it has always bugged me that the Windows desktop background image is static and you have to manually change it to something different when you 'feel the need', well this is no longer the case.

A friend pointed me in the direction of this handy little piece of software called John's Background Switcher by a guy called John Conners. It's got functionality to hook up to all sorts of online photo albums such as Flickr, Picasa, Phanfare etc and its really easy to use. Just point it at the albums you want to include, choose the type of background image you want (I really like the snap shot which creates a bunch of random polaroid looking images).

image

The following images I stole from John's site, which I am sure he won't mind because I am promoting his application, but they give you a good example of what the application does.

Make your wallpaper interesting!With John’s Background Switcher!

Anyone enjoy!

Friday, 18 April 2008

Now that was Entity-tainment

Last night saw another cracking NxtGenUG - Southampton user group session with a grand total of 36 attendees, the support we are receiving for the group is phenomenal and its going from strength to strength.

This was our first session after the arrival of British summer time and highlighted a small flaw in our venue which has glass walls on both sides which had the effect of bleaching out the early part of the session, but as the sun went down life was good again. If anyone knows where I can get hold of a large black cloth to drape over the windows I would be most grateful.

Neil Robbins, NxtGenUG Southampton member, kicked off the evening with a quick 10 minute walk through IIS 7.0 and permission controls, something useful to know about to let your local IT pro hand over permission to you as a developer when managing the IIS server remotely.

Mike Taulty then did a brilliant presentation, as we have come to expect from him, on ADO .NET Entity Framework. I always enjoy talks by Mike, he seems to have a way about him that keeps your interest all the way through the talk and continually provides the right level of technical content and humour ensuring an enjoyable session. For anyone that wants to check out the resources Mike mentioned in his talk have a look here.

I am personally really interested in the Entity Framework and I think it is going to have a big place in the development world in the future, I can't wait for future releases and to finally get my hands on the real thing.

Mid-way through the session we broke for the usual pizza and a quick chat. It was nice to see some new faces. 

Finally, the obligatory swag was distributed to the attendees, with swag ranging from a Tech Net baseball cap, Microsoft socks, a funky travel adapter, a really cool MSDN tool kit (it's a mini screw driver set that I personally think is really, really useful), the kind guys at JetBrains gave us another Resharper license to handout and last but by absolutely no means least a bunch of Visual Studio 2008 Standard Editions packs that were left over from our Install Fest Launch event last month, finally a whole bunch of T-Shirts were thrown out to the screaming masses.

All in all I think it was another successful event, many thanks to both Neil and Mike for the technical content and thanks to all the attendees for helping make Southampton the fastest growing NxtGenUG region!

P.S. If you did attend the event any feedback you have would be greatly appreciated, please go here to fill out your comments.

Thursday, 17 April 2008

Running WatiN with Cruise Control .Net

I've been doing a bit more work with WatiN lately to get some decent automated test coverage for our web application and everything was running all fine and dandy on my local machine (famous last words) but when the time came to move the tests into our continuous integration build environment I came across a bit of a problem, our cruise control runs as a service but WatiN launches IE, mmm a bit of a problem I think. Kicking off a cruise control build simply resulted in the build hanging for an extraordinary amount of time when the build previously took approximately 15 minutes.

So I did a bit of digging on the web and quickly came across a couple of people having similar issues, the first suggesting to simply set the "Allow interaction with the desktop" flag on the service, so I did this and tried again.

image

I restarted the service and kicked off another build and low and behold the tests started working, nice one.

Cheers

Wednesday, 16 April 2008

That's Entity-tainment

Mike Taulty, has decided he needs a bit of sea air, and so is heading for the South Coast to mix it up with us guys at NxtGenUG Southampton. It looks like Mike and Daniel Moth are trying to collect the full set of NxtGenUG regions! Mike will be talking about the new Microsoft Entity Framework.

Here's the blurb:

"ADO.NET Version 3.0 raises the level of abstraction at which we deal with relational data in applications by adding a new managed provider which uses a conceptual model which it maps to the actual tables and views of your database schema. This has the advantage of providing the Entity Relationship model that application developers want to code against whilst isolating the application code from the specific language (e.g. T-SQL, PL/SQL) and engine (e.g. SQL Server, Oracle) of the store. In this session we’ll take a good look at the Entity Framework from its mapping layer through to its EntitySQL language and on to its Object Relational Mapping capabilities and LINQ."

We will also have NxtGenUG member and MS Launch Event Ready Steady Speak! 'Hero' Neil Robbins delivers his second nugget this time on IIS 7.0.

So don't forget to sign up to avoid disappointment, get your hands on some decent swag and have some pizza while you are at it!

Cheers

Monday, 14 April 2008

Power Commands for Visual Studio

For those of you who don't have the budget for some of the more luxurious refactoring tools such as CodeRush or Resharper the kind fellows on the Visual Studio Extensibility team have released some new power commands.

I've not had a chance to look at these in depth but there are some basic commands that you would expect to be in VS2008 by default such clear all panes, format a document on save, copy path and email code snippet. Check them out here.

Monday, 7 April 2008

Successful delivery of some "New Born Baby Technology"

So I've reinstalled windows multiple times, I've programmed loads of software applications, written hundreds of lines of code but I am now facing my toughest technological challenge yet: a new born baby.

For those of you that don't know as of 26th March 2008 at 23:02 I became the proud owner of "Jacob Richard Allen" a wonderful bouncing baby boy and I have got to say I am pretty chuffed.Jacob 4 days 018 Now I must admit the delivery was 4 days late and definitely over budget but hey it's worth it when the result is something this cute.

I've completed the necessary preparation and home installation steps and also ensured that I have sufficient essential transportation accessories such as car seat and travel system.

So all that remains is for me to:

  1. Understand the baby's power supply mechanism (with the help of mum in that department)
  2. Get to grips with programming sleep mode - my model seems to have some minor bugs in this area at the moment so hopefully a new firmware update might fix that
  3. Monitor sensory applications such as visual sensors, auditory sensors and propulsion apparatus
  4. Track the baby's waste function - I must admit I never thought I would be so interested in the colour of a bowel function
  5. Read the rest of the manual to get a better understanding of how on earth I am going to cope in the coming years :-).

I can't wait for the challenges that lie ahead and hopefully I will have fun learning new things about my new baby. For anyone that is interested, the baby owner's manual is pretty good, it is done with a bit of tongue in cheek but has some useful information about how to deal with a baby in "bloke" speak, nice and simple and straight to the point.

Cheers

Thursday, 20 March 2008

2008 IT Pro Community Launch Event

Tuesday 8th and Wednesday 9th of April sees the 3rd combined IT Pro User Group events in Reading at the Microsoft offices in Thames Valley Park. The event will involve all of the UK IT Pro User Groups and will have a massive range of breakout session - something for everyone may be.

I've had a quick look at the agenda and if you are interested in Sharepoint, Groove, Exchange, Hyper-V, Terminal Services it looks like this could be the event for you, check it out here.

Tuesday, 18 March 2008

Install Fest Success

Thursday 13th March saw the NxtGenUG - Southampton pre-launch Install Fest take place at St. Andrews Hall in Southampton and what a great event it was.

We had a cracking turn out of 35 attendees many of whom brought lap tops and DSC00055some desktops even made it through the door all ready to install their free copy of VS2008 standard together with a years free trial of Windows Server 2008 and SQL Server 2008 CTP with a voucher for a free year trial when SQL Server is finally released later this year.

The evening started a little later than expected due to excessive traffic, something that we try not to do too often but we had specifically told people to come at 18:30 preparing for a 19:00 start. Whilst we were waiting we had a little practice on guitar hero and I must say I was completely rubbish so its probably a good job I couldn't have won anything anyway.

So everyone had arrived by 18:45, the pizzas were ordered and the talks began. After a quick intro and welcome by John, I kicked off the talks with my first DSC00048feature of VS2008.

I introduced my WPF stop watch application with lovely glass effect (see left..beautiful) that would keep us all on track and started the timer. My first session was on Multitargeting and went pretty smoothly although just missed the end of my five minute slot, doh! I'd implemented the timer to start the theme from the Countdown TV show when there was 30 seconds left just to put the pressure on a little more.

Next up was John with a gripping demo of how to easily install Windows Server 2008, he didn't quite manage to fit it into a five minute slot, another victim to the stop DSC00046watch!

Finally, Neil joined the demo clan by giving us a tour of SQL Server 2008, once more the stop watch took its victim with no remorse and the session overran - lessons were learned by us all after the first five minute sets and it was soon my turn again.

A quick breeze through C# 3.0 features including Lambda expressions, Automatic Properties and Extensions Methods saw my next slot out and so the pattern continued, Myself, John, Neil etc. My next couple of sessions thankfully ran to time with a small hiccup in my LINQ to SQL session but other than that I was pretty happy with the way things went.

I must say a big thank you to both Neil and John for putting the time and effort into those presentations, I know from my own experience that it was quite nerve wracking and took a lot of effort to put them together even though each segment only lasted 5 minutes.

DSC00045

Now, the reason why our launch event was slightly earlier than the "real launch event" was because my wife and I are expecting our first child on Saturday 22nd March, we figured that anything closer than Thursday 13th may have been pushing our luck a little and would almost definitely have meant that I couldn't take part. So I explained to everyone that I had my phone on just in case I got "the call" and I may have to leave unexpectedly, what I hadn't banked on was the pizza guy phoning me and for a moment my heart was in my mouth.

After the sessions ended it was pizza, beer, install and guitar hero time. Those with laptops and desktops started installing whilst others starting drinking and eating pizza. The guitar hero competition consisted of attendees pairing up together to gain their highest possible score on the two guitar hero pods that Microsoft had kindly loaned us for the evening. The winners of this wonDSC00054 Windows Server 2008 Enterprise Edition, SQL Server 2008 CTP5 and not for resale Enterprise Edition redeemable voucher when SQL 2008 is released as well as a copy of VS 2008.

At the end of the evening we had a little quiz about the contents of the evening and the winning team walked away with 6 Re-Sharper licences which were kindly donated by JetBrains.

All in all I think every one that came enjoyed the event, I know I certainly did. So many thanks to everyone that made it such a great evening and look forward to seeing you at our next event - Mike Taulty on the Entity Framework, should be a good one!

Cheers

P.S. If you did attend the event any feedback you have would be greatly appreciated, please go here to fill out your comments.

Tuesday, 11 March 2008

DDD Ireland

May the 3rd 2008 sees a DDD-styled event take place in Galway in the west of Ireland. Why not make this an excuse to go and spend a bit of time in the emerald isle.

If you've not been to a Developer Developer Developer (DDD) day before check out the agenda from DDD6, it's a basically a day for developers by developers and a great place to learn about new/existing technologies and working practices from guys that are actually doing it rather than people just peddling products. It's also a good place to meet other people in the community.

The agenda for this event is now available, so get on board, register and have a great time!

UK 2008 Launch Event "Swaggily Fortunes"

Wednesday March 19th 2008 is of course the UK 2008 Launch Event.  As part of the event, NxtGenUG are running one of their gameshows, which will take place about 6.00pm during the evening drinks and nibbles.  "Swaggily Fortunes" is a take on the well known TV Quiz show in which teams of contestants are asked, for example, "We asked 100 Developers ... To Name a .NET Language".  Those teams that guess correctly what the answers were get to win some fantastic "swag" -- after a few rounds of mayhem!
You can help be part of this 'great' occasion by going to http://www.nxtgenug.net/2008launch/swagfortunes.aspx and answering 8 short questions.  Your answers will go towards making up the choices which the teams have to guess.  The NxtGenUG lads have run this several times in the past always to great reviews, and it makes for a fun, relaxed way to wind down from the days sessions.