garyshort.org


I am a Technical Evangelist for Developer Express, my work blog is here but this one is more fun. :-)

March 2007 Entries

DeveloperDeveloperDeveloper! Day

 The calls for talks for D3 #5 are out, they say...

"Because the event is for the community and by the community we are currently looking for speakers who would like to present. You don't need to have spoken before, but do want to share your experiences and knowledge of .NET with other developers."

So, if you've got something interesting to say, why not give it a go?

Source: DeveloperDeveloperDeveloper! Day

Hey you Scottish Agile Types

 Agile Scotland is hosting a Skypecast, details below...

"On the day - Monday the 16th of April: We will use Skype's skypecast
facility to have a large scale conference call. We'll all dial into
the call at 7:25pm for 7:30pm start. We will then have a series of
"mini presentations" or discussions - each lasting from 1 minute to 15
minutes max. We will end at 9:00pm. Someone will chair the meeting
and have the power to turn peoples mics off and on."

Source: Clarke Ching's

Technorati tags: , ,

Kathy Sierra Recieves Death Threats!!

So, who's Kathy Sierra then, she must be some kind of child killer or something, right? Er, not exactly. She's a marking genius and A list blogger.

Hmm, well the guys sending the death threats etc, must be the usual bunch of wack jobs that surround celebs these days. Again no, they are fellow A list bloggers (Jeneane Sessum, Allen Herrel and Chris Locke)

Scoble's so mad he's going on strike in support of Kathy. I'm not sure that's the answer but the sentiment is right, this is not what the blogsphere is about people, sort it out! Those people involved should appologise and applogise fast.

[Update: 2 April 2007] Kathy and Chris have issued a joint statement and things seemed to have calmed down a lot, thank goodness.

Woah there Scoble!

Robert links to a Scoble show video (see below) with the Smilebox guys. It's a good video and in the first few minutes of the video, Scoble gets to chat with the developers (which is cool). About 7 minutes in though, Scoble asks how often they update the code and (because they are agile) the developer says around every two to three weeks; Scoble replies, saying that fact alone tells him they are not a Microsoft shop.

Well I can tell you that you certainly can be agile and be a Microsoft shop. See netBake for details, an agile SaaS solution built using Visual Studio 2005.

Technorati tags: , , , ,

Well Who’da Thought it…

...'Ol Microsoft have a sense of humour after all. :-)

Technorati tags: , , ,

eXtreme Tayside

The latest meeting of eXtreme Tayside is tonight in the Queen Mother Building at Dundee University Campus. The meeting starts at 7:30pm (I'll be along a little after that) and finishes around 9:00pm, when we all adjourn to a local hostelry. If you're interested in agile software engineering, or Python programming, then come along and join in the fun.

Not Only can he Shout Charge, but he can Take Charge too!

"As you may or may not have read (he’s not as popular as he makes out ;¬) ), it was Gary’s last day at Computa on Friday past. He received a parting gift in the way of a digitial photo frame from the staff."

Source: Michael S. Clark

Okay first off, hell yes I am as popular as I make out! My blog is read by 10s of people every year, and some of them aren't even related to me! :-)

Second, thanks a lot for the digital photo frame guys, it was an awesome gift. I've got it set up in my living room where it looks fantastic.

Thirdly, Michael goes on to thank me for the help he claims I've given him over the years. Hmm, not too sure about that, it's been more of a trip we've taken together from customer requirements at the start, to cracking software delivered at the end. Of course, the fact the software has always worked as the customer has required has been a bit of a bonus, but none the less, it's been a blast.

However, if Michael finds himself a bit stuck, in the days and weeks to come, he might like to try this site. :-)

Technorati tags: , , ,

Paul Oldfield on Doing Agile Right

Check out this article on Agile methods by my one time eXtreme Tayside colleague Paul Oldfield. Where are you now Paul and what are you doing?

"Originally a Botany graduate, Paul moved into computing in the hope that it would offer paid work. In a 18 year IT career he has worked in many roles on many and varied projects, frequently working as an independent consultant allied to Informate International of Brussels. Paul is the expert on domain modeling in UML and contributes strongly to the areas of process dealing with transition from business requirements to system architecture and design."

Source: InfoQ

End of Days

Not in the biblical sense obviously; if it were, you'd probably not be reading about it here. No, it's more of a personal nature. Today is my last day at Computa and on Monday I start a new job as a Senior Developer for Charteris. I've enjoyed my time here and we've done some pretty cool things (like this, this and this), but it's time to move on I reckon. So it's goodbye from me and I wish all the folks at Computa the best for the future.

Design Patterns #2 - The Abstract Factory Pattern

Much like the Factory Pattern, discussed earlier, the Abstract Factory Pattern let's us create concrete objects based on information that we do not know until run time. However, the Abstract Factory pattern let's us group like factory classes together. In the example below we group a factory for creating military vehicles and a factory for creating civilian vehicles together and then we decide what "kind of" vehicles to create based on the information which we will get at run time.

The UML diagram for this pattern looks something like this:-

And below there is an implementation in C#

using System;
using System.Collections.Generic;
using System.Text;

namespace AbstractFactoryPattern
{
    //Create an enum to define whether or not we are at war
    public enum WarStatus
    {
        AtWar,
        NotAtWar
    }

    //Create an enum to define ground type
    public enum GroundType
    {
        OnRoad,
        OffRoad
    }

    //Create Factory hierarchy

    public abstract class VehicleFactory
    {
        public abstract Vehicle GetVehicle(GroundType gt);
    }
    public class MilitaryVehicleFactory : VehicleFactory
    {
        public override Vehicle GetVehicle(GroundType gt)
        {
            Vehicle v = null;
            switch (gt)
            {
                case GroundType.OffRoad :
                    v = new MilitaryTrackedVehicle();
                    break;
                case GroundType.OnRoad :
                    v = new MilitaryWheeledVehicle();
                    break;
            }
            return v;
        } 

    }
    public class CivilianVehicleFactory : VehicleFactory
    {
        public override Vehicle GetVehicle(GroundType gt)
        {
            Vehicle v = null;
            switch (gt)
            {
                case GroundType.OffRoad :
                    v = new CivilianTrackedVehicle();
                    break;
                case GroundType.OnRoad :
                    v = new CivilianWheeledVehicle();
                    break;
            }
            return v;
        }
    }

    //Create Vehicle hierarchy

    public abstract class Vehicle
    {
        public abstract void Drive();
        public abstract void FireWeapon();
    }
    public class CivilianTrackedVehicle : Vehicle
    {
        public override void Drive()
        {
            Console.WriteLine(
                "Civilian vehicle driving off road!");
        }
        public override void FireWeapon()
        {
            Console.WriteLine(
                "Civilian tracked vehicle is unarmed!");
        }
    }
    public class CivilianWheeledVehicle : Vehicle
    {
        public override void Drive()
        {
            Console.WriteLine(
                "Civilian vehicle driving on the road!");
        }
        public override void FireWeapon()
        {
            Console.WriteLine(
                "Civilian wheeled vehicle is unarmed!");
        }
    }
    public class MilitaryTrackedVehicle : Vehicle
    {
        public override void Drive()
        {
            Console.WriteLine(
                "Military vehicle driving off road!");
        }
        public override void FireWeapon()
        {
            Console.WriteLine(
                "Military tracked vehicle firing!");
        }
    }
    public class MilitaryWheeledVehicle : Vehicle
    {
        public override void Drive()
        {
            Console.WriteLine(
                "Military vehicle driving on the road!");
        }
        public override void FireWeapon()
        {
            Console.WriteLine(
                "Military wheeled vehicle firing!");
        }
    }
    
    class Program
    {
        static void Main(string[] args)
        {
            //Test the factories

            //We're at war, let's create vehicles
            MilitaryVehicleFactory mvf = 
                new MilitaryVehicleFactory();
            Vehicle mv1 = 
                mvf.GetVehicle(GroundType.OffRoad);
            Vehicle mv2 = 
                mvf.GetVehicle(GroundType.OnRoad);

            //The war's over, lets create more vehicles
            CivilianVehicleFactory cvf = 
                new CivilianVehicleFactory();
            Vehicle cv1 = 
                cvf.GetVehicle(GroundType.OffRoad);
            Vehicle cv2 = c
            vf.GetVehicle(GroundType.OnRoad);

            //Let's make our vehicles work!
            Vehicle[] vehicles = { mv1, mv2, cv1, cv2 };
            foreach (Vehicle v in vehicles)
            {
                v.Drive();
                v.FireWeapon();
            }
        }
    }
}

The output from this implementation looks like this:-

 
 

What is Twitter, and is there any reason I should care?

It's a kind of social networking site, and is generating huge amounts of buzz among the web's early adopters thanks to a simple conceit. All twitter.com does is ask: "What are you doing?"

Source: Guardian Unlimited Technology

I can't really see the attraction myself, but never one to pass comment on something I don't know anything about (grin); I've set myself up with an account and I'm going to try to keep it updated over the next few days (or until I get bored), to see if I can work out what all the fuss is about. If you guys want to play along, you can check it out at http://www.twitter.com/garyshort.

Technorati tags: , , , , ,

Vista UAC Mac Ad

Sigh, if only this weren't so close to the truth :-)

Hit tip to Daniel for pointing me to the video.

Technorati tags: , , , ,

Wow, if there was a Darwin Award for Employees…

... this guy would get one for sure. :-) 

A Goldman Sachs trader in the UK named “Charlie” was warned by his employer that his visits to Facebook on company time were to stop. He spent, apparently, over 500 hours on Facebook in a six month period. That works out to about 4 hours per day.

Unwisely, perhaps, Charlie posted the warning email on his Facebook account, saying “It’s a measure of how warped I’ve become that, not only am I surprisingly proud of this, but in addition, the first thing I did was to post it here, and that losing my job worries me far less than losing facebook ever could.”

Source: Techcrunch

SEC Suspends Trading of 35 Companies Touted in Spam Email Campaigns

 Now this is the way to deal with spam :-)

"Washington, D.C., March 8, 2007 - The Securities and Exchange Commission this morning suspended trading in the securities of 35 companies that have been the subject of recent and repeated spam email campaigns. The trading suspensions - the most ever aimed at spammed companies - were ordered because of questions regarding the adequacy and accuracy of information about the companies."

Source: SEC

Design Patterns #1 - The Factory Pattern

Design patterns are important in software engineering as they provide a tried and tested method of solving a set of business problems. As my pattern knowledge is a little rusty, I thought I'd take another look at them here; if you want, you guys can come along for the ride.

The first pattern I'm going to look at is the Factory Pattern. This pattern solves the problem of not knowing at compile/design time which "kind of" object will be required at run time as this decision will be based on knowledge not yet known. In other words, the "kind of" object required at run time depends on knowledge the software will only get when it is running.

For example, lets say you turn up at an office with a complaint about their service. Depending on how you conduct yourself you may be directed to a customer service representative or the receptionist may call security. There's no way to know at compile/design time which "object" will be required as the "kind of" object required is dependent on your behaviour.

To solve this problem the pattern proposes a "Factory" object. This object will take a parameter and based on that parameter will decide which object to provide. The class diagram for this pattern looks like this...

A coded example in C# would look something like this... 

namespace ConsoleApplication1
{
    //Create an enum to define customer attitude
    public enum CustomerAttitude
    {
        Good,
        Bad,
        Threatening
    }

    //Define class hierarchy
    public abstract class Employee
    {
        //Define class knowledge
        protected string PayNumber = "";
        protected DateTime StartDate = DateTime.Now;
        protected int Department = 0;

        //Define class bahaviour
        public abstract void Dowork();
    }

    public class CSR : Employee
    {
        //Define class behaviour
        public override void Dowork()
        {
            Console.WriteLine("CSR doing work!");
        }
    }

    public class Security : Employee
    {
        //Define class behaviour
        public override void Dowork()
        {
            Console.WriteLine("Security doing work!");
        }
    }

    public class EmployeeFactory
    {
        //Define class behaviour
        public Employee GetClass(CustomerAttitude ca)
        {
            Employee e = null;

            switch (ca)
            {
                case CustomerAttitude.Good :
                    e = new CSR();
                    break;
                case CustomerAttitude.Bad :
                    e =  new CSR();
                    break;
                case CustomerAttitude.Threatening :
                    e =  new Security();
                    break;
            }

            return e;
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            //Test the employee factory
            EmployeeFactory factory = 
                new EmployeeFactory();
            Employee e1 = 
                factory.GetClass(CustomerAttitude.Good);
            Employee e2 = 
                factory.GetClass(CustomerAttitude.Bad);
            Employee e3 = 
                factory.GetClass(CustomerAttitude.Threatening);

            Employee[] employees = { e1, e2, e3 };
            foreach (Employee e in employees)
            {
                e.Dowork();
            }
        }
    }
}

LINQ and Entity Framework for Data Access

 Wow, does it have to be this complicated?!

"So now you can see why I'm a little cross-eyed. We are working with 6 new query languages (though they are all related),5 new ways of accessing data, trying to keep track of which syntax goes with which access method and which access method returns what type of data. And it is dizzying for sure."

Source: Julie Lerman Blog

Technorati tags: , ,

Sometimes the French can be Really Stupid

I was going to make a comment, but this says it all really...

"The French Constitutional Council has approved a law that criminalizes the filming or broadcasting of acts of violence by people other than professional journalists. The law could lead to the imprisonment of eyewitnesses who film acts of police violence, or operators of Web sites publishing the images, one French civil liberties group warned on Tuesday."

Source: Macworld

Why is it a good idea for "civilians" to be able to film acts of violence? You don't know?! Well just ask Rodney King

RIAA Pushes Through Internet Radio Royalty Rates Designed to Kill Webcasts

"the good old RIAA was hard at work making sure that things were happening in the background. A bunch of folks submitted stories this weekend noting that late Friday (making it less likely to make news), the Copyright Royalty Board announced that it was adopting the royalty rates SoundExchange put forth, and making them effective retroactively to the beginning of 2006 -- meaning that many small independent webcasters are now facing a tremendous royalty bill they're unlikely to be able to afford."

Source: Techdirt:

This move by the RIAA will fail and it will fail because the RIAA (yet again) have fundamentally misunderstood the Internet as a medium. Independent webcasters will not be put out of business by the punitive royalty fees, they will simple "go around" the RIAA by using pod safe music; of which there is a growing collection. This is yet another shot in the foot for the RIAA

SaaS and Meta Data

One of the tenents of SaaS (software as a service) is that the data must be configurable on a customer by customer basis. This is because, although each customer may sell widgets, no two customers will describe their widgets in the same way and so we have to let them define their own widgets. So, how do you do that then? Well, we use the pattern below.

Here, we define a "User" table with the details we need to record, including their expiry date (the date after which they will no longer be able to use the system). Then we create a "Widget" table to hold the information that we believe will be common to all widgets. Next, we create a "WidgetMetaData" table that allows a user to define the fields they will use to describe their own widgets. Lastly, we create a "WidgetExtension" table that that "fills in" the user defined field names for a particular widget. Simple really.

Urgent Wordpress Advisory

If you're currently running the 2.1.1 version of Wordpress (and if you aren't, why not?). Then you need to read and act upon this advisory immediately. Hat tip to Craig for pointing it out to me.

New Skin for NetBake

Michael has provided the NetBake site with a brand new skin; it's very nice and makes it look more like a product site than a development site, as it did when we were developing the product.

Technorati tags: ,

BBC Strikes YouTube Deal

"The BBC has struck a content deal with YouTube, the web's most popular video sharing website, owned by Google."

Source: BBC NEWS | Business | BBC strikes Google-YouTube deal

Check out the said channel here and the BBC's YouTube user profile here.

Falling into the Vista Trap

"Microsoft promises to wow people who are upgrading from Windows XP to its new operating system, but with the joys of Windows Vista comes plenty of pain."

Source: BBC NEWS | Business | Falling into the Vista trap

Read the full article for the gory details, but the long and the short of it is, don't upgrade; if you want Vista, wait six months (until all the driver issues are fixed) then buy a new PC with Vista pre-installed.

Technorati tags: ,

Twitter Updates


    Follow me! :-)
    www.flickr.com
    GaryShort's photos More of GaryShort's photos