Thursday, November 01, 2007

Architecture Chat #19

So another small turnout - Garreth, David, Murray (From Terabyte) and Myself. Peter gave his apologies, being out of town today.

First off we had a talk around the various issues / challenges facing electronic payment, US dollar merchant accounts, PayPal etc. when selling your products on line. 

Part of the discussion focused around the fact that there is no existing product/site out there that can help sell your software products (that has the right features), we're thinking:
  • Distributing licenses from a pool.
  • Calling back to a web service for generating licenses on the fly.
  • License activation over the Internet.
  • License expiration (for yearly licenses) and the required logic around that i.e. automatically adding license renewals to a users shopping cart, sending notifcations.
  • The list goes on...
Even more so, building a community around selling add-ons, templates etc. for your product, and providing a model where micro payments can be collected i.e. buying credits and redeeming them on purchases etc. There are plenty of good ideas in this space.

Last of all, the existing software retail sites need to take a smaller cut - a not uncommon amount is 10-20% of the product cost... that's just crazy, especially for high-cost products, thats no different to giving them a 20% share in your business - you don't need to ship many products before you could've just built your own using PayPal.

Following that we had a long conversation around Garreth's ArchAngel product again, and in particular around the challenges of templates, round-tripping code, interesting usage scenarios i.e. (generating a model, the UI to bind to that model and WatiN classes which make it easy to write tests for the UI) - and also around preferences i.e. strengths and weaknesses of using a statically typed language (C#) embedded in the templates vs. something like IronPython or Boo, and how you can flow compilation errors (line numbers etc.) from the compiler back to the template - something I have trouble with when diagnosing Binsor, brail and my own boo based template engines at the moment, mostly because I haven't invested the time to make the experience better.

At that point we had a discussion around the various CMS's - I've been doing some research to pick one for a few sites I want to port from "other" CMS's.... The three I picked on for .Net were:
i.e. some of the open source ones... I would've liked to have included rainbow cms as well, but I just haven't had the time to review it yet.

Everyone knows about DNN (in fact we complain about it quite regularly ;o) - so it was really put up as a base line for comparing the others... mojoPortal is a bit like DNN, however it supports a wider range of databases - can run on mono and has a few unique/interesting features.  It lacks the same level of community involvement as say DNN or Umbraco, but it does give you the opportunity to avoid shelling out for OS licenses... Alas it uses web parts, and though xhtml compliant it lacks the rendering flexibility of Umbraco - Also the data model is pretty scary... a single class for all core data access, using stored procedures.

Umbraco looks good - has a reasonable template engine, and is a little more content-flexible then the other products which are based on web-parts - Sql server only and the business entities have in-line sql (why haven't any of them been built using a bloody ORM!) - this kind of thing scares the hell out of me - round trip per-property?? why!

public int MasterTemplate

{

    get{return _mastertemplate;}

    set{

        _mastertemplate = value;

        SqlHelper.ExecuteNonQuery(_ConnString,CommandType.Text,"Update cmsTemplate set master = " + value + " where NodeId = " + this.Id);

    }

}

 

public string Design {

    get {return _design;}

    set {

        _design = value;

        SqlHelper.ExecuteNonQuery(_ConnString,CommandType.Text,"Update cmsTemplate set design = '" + value.Replace("'","''") + "' where NodeId = " + this.Id);

    }

}


Or better still, how about this web control's OnInit method:

protected override void OnInit(EventArgs e)

{

    base.OnInit (e);

    SqlDataReader dropdownData = SqlHelper.ExecuteReader(umbraco.GlobalSettings.DbDSN,

        CommandType.Text, "select id, text from umbracoNode where nodeObjectType = '39EB0F98-B348-42A1-8662-E7EB18487560' order by text");

    base.DataValueField = "id";

    base.DataTextField = "text";

    base.DataSource = dropdownData;

    base.DataBind();

    base.Items.Insert(0, new ListItem(ui.Text("choose") + "...",""));

 

    // Iterate on the control items and mark fields by match them with the Text property!

    foreach(ListItem li in base.Items)

    {

        if ((","+Text+",").IndexOf(","+li.Value.ToString()+",") > -1)

            li.Selected = true;

    }

    dropdownData.Close();

}


The biggest down-side to me however is not the glorious SQL sprinkled everywhere - but the XSLT... I just flat out hate working with XSLT... and nobody at the table seemed to have anything good to say about it either.  It's certainly powerful, but it's just no fun to work with (XSLT that is, not Umbraco).

Still none of these are necessarily reasons to throw the baby out with the bathwater, if it gets the job done (which Umbraco certainly seems to, based on community feedback) then why not use it - the only other thing that puzzles me is the complete absence of a test suite for a project, even an empty test project would be a good sign ;o)

So on that note, Murray is embarking on a Umbraco project over the next couple of weeks - I'll check back with him when it's done and get a post-mortem on how it went, and what his thoughts are on the framework.

On the flip-side... why hasn't a monorail/ActiveRecord based CMS been released yet (that's open-source) ... a few have been written (obviously for commercial projects), but the parties and companies involved never seem to have the initiative to allow their code to escape out into the wild... I can't help but wonder how much stronger Monorails position would be if a CMS had been developed and grown along-side the project, if nothing else I suspect we might have a seen a few more interesting view components developed and made available by now.

Hardly new thoughts though - this has been discussed a few times on the Castle-project-users list, but nothing seems to come of it...

We then had a brief talk about F# becoming a "first class" language for the .Net framework, that will be in VS2008... one of the questions was what F# offered, there is a lot, but things that I can recall.
  • Functional programming, in particular foundational features like lists, tuples (allowing multiple arguments /multiple returns), pattern matching etc.
  • Type inference (which we discussed, i.e. is code using inferred types harder to read/understand as things become more complex, a bit like using var in C# 3.0?)
  • All data is immutable by default (makes multi threading etc. easy - mutable data must be declared explicitly).
  • Linq integration, and some metaprogramming functionality.
I'm pretty sure that list does the language a great injustice :)

What is exciting is that unlike C# vs VB... in this case F# provides features which make it compelling for solving certain types of problem - and as a first-class language you don't miss out the debugging etc. experiences (and your guaranteed a language which isn't going to stall or be thrown away any time soon) - I doubt I would use it for an entire project, but I could certainly see writing specific libraries in it for consumption from C#/VB.Net applications.

Last of all we discussed Recruiting (in a fairly light-hearted manor) - in particular graduates and the state of the industry with regards to finding good/brilliant graduate and intermediate developers who you can throw at interesting jobs that require a real passion and depth of understanding i.e. writing language parsers, building development frameworks etc.

The jobs we would've liked to have had when starting out ourselves no doubt!

In short it seems very hard to find really talented junior and intermediate developers to throw at highly technical work at the moment in the Auckland region (or contract resources for that matter)... And that salaries (which we've discussed are already too low in NZ for "distinguished" engineers) offered for many intermediate positions are too low to attract the right candidates, I still see some intermediate positions being offered for between $50 to $65K .. I had an $50K+ intemediate position 5 years ago!

Some thoughts included:
  • Getting more involved with institutes before the students graduate i.e. offering 3rd year projects etc.
  • Giving up and outsourcing overseas using a service like rentacoder... or maybe looking to a company like Castle stronghold.
  • Luring people away from open source technologies like ruby/python/php with more money.
Not great conclusions I'm afraid!

I also had planned some discussion around Java & .Net (as mentioned in this post) which we didn't get too - we'll discuss those next time if anyones interested (sounds like something that might be of interest to Peter).

And that's it for another Architecture Chat, thanks to all those who attended, and I'll see you in a couple of weeks time (Thursday 15th November).

BTW - If you have any suggestions for topics next time, please feel free to pass them on, and maybe next time we can move the focus back to some broader architectural topics and get some debate going on :)

Announcements

Quick couple of announcements / reminders:
  1. The CodeCamp BootCamp 2007 is on this weekend in Christchurch (where you can watch Ivan put IronRuby through it's paces, among other things)
  2. André Meurer from Olympic software has organised another Ellerslie DNUG meeting next thursday, details are below:

Microsoft PerformancePoint 2007

Ellerslie, Auckland , Thursday 8 November 2007
Gather at 5:45, starting at 6:00

Presented by: Adam Cogan (Chief Architect at SSW, MVP)

Microsoft Office PerformancePoint Server 2007 is an integrated performance management application designed to help improve operational and financial performance across all departments and all levels of your organization.

With Office PerformancePoint Server 2007, you can monitor progress, analyse what is driving variances, and plan your business from budgeting to creating management reports. You can have metrics, key performance indicators (KPIs), and reports delivered to every desktop through intuitive scorecards, dashboards, and the easy-to-use 2007 Microsoft Office system environment. A key component of the Microsoft Business Intelligence (BI) offering, Office PerformancePoint Server 2007 can help you understand how performance can align with personal and departmental.

http://www.microsoft.com/business/performancepoint/

Click Here to Register


Catering: Pizza & Drinks
Door Charge: Free!
Parking: Free, just park in Olympic Software’s car park

Venue:

Olympic Software
10 Cawley St
Ellerslie
Auckland

Map of venue

posted @ Thursday, November 01, 2007 12:28:37 AM (New Zealand Daylight Time, UTC+13:00)    Comments [7] | Trackback |
 Tuesday, October 30, 2007
Hi All!

The next Architecture chat is on thursday this week, 11:30am at the Sylvia Park in Auckland (at Garrisons).

As always, bring along your thoughts and discussions, and in the mean time here are some possible topics for discussion that have caught my eye over the last two weeks.
  • Java & .Net
    • The IKVM project (Java VM implemented in .Net)
  • Accropolis changes
    • No new previews
    • P&P will provide WPF Composite Client guidance (uh oh)
  • Open source CMS's
  • F# - becoming a first class language in VS.Net
  • PLinq, now GridLinq.
  • Recruiting .Net developers how to/approaches.
And if anyone else has suggestions, feel free to throw me a comment/email etc. and hopefully we can get a few more of the regulars back this week.

See you all thursday!

posted @ Tuesday, October 30, 2007 9:34:41 AM (New Zealand Daylight Time, UTC+13:00)    Comments [5] | Trackback |
Just a quick note that I've put together a small guide on working with the Castle / Nhibernate / RhinoTools trunk here on my wiki, which goes well as a companion to this article on working with the Castle trunk which can be found on using.castleproject.org.

Hopefully it proves useful to someone other that myself.

posted @ Tuesday, October 30, 2007 8:30:36 AM (New Zealand Daylight Time, UTC+13:00)    Comments [7] | Trackback |
 Sunday, October 28, 2007
So, another small turnout last week – but good discussions none the less, with 4 of us in total (Peter, David, Gareth and Myself).

First off we had a talk about ArchAngel, the product that Gareth has architected/written, and what it solves, and around the upcoming release of the new site, as the product moves out of beta – a lot of us have given him grief over the existing DNN site, and it should be good to see it get a face lift ;o) - Following that we talked a little about the challenges of round tripping code, and the problems with a lot of the current MDA/MDG implementations, and how ArchAngel can resolve a lot of pain associated with other code generation approaches due to the holistic approach.  It’s a very exciting product and hopefully at some point a screen cast or two will be made to demonstrate the various features / advantages of the product (hint hint).

I again voiced my frustrations with SharePoint – or "swearpoint" as David coined it, I think much of my problem has been around lack of good documentation, and finding the right combination of tools for doing the job i.e. not using VseWSS projects but instead using WSPBuilder, and getting to grips with the various nuances of deployment packages and the SharePoint 12 etc. folder structure – not the mention the diabolical and misleading exceptions you get at some points – I still haven’t found a good approach of TDD’ing that works across event receivers, web parts, controls etc. that doesn't introduce a large ammount of uncessary complications and abstracts just to make the untestable testable – For the next SharePoint project (if I dare touch another one) I'll definitely take the time to develop a better TDD approach, and probably buy a tool like typemock to assist with it.

I brought up the ASP.Net MVC framework – with the latest wave of information coming after the ALT.Net conference where Scott Guthrie did a presentation... and we discussed how it fits in with web forms, and where it leaves Monorail –based on current observations within the monorail community I believe many would consider moving across to the ASP.Net MVC platform based on what has been presented so far, though the approach and architecture is similar enough that there should be opportunities to easily shim view components etc. To work with both MVC frameworks.

After that we had some rambling discussions about Accessibility (including web browsing for the blind, designing accessible forms, x-forms, tables vs. div’s for web forms and how nothing done for local/central government really conforms with their accessibility requirements, or is even tested for accessibility.

Intertwined with that conversation was the rather slow adoption of WPF (I mentioned some of the points brought up in recent panel discussion that was on .Net Rocks!), WPF & Silverlight control suites and the power of filters and binding, also include in that discussion I briefly mentioned that I’d been working on building a web based workflow designer application using the OpenJacob library (the draw2d javascript library to precise) and Monorail with some success, but would like an off-the-shelf WPF or better yet Silver light toolkit to do the same job.

Last of all we discussed Alex James’s proposed question around thoughts on POCO (plain old code/c# objects) and how important it was to us (in association with ORM's / Domain Driven Design, or at least thats what we talked about).

The thoughts were basically:

  • Single inheritance makes non-POCO based Orm’s a pain to work with in some cases, i.e. there’s a loss of control, and accommodating some scenarios such as MarshalByRef become difficult/impossible.
  • Can often make it harder to enforce correct usage of your domain model, such as aggregates.
  • Depending on the ORM, non-POCO objects are harder to test with in a disconnected manor.
On the flip side:

  • Incorporating concepts like current/previous value can be more natural.
  • Performance / ease of development for the ORM can be simplified when not accommodating POCO.
  • You generally need to rely on proxying and virtual methods to make POCO possible, this can introduce additional complexity and small performance hits both on startup and at run-time (not generally that noticeable).
I also took the opportunity to once again mention PostSharp – which I’ve been using to prototype methods for removing a lot of the repetitive or ugly plumbing code that developers often have to write when developing non-POCO entities.

Oh, and sorry about the late write up! .. Things have been a bit crazy lately and I’ve been hard pushed to find the time to post this till now, I’ll do better with the next chat and try and get that writen up in a more timely manor (a 1 to 2 day turn-around).

Last of all – our next chat is Thursday this week - hopefully we can push our numbers back up to 6 or 8 and catch up with some of the other regulars who haven’t been able to make it over the last month and half - and as usual, if you have any topic suggestions, just drop me a comment/email etc. and I'll bring it up at the next chat.
posted @ Sunday, October 28, 2007 4:38:21 AM (New Zealand Daylight Time, UTC+13:00)    Comments [0] | Trackback |
 Wednesday, October 17, 2007
SmallSpider.jpg

Yes - it's that time again, with another Architecture chat tomorrow, 11:30am at the Sylvia Park in Auckland (at Garrisons).

As always, bring along your thoughts and discussions, in the mean time I thought I would list some possible topics for discussion.
  • ASP.Net MVC.
  • ALT.Net.
  • AOP - Policy Injection / Dynamic Proxies / PostSharp etc.
  • Testing  & TDD combined with Products like SharePoint.
  • SharePoint deployment.
  • Source code available for .Net libraries available.
See you all there tomorrow!

 - Alex

posted @ Wednesday, October 17, 2007 2:20:12 AM (New Zealand Daylight Time, UTC+13:00)    Comments [2] | Trackback |
 Thursday, October 11, 2007
Also a couple of quick announcements I forgot to throw in at the bottom of my last post, first off there is a Auckland CBD DNUG meeting next week, second there might be an Ellerslie DNUG meeting in a couple of weeks (unconfirmed) and finally there is the Boot Camp (Code Camp) down in Christchurch on the 3rd and 4th of November, which has plenty of great speakers attending so sign up or pass on the details to anyone you know.

More details below:

ASP.NET Futures – Dynamic Data Controls

Auckland 17/10/2007
Gather at 5:45, starting at 6:00


Presented by Andrew Tokeley

ASP.NET dynamic data controls are part of a powerful, rich new framework that lets you create data driven ASP.NET applications extremely easily.

ASP.NET dynamic data controls do this by automatically discovering data sources at runtime, deriving behaviour and finally creating fully functional ASP.NET pages to interact with your data model. Anything that can be inferred from underlying data schema works with little or no plumbing code. Pages can be further customised to provide for specific behaviours and rendering. The current version of dynamic data controls is fully integrated with LINQ. This talk will be filled with practical demos that showcase the potential of ASP.NET dynamic data controls.

Click Here to Register

Catering: Pizza & Drinks
Door Charge: Free

Venue

Microsoft
Level 5,
22 Viaduct Harbour Avenue,
Auckland

Map of venue



 

A T T E N T I O N   D E V E L O P E R S!

Boot Camp is coming soon.  Arm yourself with the skills required to tackle the imminent invasion of .Net 3.5, C# 3, VB 9, SQL 2008, Windows Server 2008 and more.

Enlist now!

Location

Trimble Navigation, Birmingham Drive, Addington, Christchurch. Map Here

Speakers

Speakers are confirmed and sessions are close to finalised.

  • Chris Auld (Intergen, MVP)
  • Jeremy Boyd (Mindscape, MVP)
  • Darryl Burling (Microsoft)
  • Chris Crowe (Trimble, MVP)
  • Edwin Dando (Clarus)
  • Peter Jones (Intergen, MVP)
  • Bryn Lewis (Clarus)
  • Pat Martin (Microsoft)
  • Nathan Mercer (Microsoft)
  • Ivan Porto-Carrero (Xero)
  • Andrew Tokeley (Intergen)
  • Ivan Towleson (ECN Group)
  • John-Daniel Trask (Mindscape)
  • Evan Williams (HP)

View full speaker details here.

Agenda
We have plenty of sessions chock full of critical information. 

View full session details here. (More coming soon).AND ...

  • Free lunch
  • Spot Prize
  • Competitions
  • Camp Fire Dinner (Saturday night - about $30 each).
  • Lots more!

Enlist now !

posted @ Wednesday, October 10, 2007 7:48:19 PM (New Zealand Daylight Time, UTC+13:00)    Comments [0] | Trackback |

Sorry about the much belated write-up for the last Architecture Chat, been rushed off my feet of late, though a whole week's gone by now ... so the only real excuse could be that I've been a slack bastid.

So, first off... terrible turn out, with only myself and an envoy from Intergen turning up – hopefully not a sign of things to come (small numbers that is, not the intergen guys ;o) and also hopefully not something to put off the Intergen guys from making the trip out this way again (though I suspect Kurt would do it just to get Mexican) - Not to mention Peter losing out on some vital opportunities to introduce Wiki-love to some new comers!

So, as opposed to the usual mixed bag of discussions we focused largely on what tooling and practices Intergen Auckland use (and by comparison myself) – internally it sounds like they have a big drive towards

  • “All sorts of testing”
  • Continuous Integration / Build Servers

So we covered continuous integration (CC.Net) ... make tools i.e. Nant, which has adoption within Intergen, and MSBuild which I use (mostly because I swapped over during the first beta of VS2005, prior to Nant having support for the Framework 2.0, and never moved back) – the key observation was that MSBuild just seems to have very unintuitive syntax – i.e. a Nant build scripts reads a lot more like plain English then a MSBuild equivalent.  I asked if anyone had tried TeamCity, which they had, but without much success (much like my own experience).

Installers were next on the agenda – I’m a big supporter of WiX, though the feeling from some of the guys at Intergen (and I think many people out in the wild) is that getting a WiX installer off the ground was a cumbersome experience, but on the flip side the "setup" project isn’t as friendly when it comes to continuous integration or support concurrent development (merging setup projects, ugh!) – I expressed my views on the fact that WiX is a hell of a lot easier to maintain once it’s in place (i.e. figuring out changes other developers have made), and that making use of tools like Heat that come with WiX can accelerate your development effort quite a lot - Once you have a couple of reference projects with WiX installers it's very easy to rinse and repeat for new projects, or perhaps keep a library of wix templates on a wiki ;o)

Source control cropped up – I use Subversion – From what was mentioned Intergen are using Team System, though TFS does plenty of things SVN does not (Merge history and light-weight labeling appeal to me) - the lack of a good “off line” story still annoyed everyone at the table – maybe once SVN Bridge is half way stable, this won’t be such a problem..?

That lead into issue tracking and bug management – where I generally use Trac, though for some clients I’m migrating to Jira (Trac comes across as "to simple" to clients for some reason, especially to dedicated testers, but I'm still a little puzzled as to why, perhaps they just don't get the "wiki" side of things?)

Mingle also came up in conversation - which is a product I’d never taken a look at – after a quick look around the site it looks pretty cool, especially with the source control aspect, I will definitely need to explore it further, though even something with about 80% of its features as a Trac plug-in would suite my needs ... any readers out there using mingle who can offer an opinion?

I also brought up the news of the framework code being made available - I'm not really sure it registered, or perhaps there just wasn't a need (we've all got so used to using reflector) ... though at the moment I'd rather have the SharePoint source code then the framework (especially considering parts of the sharepoint framework are obfuscated).

Hopefully next week we’ll be back on track for next Thursday with a few of the regulars, or if Thursday is turning into a "bad day" for everyone then perhaps we need to mix it up a little.

See you all there!

posted @ Wednesday, October 10, 2007 7:26:42 PM (New Zealand Daylight Time, UTC+13:00)    Comments [0] | Trackback |
 Wednesday, October 03, 2007
Just a quick announcement.

The Architecture chat is tomorrow, 11:30am at the usual spot... some possible topics for discussion.

  • AOP - Who's doing it day to day, and what tools are available out there for it, partly sparked by my belated look at PostSharp.
  • Sharepoint - yes I'm still on it, and unlike Peter Jones I'm still not loving it all that much (though I don't have the luxuary of MOSS and it's additional features).
  • MonoDevelop is finally in beta - Mono is looking more and more attractive as an alternative, but I'm still unsure I could survive without resharper.
  • Windows 2008 RC is out & Vista SP1 (for select people) - anyone played with them yet?
If anyone else has any topic suggestions then let me know, otherwise it'll just be an open discussion - much like every other time :)

See you there!





posted @ Tuesday, October 02, 2007 7:05:14 PM (New Zealand Daylight Time, UTC+13:00)    Comments [1] | Trackback |
 Tuesday, October 02, 2007
 Ok so I must've been sleeping under a rock or something, so this is no doubt old news to many people - but PostSharp completely slipped by without me noticing it until now... Having played with it tonight, I'm definitely liking it :)

So far I've just used it for doing some AOP... unlike doing AOP using something like Dynamic Proxy / AspectSharp in Castle, PostSharp gives you a more... personal experience... letting you apply AOP to internal or sealed types, and allowing you to declaratively setup aspects with very little effort... as an example I created a simple little class for recording and playing back methods out of sync... so, first off I have a recorder interface:

public interface IRecorder

{

    bool IsPlayback { get; }

    void RecordMethod(MethodInfo method, object[] parameters);

}


Following that I implemented a base class for recording the methods, and allowing for playback:

public class BaseRecorder : IRecorder

{

    private readonly List<RecordedMethod> _methods = new List<RecordedMethod>();

    private bool _isPlayback;

 

    #region IRecorder Members

 

    public void RecordMethod(MethodInfo method, object[] parameters)

    {

        _methods.Add(new RecordedMethod(method, parameters));

    }

 

    public bool IsPlayback

    {

        get { return _isPlayback; }

    }

 

    #endregion

 

    public void Playback()

    {

        try

        {

            _isPlayback = true;

 

            foreach (RecordedMethod method in _methods)

                method.Replay(this);

        }

        finally

        {

            _isPlayback = false;

        }

    }

 

    #region Nested type: RecordedMethod

 

    public class RecordedMethod

    {

        private readonly MethodInfo _method;

        private readonly object[] _parameters;

 

        public RecordedMethod(MethodInfo method, object[] parameters)

        {

            _method = method;

            _parameters = parameters;

        }

 

        public void Replay(object instance)

        {

            _method.Invoke(instance, _parameters);

        }

    }

 

    #endregion

}


Pretty basic - then I wrote myself the aspect - it really could not be simpler:

[Serializable]

public class MethodRecordAttribute : OnMethodInvocationAspect

{

    public override void OnInvocation(MethodInvocationEventArgs eventArgs)

    {

        IRecorder recorder = (IRecorder) eventArgs.Delegate.Target;

        object[] arguments = eventArgs.GetArguments();

        if (recorder.IsPlayback) eventArgs.Delegate.DynamicInvoke(arguments);

        else recorder.RecordMethod(eventArgs.Delegate.Method, arguments);

    }

}


And finally a demo... so I create a recorder class of my very own and decorate it with the attribute created above:

[MethodRecord]

public class MyRecorder : BaseRecorder

{

    public void SayHiTo(string name)

    {

        Console.WriteLine("Hi  {0}", name);

    }

 

    public void AddSomeNumbers(int x, int y)

    {

        Console.WriteLine("{0} + {1} = {2}", x, y, x + y);

    }

}


And now a quick demo:

[TestFixture]

public sealed class TryOutPostSharp

{

    [Test]

    public void RecordAndPlayback()

    {

        MyRecorder recorder = new MyRecorder();

        Console.WriteLine("Starting to record");

        recorder.SayHiTo("Alex");

        recorder.SayHiTo("Renee");

        recorder.SayHiTo("Blog subscribers");

        recorder.AddSomeNumbers(10, 20);

        Console.WriteLine("Starting to replay");

        recorder.Playback();

        Console.WriteLine("All done");

    }

}


The output is:

Starting to record
Starting to replay
Hi  Alex
Hi  Renee
Hi  Blog subscribers
10 + 20 = 30
All done


Which I think is pretty darn sweet, I can definitely see this having a place in my toolbox in the near future - especially when attempting to uphold DRY in some of my code - anyone using it on production projects in NZ at the moment?

So how does PostSharp pull it off?  Well it post-processes the compiled assembly... it does so by hooking in to an existing extension point in msbuild, so that the post-processor is executed for any project where it references the PostSharp.Public assembly.

All this means that you get to see a couple of extra lines in the build output during compilation:

Compile complete -- 0 errors, 0 warnings
PostSharp 1.0 [1.0.7.261] - Copyright (c) Gael Fraiteur and Community, 2005-2007.
TryPostSharp -> C:\dev\experiments\TryPostSharp\TryPostSharp\bin\Debug\TryPostSharp.dll
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

But how does it really work? Well if we take a look at the list of 7 approaches to AOP Ayende did ... then it fits into the last two (Compile-time & Run-time IL Weaving).

If you have been living under a rock like myself I'd definitely suggest talking 10 minutes out of your day to give it a quick try.

posted @ Tuesday, October 02, 2007 10:15:34 AM (New Zealand Daylight Time, UTC+13:00)    Comments [1] | Trackback |
 Friday, September 21, 2007
Quite a good turnout, with well over a table full (I didn’t take an official count, but I’m guessing around 12 or more) including Alex James and Keith (who we hadn’t seen for a while) and two newcomers from Olympic Software, which was great - we always like to see fresh faces and ideas.

I talked very briefly about Castle Project RC3 – I suggested it was a week or two away from getting out the door, but in fact - It’s out as of about an hour ago! (11:30am) - the website and documentation is still in the process of being updated, but the installer and binaries/source are all here.

I was going to run through some of the changes I like in RC3 – but the conversation got steered away before I got warmed up - but it's well worth checking out, if you haven't been keeping an eye on the trunk and the changes that have been going in.

At any rate – this is the culmination of a huge amount of work from many of the Castle contributors, I think it even has a 2 line patch of my own in there somewhere :P ... great work guys!

PLINQ – talked about PLINQ getting closer, and the fact that parallelization is a very hot topic of late, with a few noting that the last MSDN mag was almost entirely focused on this subject.

On a tangent, Erlang cropped, not too many of us have had exposure to the language details, but Keith had done some spelunking and gave us a quick rundown of how it all hangs together, definitely something to keep an eye on - Andrew Peter's even called it his "Language of the year".

I brought up the MediaDefender debacle that’s been unravelling over the last week or so since their huge mail leak.  Not only are the inner workings of this organisation pretty unprofessional and certainly bordering on unethical for a corporation, but it highlights the risk most organisations run – the source of the leak being one employee who automatically forwarded all his work email to a gmail account, who then used the exact same credentials elsewhere.

Keith gave us some insight into LUA, including why it doesn’t make an attractive language to port to .Net, and why it’s so much easier to embed in a C++ based project as opposed to something like Ruby, which just seem to be designed for that purpose, especially with it's "out of the box" set of global variables.

I asked the question “What web load testing apps do you use” – and the answer was generally, we don’t!... I’ve been reviewing WebLOAD – which looks quite good, especially because the load machines can be deployed on a non Microsoft machine, such as Linux, making it easier to span a number of load machines out on something like Amazons elastic cloud (EC2), or low-cost machines without the hassle of O/S licensing.

We then moved onto talking about high-scale load testing, i.e. simulating a million simultaneous requests – somebody suggested that maybe you could hire whoever’s pulling the strings on the Storm BotNet – though I’m not sure they’re into self-promotion ;o)

We talked about social networking applications, and leveraging social networking platforms with API’s such as face book, this has been a popular topic over the last couple of months, including:
  • Finding the killer app(s) that could leverage an API like face book’s, and making money out of it.
  • Bad habits encouraged by these platforms, such as requesting your email account username and password to “email your friends”.
Alex James brought up the great series of posts that Rowan Simpson has been making lately – not everyone knew who Rowan was... so hopefully they should know now ;o) the posts walk through, the Trade me manifesto, and then drills into:
Over lunch we talked about many things, mostly non-IT related, but some things that did come up, including that the Mac OS isn’t going to have a NZ Daylight savings time update before Daylight savings actually kicks in, though it's not really a problem.

Some things that got mentioned which I didn’t quite catch the details of:

  • Metabase (I’m not sure I got the name right – couldn’t find a link, but apparently it’s a game / game development platform, in alpha development at the moment, where all game assets have an associated URL, and maybe an RSS Feed??) – Alex James suggested it might be interesting to combine something like that with a web based data storage platform, such as freebase, developed by Metaweb Tech.
  • Jason K (Knowles?) - who apparently supports the Idea of every user having there own domain, to cement their various web identities together, and where all their data is held by them in one place. – can anyone throw me the correct name and url?



posted @ Friday, September 21, 2007 12:22:34 AM (New Zealand Standard Time, UTC+12:00)    Comments [0] | Trackback |
Search
FeedCount

Tags...