Wednesday, August 08, 2007
Just a reminder that the Sylvia Park Architecture Chat is on tomorrow, 11:30am at Garrisons (as per usual).  I ummed 'n ahhed about doing it so close to the Dev Code Camp / Teched, but I can't see it doing any harm, worst case scenario we just have a smaller turnout.

So I'm looking/asking for topics, here's some things that have perked my interest over the last week or so:
See you there.

posted @ Wednesday, August 08, 2007 6:54:54 AM (New Zealand Standard Time, UTC+12:00)    Comments [0] | Trackback |
 Thursday, July 26, 2007
About to run off to a meeting... so I'll make this quick.

Just read an interesting post by Donald Belcham on Refactoring Analysis with the help of nDepend... he's gone through the process of moving from .Net 1.1 to 2.0, then introducing interface based code, breaking classes apart to ensure they're enforcing the principle of single responsibility, moving to injecting dependencies, rolling his own primitive Inversion of Control container and finally employing the Castle Project's windsor container instead.

It pays to know a little bit about nDepend of course to understand the Abstractness vs Relational Cohesion figures... either take a look at the nDepend site, or maybe have a listen to the .Net Rocks podcast earlier this year which covered the same topic.

I'm not sure the figures actually answer questions so much as they ask them ... but it's interesting to see how much impact his first two rounds of refactoring had on the results.

I wonder how the figures would've come out had he executed his refactoring in a different order...  maybe DI first, then breaking the classes up based on responsibility, IoC and then finally introducing interfaces... hmmm

posted @ Thursday, July 26, 2007 1:57:28 AM (New Zealand Standard Time, UTC+12:00)    Comments [0] | Trackback |
 Tuesday, July 24, 2007

So IronRuby has been released in a pre-alpha state... check out the comments on John Lam's post for some additional details not in the post itself.

c:\dev\resources\IronRuby-Pre-Alpha1\Bin\Release>rbx.exe

IronRuby Pre-Alpha (1.0.0.0) on .NET 2.0.50727.312

Copyright (c) Microsoft Corporation. All rights reserved.

>>> class RubyAlpha

...    def hello

...            puts "Hello"

...        end

... end

=> nil

>>> r = RubyAlpha.new()

=> #<RubyAlpha:0000002b>

>>> r.hello

Hello

=> nil

>>>


Things of interest:
  • Lots of stuff doesn't work just yet ;o)
  • it will end up on Rubyforge, not Codeplex... and I think it's quite an appropriate decision considering the nature of the project... good to see common sense winning over marketing dogma - and it's going to be there by the end of August.
  • The project will eventually be entirely open to community contributions (I don't think that includes the code making up the DLR itself, as a shared platform that's probably something that needs to be tightly controlled)


posted @ Monday, July 23, 2007 8:22:38 PM (New Zealand Standard Time, UTC+12:00)    Comments [0] | Trackback |
 Friday, July 20, 2007
So, big congratulations to Alex J - first an MVP and now a Microsoft employee to boot... (which I suspect trumps his MVP status, probably should be MVE now, for Employee!).

I've been working with Alex (2 Alex's... very confusing) on a pretty interesting project for the last couple of months, and it's been a lot of fun getting a brain dump from a guy who's so passionate about technology (and community too) and with so many varied and original ideas... Whenever Alex J starts a sentence with "now I've been putting some thinking around this" you generally know your about to learn something cool :)

On a side note, I'm thinking of taking over the organization/blogging etc. of the Sylvia Park Architecture Chats in the other Alex's absence... It would be a real shame to let it die once Alex J has moved to the states... at any rate, something to talk about this coming Thursday at the next chat!


posted @ Friday, July 20, 2007 5:21:10 AM (New Zealand Standard Time, UTC+12:00)    Comments [3] | Trackback |
 Saturday, July 14, 2007
I decided to have a play with some of the new aggregation-esque platforms this evening... for a break from cutting code...

So first off I had a play with dapper, turning the castle project's build feed (that's html) into an RSS Feed... It was painless, and required zero skill ... but it was limited in what it was capable of achieving... basically you can just just click on the content you want, give it a name, then pick which named parts will make up say an RSS feed. 

dapper.png

It's pretty elegant at what it does, though I think it's got a way to go before it'll parse some of the more tricky content out there.

The next thing I did was to have a go with yahoo pipes... I decided to do something pretty simplistic, aggregating the feeds from the Fisheye change log RSS for the castle proejct with the feed I'd created with dapper.net for builds.... this was a delightful drag and drop experience, I didn't even read a tutorial ... I just seems to "work" exactly as you would expect.

The resulting published pipe is here.

yahoo_pipes.png

I didn't originally have the truncate step in the pipe, but had to add it after attempting to burn the feed with feedburner (it was over 512K in size, so feedburner politely said "no") after that it burnt just fine... as you can see:

feedburner.png

I couldn't get the two aggregate feeds to sort correctly, but I'm sure it's possible using yahoo pipe's, any new events should appear in the expected order though... you can subscribe to the feed here if your curious.

Of course the hosted platforms aren't much use if you need to handle private/local feeds or interact with other types of systems (like your private gmail account) and that's where I believe something like plagger comes into it's own... I haven't had a chance to play with it yet, but it's definitely on my list of things to do... there's still a lot of manual information management and categorization/organization that I'd rather hand over to some kind of automated agent.

[Disclaimer: I'm no expert on these kinds of things, I just figured there might be some other "head-in-the-sand" developers who haven't played with these kinds of sites, and might find it interesting like I did ;o]
posted @ Saturday, July 14, 2007 10:00:18 AM (New Zealand Standard Time, UTC+12:00)    Comments [3] | Trackback |
Wasted 5 minutes figuring out what was going wrong, maybe this will save someone else the effort!

When using RhinoCommons and CastleProject both from trunk there's a version conflict with NHibernate.

RhinoCommons has NHibernate Version 2.0.0.1001 (Including support for things like Multi-criteria) ... and then the Castle Project is using NHibernate Version (1.2.0.4000) - this took me a little bit by surprise when I discovered that a monorail project I had was failing when attempting to databind properly when using the ARSmartDispatcherController... because I wasn't checking the binding errors collection, this was just failing silently... so a save would just load/save the existing record, without any binding.

Quick fix is just to use a assembly binding redirect in the web.config:

<runtime>

    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

        <publisherPolicy apply="no"/>

        <dependentAssembly>

            <assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral" />

            <bindingRedirect oldVersion="1.2.0.4000" newVersion="2.0.0.1001"/>

        </dependentAssembly>

    </assemblyBinding>

</runtime>




posted @ Saturday, July 14, 2007 1:13:35 AM (New Zealand Standard Time, UTC+12:00)    Comments [4] | Trackback |
 Friday, July 06, 2007
Well I've had a highly unproductive afternoon scrambling to rebuild my development PC after the RAID 5 decided to kill itself off... at first the pc reported one disk had fallen out of the raid... I brought it back in, rebooted, the machine started rebuilding the array then rebooted itself.. at which point it declared each disk was a member of different array... stuffed around with it for about an hour and contemplated throwing a 750gig drive in and doing a software-based recovery... but considering last time I did something like that it took a number of days to complete, I decided to just heave a large sigh, break the array up into individual disks and re-install (without RAID-5 this time...). 

Thankfully between svn, google apps (gmail for domains, google reader) and del.icio.us I don't think a lot has slipped through the gaps, barring the odd bit of skype history.

Guess I know what I'll be doing this weekend.  bleh!

posted @ Friday, July 06, 2007 3:07:22 AM (New Zealand Standard Time, UTC+12:00)    Comments [4] | Trackback |
 Thursday, July 05, 2007

So I see both Andrew, Nick and Alex J have some thoughts on languages, and of course Rowans post sparked it off... and people talk about beautiful languages, mentioning expressiveness in the same breath. 

Personally I love how expressive Ruby is - I think potentially because I got my first exposure to ruby after reading Why's poignant guide a while back (I see there are new chapters ...oooh) which was quite surreal compared to how I say learnt C++ (from reading the Borland Turbo C++ manual when I was 11, also my first exposure to OOP)...

When I code in ruby I feel like I'm telling stories... I dig that :)

So Alex J mentioned that extension methods let us achieve much of the syntactic sugar that ruby provides (though obviously in ruby's case this isn't so much syntactic sugar as core mechanisms in the language itself) - and of course Lambda expressions are helping too, but does expressive == good 100% of the time?   I don't think I'm qualified to say, but I can't help but feel that a language which is very expressive, isn't necessarily the easiest to manipulate and refactor, so I may not be as productive and it may not feel as fluent to me... I quite liked this resharper horizons post which suggests that tooling support should probably influence future language design - could that requirement possibly fight against an increased level of expressiveness in a language, will compromises need to made, or is nirvana just around the corner?

As for C# vs VB.Net - large clumsy keywords are only a probablem until something like Resharper steps in... when I'm developing I see a lot of unusued space on the right hand side of the editor with C#... if VB.Net fills it up, and I'm not typing any harder to get there, why should I care - hell it'll probably make a VB.Net Resharper Jedi look more impressive then the C# equivalent, he'll be producing more characters ;o)

OK, well I figured this post should at least have some code... I'd feel uneasy otherwise... so how about:

public static class CommonExtensions
{
    public static Action<Action<int>> LoopTo(this int start, int end)
    {
        return new Action<Action<int>>(action => To(start, end).ForEach(i => action(i)));
    }
 
    public static IEnumerable<int> To(this int start, int end)
    {
        if (end < start)
            for (int i = start; i > end - 1; i--)
                yield return i;
        else
            for (int i = start; i < end + 1; i++)
                yield return i;   
    }
 
    public static void ForEach<T>(this IEnumerable<T> sequence, Action<T> action)
    {
        foreach (T item in sequence) action(item);
    }
 
    public static void PrintLine(this object o)
    {
        Console.WriteLine(o);
    }
}


So now we could try and do this....

// ruby
(10..20).each { |i| puts i }

// C#
10.LoopTo(20) ( i => i.PrintLine() );


Alas I don't think C# will ever match ruby in this game, no matter how we try to nudge it there... and until the development community figures out where the healthy place is to draw the line in the attempt, we may be doing more harm then good by pushing for it, sacrificing discoverability/maintainability for expressiveness.   Maybe that's just dogma, and expressiveness makes code inherently easier to maintain in the first place, so we don't need to care.... time will tell.

Of course I could be wrong, I am a little sleepy ;o)
posted @ Wednesday, July 04, 2007 12:03:27 PM (New Zealand Standard Time, UTC+12:00)    Comments [0] | Trackback |
 Wednesday, July 04, 2007

So Catch Ltd (one of DevDefined's partners) turned 3 today, and there was a few birthday celebrations  this evening.  Not only was it an opportunity for me to establish my supremacy in the role of worst ten pin bowler, but it was I think one of the first times the entire Catch team actually got to the meet each other - considering the type of work Catch does (providing QA, BA & PM resources primarily, generally on-site) it's actually pretty rare for everyone to be in one place at the same time!

It's been great to watch a company that started off effectively with just the Managing Director Bryce Day 3 years ago reach a size where you can't even fit all the employees into a meeting room any more, with new roles being created on an almost weekly basis, exciting times ahead for Catch I would say!

Great work Bryce, and all the Catch Staff - keep up the great work!

And for anyone looking for a company which can provide highly skilled and talented PM, BA or QA resources or end-to-end software development leveraging the skill sets in both Catch Limited and DevDefined then why not drop Catch an email?

posted @ Wednesday, July 04, 2007 10:52:23 AM (New Zealand Standard Time, UTC+12:00)    Comments [0] | Trackback |
 Tuesday, July 03, 2007

So I've tidied up the source for the DSL from my last post a little... though my "test" was to represent a DSL similar to the one Ayende displayed in Brail - I haven't implemented any monorail view engine integration, there's little point I feel, I was more interested in being able to display a nested DSL-like syntax, and parse the necessary information out of it as required. 

You can grab it from SVN repository here (edit: I've now fix the PROPFIND proxy issue, so the link should work)

At any rate, probably the most interesting example is the one that takes this code:

var people = new List<Person>()
{
    new Person() { FirstName = "Alex", LastName = "Henderson"},
    new Person() { FirstName = "Joe", LastName = "Bloggs"}
};
 
var compDsl = new ComponentDsl();
 
compDsl.Add
(
    GridComponent => compDsl.Component
    (
        compDsl.Parameters
        (
            source => people
        ),
        header => compDsl.Section
        (
            tr => compDsl.As
            (
                th => compDsl.As
                (
                    compDsl.Text("Names")
                )
            )
        ),
        item => compDsl.Section
        (
            tr => compDsl.As
            (
                td => compDsl.As
                (
                    compDsl.Item<Person>(p => p.FirstName + " " + p.LastName)
                )
            )
        )
    )
);
 
var dsl = new StandardDsl();
 
dsl.Add
(
    html => dsl.As
    (
        body => compDsl
    )
);

And converts it to this xhtml...

<html>
  <body>
    <table>
      <tr>
        <th>Names</th>
      </tr>
      <tr>
        <td>Alex Henderson</td>
      </tr>
      <tr>
        <td>Joe Bloggs</td>
      </tr>
    </table>
  </body>
</html>

You can pretty quickly figure out what's going on by placing a breakpoint on the Execute() method of the StandardDsl class and tracing through all the calls - in essence all the nodes are emitted by calling the top-level Batch delegate which causes a recursive call down the "tree", with the information being emitted as a side-effect to an evaluation scope.

Though I used nodes - effectively creating a structure that's easier to parse, there's no reason why you couldn't make immediate calls to some kind of object, avoiding the need for a second round of parsing - the only trick is that you'd still need to use some kind of scoped stack to push/pop the names of the components because in a statement like this:

dsl.As
(
    GridComponent => dsl.Component
    (
      // etc. etc.
    )  
)


the call to dsl.Component needs some way to inspect the stack of names and pull "GridComponent" off the top.

I'd love to hear from anyone who could see a use for this kind of thing... it'd be nice to get a more realistic example... I'm struggling to think of anything practical myself.

[Edit: I Noticed the code formatting was pretty awful, so I've tidied it up a little... anyone got a good solution for copy/pasting code out of orcas (CopyAsHtml2005 doesn't appear to install under Orcas)]
 |  | 
posted @ Tuesday, July 03, 2007 11:01:26 AM (New Zealand Standard Time, UTC+12:00)    Comments [2] | Trackback |
Search
FeedCount

Tags...
Who am I?
Alex Henderson
Alex Henderson
Auckland, New Zealand
Managing Director at Dev|Defined Limited

"Self Confessed Coding Junky for 15 years"
View Alex Henderson's profile on LinkedIn
 
Mobile: +64-21-402-969
Email: bittercoder 'at' gmail 'dot' com
MSN: bittercoder_nz@hotmail
Skype: alex.devdefined
Navigation