June 2005 - Posts

London .NET User Group 23rd June

Jon and I attended the London .NET User Group meeting on Thursday (June 23rd). The two guest speakers were excellent.

First up was Charlie Poole, lead developer for the NUnit project.  Charlie's laptop had almost run out of batteries and nobody had a UK adapter, so instead of running the risk of his power giving up partway through the presentation, he asked the audience what they wanted him to talk about.  This approach worked absolutely perfectly, Charlie has around 30 years of development experience and has a lot to say about testing and development methodologies. Charlie had just come from presenting at the XP2005 conference at Sheffield University, so we were treated to some of his thoughts on Extreme programming and agile methodologies as well.  It was a real shame that he had to stop speaking as I think we could have listened to him all night.

Second up was Benjamin Mitchell, who gave an excellent introductory presentation to Indigo, he gave people who had never heard of Indigo before great insight into its usage and extensibility. Benjamin is an excellent speaker and communicates the topic very well.

with 0 Comments

Geek Dinner

I went to the Geek Dinner in Crowborough on Wednesday (22nd June).  It was a really interesting event and great fun to be able to talk to other Geeks over a curry.  The conversation centred less on programming issues, although that was a significant part of it, but more on the history of computing over the years and those early days using a ZX81 with its keys made of some kind of 'dead skin'.

Simon Harriyott was interested in source control for his SQL Server database scripts, an area where he felt the tool support was lacking somewhat.  We talked about a number of options, but it seemed that the closest we could get was to code SQL inside of Visual Studio (Simon is lucky enough to be targetting his apps at .NET Framework 2 and thus he develops inside Visual Studio 2005 Beta 2).

All in all a great event and I am looking forward to the next one.

with 1 Comments

Bungie.net Technical Case Study: How, Where, What?

Sometimes MSDN has some really interesting content over and above the API reference documentation you expect, like the Extensive Examination of Data Structures series, Introducing Custom Entity Classes and Bungie.net Technical Case Study.

The Bungie.net technical case study talks through the background, business drivers, technical approach, project planning, solution architecture, test approach and execution & operations architecture; it's a really good overall story of the process from start to finish.

Halo 2 by Bungie

In the section on the development approach they mention,

The Bungie.net team used an agile, milestone-driven approach to the construction of Bungie.net, initially focusing their attention on the most significant architectural elements. The Bungie.net team worked in a close physical area, relying upon constant and continual communication between peers, yet able to employ expertise when required specifically during the requirements and design phases and later on when significant technical challenges were uncovered. The Bungie.net developers also worked extremely closely with the testers to ensure effective communication and fast defect resolution velocity. Having a strong test team was essential to making this site work.

and also describe some of the tools they used, including SQL Compare which I've mentioned before and BeyondCompare - however for file/folder comparisons I tend to prefer Araxis Merge.

2-way file comparison using Araxis Merge 2-way folder comparsion using Araxis Merge

with 0 Comments

What's so successful about Gordon Ramsay's management style?

Interesting read on the BBC News website called Compliments to the chef.

It covers a number of points about Gordon Ramsay's management style, one interesting statistic is that for all his profanities and tough approach his staff retention is very high,

He is not without his critics, but despite his reputation for hot-headedness he has held on to 80% of his staff for the past 10 years.

The points are true for most businesses/teams:

  • Working as a team - "It's an obvious ingredient of any successful business, but staff at some companies seem incapable of working as a team. Ramsay excels at giving his staff a sense of the story in which they play an important part."
  • Boss not friend - "Ramsay is tough, but his style is also about coaching and encouraging the best from his staff."
  • Back to Basics - "He hates pretension and makes sure the whole team understands what his vision is so they are all working towards the same goal."
  • Stand out from the crowd - "Ramsay identifies what each business can do to the highest possible standard."
  • Good communications - "His comments might be peppered with swear words, but Ramsay communicates clearly and continuously with staff. He lets them know exactly what he expects and provides them with both positive and negative feedback. The result is a highly-motivated workforce."

Many of those points are key to Agile processes; good communication via stand-up meetings, back to basics via YAGNI (You Aren't Gonna Need It), etc.

Maybe IT can learn some tips from other industries, Matt Davey points to a recent article on management techniques from Sport being applied to businesses. There's a similar story from Joel Spolsky in the introduction of his new book about an army major providing inspiration by setting a positive example.

As Terry from Harrogate says, "By him expecting the highest standards from his staff and being prepared to put in the time to help them achieve those standards. The overall effect is a completely inspiring boss."

How many managers in IT can you say the same for?

with 0 Comments

Microsoft Architect forum day on Connected Systems and SOA

Yesterday I attended the Microsoft UK 4th Architect forum day on Connected Systems, there have been previous ones on modelling, software tools and interoperability.

The speakers were mainly non-Microsoft people and they did a great job of covering a wide ranging subject.
There were the usual buzzwords; SOA (Service-Orientated Architecture), BPM (Business Process Management), EIB (Enterprise Information Bus), etc. where people's concrete understandings sometimes differ.

One of the most interesting sessions was the work done by Conchango on combining SO and BI (Business Intelligence), the format of their dual presenting worked well. Also great real-world case study of how House of Fraser consolidated a complex set of inter-related systems together and moved many of their partners from EDI to WebServices.

Benjamin Mitchell was there as an independent consultant to give the Microsoft view on WSE and Indigo; looking forward to his talk next week at the London .NET Usergroup, as I'm interested in the peer to peer support available that's going to be available in Indigo.

Richard Godfrey was answering lots of questions regarding the new Microsoft Certified Architect.

with 0 Comments

Building Dynamic Sql

There are advocates who argue between stored procedures and ad-hoc sql, normally I'll follow the development style of the current system where it makes sense. The main objection I have to stored procedures revolves around hundreds of ungrouped, often strangely named functions, the change between C# to T-Sql and the missing editing, debugging and tool support. I often find sql (using parameters) works in many cases just as well.

We'll see how things pan out with the CLR integration in Sql Server 2005, I'd be interested to hear more about how the ability to write Java code inside Oracle altered development?

On a recent project I used Sql.Net from Reebsoftware. It is a .NET library which provides an abstration layer over Sql, so you can generate Sql code in a more object-orientated way.

FromTerm tCustomers = FromTerm.Table("customers", "c");
FromTerm tProducts = FromTerm.Table("products", "p");
FromTerm tOrders = FromTerm.Table("orders", "o");

SelectQuery query = new SelectQuery();
query.Columns.Add(new SelectColumn("name", tCustomers));
query.Columns.Add(new SelectColumn("name", tProducts));
query.Columns.Add(new SelectColumn("price", tProducts));

query.FromClause.BaseTable = tCustomers;
query.FromClause.Join(JoinType.Left, tCustomers, tOrders, "customerId", "customerId");
query.FromClause.Join(JoinType.Inner, tOrders, tProducts, "productId", "productId");

query.WherePhrase.Terms.Add(WhereTerm.CreateCompare(SqlExpression.Field("name", tCustomers), SqlExpression.String("John"), CompareOperator.Equal));

query.OrderByTerms.Add(new OrderByTerm("price", OrderByDirection.Ascending));

string sql = new SqlServerRenderer().RenderSelect(query);

The main functionality I wanted was the automatic generation of paging sql code:

SelectQuery query = new SelectQuery();
query.Columns.Add(new SelectColumn("name"));
query.FromClause.BaseTable = FromTerm.Table("customers");
query.OrderByTerms.Add(new OrderByTerm("name", null, OrderByDirection.Descending));

SqlServerRenderer renderer = new SqlServerRenderer();
string rowCountSql = renderer.RenderRowCount(query);
int totalRows = (int)ExecuteScalar(rowCountSql);
string sql = renderer.RenderPage(pageIndex, pageSize, totalRows, query);


The best bit of using the library is that it just generates the sql code and therefore leaves you loosely coupled from how you execute the sql against the database, ie. using System.Data.SqlClient or the Microsoft Data Access block SqlHelper style. So if you find a problem you just can build the sql manually instead.

I'm still keep toying with Object/Relational mapping technologies, prototyping systems with nHibernate (still quite behind the Java Hibernate) and Wilson ORMapper (my preference) but always seem to back away from using them in a full production applications; interesting blog post comparing the two products by Paul Wilson. I haven't tried any of the more expensive commercial implementations like LLBLGen Pro.

Patterns of Enterprise Application Architecture discusses many of the common issues such as Single Table Inheritance and Association Table Mapping which many O/R Mappers try to solve in addition to not writing sql by hand.

with 2 Comments

Domain Specific Languages

Martin Fowler has a very interesting post on Domain Specific Languages. I have long been an advocate of using targeted languages when they clarify a problem domain (having written a few to help business users quickly adapt business logic in an evolving environment). However, it is important not to end up with the language cacophany that Martin mentions in his post.

I think DSL's can provide great benefit used in a wider context with Software Factories (detailed in this book); An especially powerful example of DSL's, applied to the actual process of providing IT solutions. Here, DSL's generate artifacts to feed into the next layer in the solution development process (this generation process can be redone at a later date should requirements change ;-) , without losing any modifications made at the lower level). To give an overly simple example, one could use an analysis DSL to generate artifacts for the design stage with feed in from a recommended set of design patterns (supplied using another DSL). I will be talking more about DSL's and software factories in future posts.

with 0 Comments

Developing as Admin? Stop it!

Everybody knows that developing as an admin on the local box is inherently evil, however, most people continue to do so because there is always something that you need to do with elevated privileges.  Well, twice over the weekend I read about developing as a non admin and now feel convinced that this is viable.  The first piece was by Keith Brown in his excellent book The .NET Developer's Guide to Windows Security.  Secondly, over on Aaron Margosis' Blog.

Both Keith and Aaron suggest great techniques for elevating your privileges when needed and also how to temporarily make your LUA account an admin account for all those times when you need to install a piece of software with admin privileges. Aaron even recommends having a local administrator account without a password in some circumstances(bet that makes you go read his blog)! With this information in hand, we can all avoid LUA bugs when we deploy our newly minted software to users. So do it now!

***UPDATE***
There is one gotcha that caught me out for a second, my surname is quite long and is used as part of my laptop machine name, this made the total length of the machine name over 15 characters. If you are in the same position and you are trying to use a local account for admin privileges, then only put in the first 15 characters of the machine name as follows:
for the computer myverylongmachinename I have the account root which is the admin user that I want for elevated privileges...A suitable runas command would be:

runas /user:myverylongmachi\root
with 0 Comments

DHTML Lemmings and AJAX

As much as I've been impressed by Google Suggest (how it works by Chris Justus), Google Maps (how it works by Joel Webber) seeing Lemming in DHTML (via Dare Obasanjo) made me smile more.

I remember playing Lemmings and discussing how to get past different levels at school on paper the next day, often with David Bodycombe (who designed some of the games for the Crystal Maze and also produces the Metro puzzle section) - sadly we didn't have all these solutions at the time.

 

Whilst most people have been getting all excited about Asynchronous JavaScript with XmlHttpRequest (or AJAX, I still cringe at the name). Adam Bosworth points out why it works now people have faster machines and broadband access, we used XmlHttpRequest quite a few years ago on intranet applications for web-based message boards and chat.

Maybe next time instead of hand coding javascript I'll try using.Ajax.NET from ASP.NET.

with 0 Comments

Logo Design Trends

Over on Graphic Designs USA they have an interesting feature on logo design trends this year. They compare groups of similar logos from various different companies.


When looking for some website design inspiration there are a number of great sites I like to visit, for example TemplateMonster and CoolHomePages. Some of the templates available on these sites look totally professional and amazing; the difficult part tends to be following a great homepage design with the lower level content pages.

If you are after some photos for a site then GettyImages, Corbis, the free Stock.xchng, or even a search Google Images are good places to start; although don't forget to check the copyright and usage terms.

Next if you need to "fake" text for the layout, then Lorem Ipsum can generate you a few words to a few paragraphs of dummy text. But I'd agree with Jason Fried from 37signals on using real content when finalising designs with business sponsors.

with 0 Comments

Can't read Sql because it's too messy

Continuing the Sql theme... sure we have all been there before where you're looking at someone else's (or your own) sql and it's a bit of mess.

I often use this little tool which can reformat sql code from this:

SELECT Orders.ShippedDate, Orders.OrderID, "Order Subtotals".Subtotal, DATENAME(yy,ShippedDate) AS Year FROM Orders INNER JOIN "Order Subtotals" ON Orders.OrderID = "Order Subtotals".OrderID WHERE Orders.ShippedDate Between @Beginning_Date And @Ending_Date

to:

SELECT
 Orders.ShippedDate,
 Orders.OrderID,
 [Order Subtotals].Subtotal,
 DATENAME(yy, ShippedDate) AS Year
FROM
 Orders
INNER JOIN
 [Order Subtotals]
ON
 Orders.OrderID = "Order Subtotals".OrderID
WHERE
 Orders.ShippedDate Between @Beginning_Date AND @Ending_Date

After you install it, ignore the evaluation splashscreen this first time and click close, then it sits in the taskbar. You'll probably want to change the options, normally I switch oneline off and set keywords to uppercase on. Then copy the sql to the clipboard and press the hotkey Ctrl+Shift+J and then paste the newly formatted sql back. It's not perfect, but it is handy for quickly cleaning up sql.

You can download niceSql from http://home.broadpark.no/~ihalvor/

Seems I'm not the only one looking for better tool support in Sql Server as Dan Fernandez has some great ideas.

Also Apex Sql Edit has some good features like Intellisense, better editor, unit testing, etc.

Whilst we're on the subject, in Sql Server 2005 nearly all the dialog boxes have been improved so they are no longer modal and you can make all your changes and then view those changes as a script for later use; useful for learning Sql syntax for backup and restore commands.

with 0 Comments

Comparing Sql Server schema and data between databases and servers

I'm going a bit Sql Server blog crazy...

Some tools you just need to have, one of those is Sql Compare from Red Gate, they are a British company based near Cambridge.

"SQL Compare is for use in a development environment when changes made to a local database need to be pushed to a live database on a remote server. Traditionally, this meant spending hours trawling through database schemas, hand-generating migration scripts. SQL Compare will automate this process for you. It will compare and synchronize all database objects, including, but not limited to, tables, stored procedures, views and user-defined functions. SQL Compare does this fiddly and tedious job properly – for example, dependencies and referential integrity are properly taken into account, and the SQL scripts are of a very high quality."

One thing that is particularly good about this set of tools is that it places created scripts within a transaction, so it will rollback any changes should an error occur.  The scripts also include users and associated permissions for all objects. Perfect tool for double-checking you haven't missed anything and checking that development, staging, test and production are all in sync after a release.

with 1 Comments

Sql Server 2005 Integration Services (Think replacement for DTS but much, much more)

There is so much new to learn about SQL Server 2005 let alone when to use it.

This video gives a good introduction on SSIS, where the demo shows creating and executing a package. You'll see the new tools, how the items change from white to green whilst running including showing the number of rows processed. Also the ability to add ""viewers" to see the data at each step.

Don't forget you can also try some of the hands-on-labs.

Jamie Thomson from Conchango has been posting some great blog entries on Sql Server 2005 and SSIS.

with 0 Comments

VS.NET custom projects...

Test driven development is a great way to deliver solutions, constantly giving you the confidence to add a piece of functionality or perform that next large refactoring. But setting up your project can be a real pain, at least two projects are required - the test assembly and the assembly under test - plus a bundle of references to NUnit, so I use a custom project wizard for VS .NET 2003 to do these painfully boring tasks for me. Tools for generating code and performing mundane tasks should always be encouraged; they allow you to get on with the stuff you enjoy without breaking your train of thought. If you don’t believe me then you need to read ‘The Pragmatic Programmer’! So, here is the approach to produce a simplified version of one of the wizards I use for my projects.

  1. Fire up notepad and create a ProjectAndTests.vsdir file that is located in your program files\Microsoft Visual Studio .NET 2003\VC#\CSharpProjects, these files contain a lot of stuff that you just do not need to understand (perhaps I will go into detail in a later post). Okay, Add the following single line to your blank file:
    CSharpDLLWithTest.vsz|{FAE04EC1-301F-11d3-BF4B-00C04F79EFBC}|Class Library And Test|1|Class Library and Test Template|{FAE04EC1-301F-11d3-BF4B-00C04F79EFBC}|4547| |ClassLibraryWithTestProject

    This gives VS the information it needs to display your project in the C# projects section.
  2. Now you need to create the vsz file that you just referred to. In the spirit of doing the least that works (XP), open the CSharpDLL.vsz file from this directory and change the line that says Param="WIZARD_NAME = CSharpDLLWiz" to Param="WIZARD_NAME = CSharpDLLWithTestWiz". Save this file as CSharpDLLWithTestWiz.vsz so VS now knows where your template should be.
  3. Go up one directory and then navigate to the VC#Wizards subdirectory. Make a copy of the CSharpDLLWiz folder with its contents and place it at the same level renamed as CSharpDLLWithTestWiz. The same name as that used in the previous step.
  4. Almost there, now we navigate into the CSharpDLLWithTestWiz\scripts\1033 directory, open the default.js file in there and make a couple of changes. cut the lines between:
    var strProjectName = wizard.FindSymbol("PROJECT_NAME");

    and
    proj.Save();

    exclusive and move them to a function:
    function CreateProject(strProjectPath, strProjectName) { ... } add a final line to this function to return the proj instance (return proj;). now replace the empty space where you just cut from with two calls to your new function:
    proj = CreateProject(strProjectPath + "Test", strProjectName + "Test");
    var refmanager = GetCSharpReferenceManager(proj);
    refmanager.Add(path to your nunit dll minus the extension here);
    proj.Save();
    proj = CreateProject(strProjectPath, strProjectName);
    //the following line should be the proj.Save(); line that you had left from the original.

    Save the file and close it.
  5. You’re done, fire up a fresh instance of VS.NET 2003 and create your new DLL with test project.

That’s it, this has been a bit of a whirlwind tour although the steps are about as simple as I could think of making them. I hope this helps you to begin automating away some of the pain in your development. If you get stuck, just email me at simon.thorneycroft@syncadia.com.

with 0 Comments

London Geek Dinner

Jon and I attended the London Geek dinner last night, a fantastic experience and good to be able to say thanks to Robert Scoble for Channel 9. However, the event should more accurately have been termed the London Blogger dinner as it was populated by people whose careers spanned law (Scott Vine), marketing and journalism (it probably included many other professions, but that is the cross section of people that we spoke to).

Robert gave a brief after dinner speech at the Texas Embassy and then people asked questions about his experiences of blogging. At one point he was asked if he felt in constant danger of being sacked to which he stated that he had 'be smart' about what he blogged, but if he were to be sacked then he could go out and double his pay!

We talked about how people felt that blogging could be good for history: "Imagine a million Samuel Pepys or Anne Frank's diaries".

We got to talk to quite a few people, a particular theme of the evening for everyone was the use of RSS feeds over at backstage.bbc.co.uk and at one point we talked to an American journalist, Kevin Anderson, who was over at the BBC in London for a few months, he was interested in parsing up information from news that talked about key terrorists and where they rumoured to be in the world, once this information was placed on a timeline and displayed on a map, this meta information could improve the overall story.

Hi to Matt Richardson, Biscuit and Chris Prakoso.

All in all a great occasion, can’t wait for the next one!

with 0 Comments

Intellisense for your NAnt Builds

An oldy, but a goldy, this one...I have spent a good proportion of today refactoring the Cruise Control build scripts on my build server. The build, Nunit tests and FXCop reports are all providing useful improvement over the previous incarnation of the build scripts (We like making incremental improvements). 

Whilst I was updating the build script, a colleague happened to notice that I was getting intellisense for the NAnt and NAnt Contrib tasks within the Visual Studio .NET 2003 environment, something that I had set up quite some time ago.

Obviously, since everyone in the world doesn't know this yet I thought it would make a good blog entry, however, as usual someone beat me to the post (pun intended). The information you need to generate a full nant schema is here and in the feedback for the post you can learn where to place your newly generate XSD file.  What makes this approach so great is that it is no effort to regenerate the file and also it will include any other custom task types that NAnt is aware of.

with 0 Comments

Objections to Agile Development from Senior Executives

I enjoyed reading this article an Objections to Agile Development (via Darrell Norton).

"In big companies, it's often more acceptable to be wrong than it is to be uncertain."

One of the reasons software development has had such a checkered past in many IT organizations has been the lack of a business-IT partnership — a lack of defining roles and responsibilities. Since IT staff have had good analytical skills, they have often been used as “analysts” for the business, helping business departments improve their processes, for example. Then, the business department staff turns around and blames IT for the result — “See what they did to us.” If IT doesn’t help the business redesign processes prior to automation, the comments are “See, you just automated the old stuff,” and when they do help with redesign, IT gets blamed for all the changes, staff reductions, job changes, and so on. It’s a no-win situation because there’s little acceptance of responsibility on the client side for the results of the automation effort.

... Agile developers are saying, "Enough. If the development staff can't deliver acceptable working software on a regular, short-iteration basis, the customers ought to fire us and get someone who can." Conversely, if the customers can't identify features, prioritize them, and interact with the development team to flush out requirements, then the development team should retire from the project.

with 0 Comments

Creating photo slideshows

Normally if I need to put up a few photos on the web to share, say from a wedding or holiday I use the Windows XP Powertoy Html Slide Show Wizard. It works well, it generates the html and images, then you can just ftp the files up to your web hosting.

Other times I have a bit more creative flare and put together the pictures in a more "funky way", like I did for the Microsoft UK Community DeveloperDeveloperDeveloper! Day website recently.

 

But today I saw a cool photo slideshow using Flash that was built using a free tool called SimpleViewer from AirTight Interactive. Check out this example. It's quite similar to the slideshow on flickr.

Also worth a mention is using Microsoft Windows Media Center Edition for viewing photos at home; it's amazing how much more watchable photos are by just adding little pan and zoom effects. I should also mention Picasa which Google now owns which has some clever functionality too.

with 0 Comments