Blogs

Gary's Blog

July 2009 - Posts

  • XAF – Project Management Application #2

         

    Well I’m back from my holidays and raring to go, so let’s take a look at our project management application. In the previous post we fleshed out the basic “shape” of the application, safe in the knowledge that we can go back and change it if required. In this post we are going to look at the area of task estimation.

    image

    As you can see from this image (click to enlarge) an Estimate has a name, a summary, an effort in days and – optionally – one or more resources who will have their time allocated to this estimate. You can think of an estimate as being analogous to a user story, a fine grained, fully formed piece of work. Later we’ll look at taking these estimates and adding them as tasks to a “real” project but, for now, let’s work with the Estimate.

    image

    First of all, we need to ensure that an estimate has a name, as we need to identify it later and, of course, an estimate wouldn’t be much use without an effort so we’ll make sure to validate for that using the code below:

    private string _Name;
    [RuleRequiredField("EstimateNameRequired",DefaultContexts.Save)]
    public string Name
    {
        get
        {
            return _Name;
        }
        set
        {
            SetPropertyValue("Name", ref _Name, value);
        }
    }
    private float _EffortInDays;
    [RuleValueComparison(
        "EfforMustBeGreaterThanZero",
        DefaultContexts.Save,
        ValueComparisonType.GreaterThan,0)]
    public float EffortInDays
    {
        get
        {
            return _EffortInDays;
        }
        set
        {
            SetPropertyValue("EffortInDays", ref _EffortInDays, value);
        }
    }

    Assuming you have created some Estimates, as a place to hold some ideas you are having about functionality etc, then there will come a point when you want to add them a Project, so let’s look at that now. Firstly, create a Project and ensure the Estimate tab is selected:

    image

    Now prees the “plus” button to open a list of Estimates:

    image

    Select the one(s) you wish to add to this project and then press the “Okay” button to add those estimates to the Project:

    image

    So now we’ve got our estimates in the Project and we can add tasks to the project too (we’ll look at that in a later post) but wouldn’t it be simpler, if we have estimates, just to create tasks from them? I think so, so let’s look at that now. Firstly, you need to know that there is a one to one relationship between an Estimate and a Task. We have to use special syntax to define this. In the Estimate class, define the task property like so:

    private ProjectTask _Task;
    public ProjectTask Task
    {
        get
        {
            return _Task;
        }
        set
        {
            if (_Task == value)
                return;
    
            // GS - Store a reference to the former Task.
            ProjectTask previousTask = _Task;
            _Task = value;
    
            if (IsLoading) return;
    
            // GS - Remove the Task's reference to this Estimate
            if (previousTask != null && previousTask.Estimate == this)
                previousTask.Estimate = null;
    
            // GS - Tell the Task that I am its Estimate.
            if (_Task != null)
                _Task.Estimate = this;
            OnChanged("Task");
        }
    }

    And inversely in the ProjectTask class define the estimate property like so:

    private Estimate _Estimate;
    public Estimate Estimate
    {
        get
        {
            return _Estimate;
        }
        set
        {
            if (_Estimate == value)
                return;
    
            // GS - Store a reference to the former estimate.
            Estimate previousEstimate = _Estimate;
            _Estimate = value;
    
            if (IsLoading) return;
    
            // GS - Remove an estimate's reference to this task, if it exists.
            if (previousEstimate != null && previousEstimate.Task == this)
                previousEstimate.Task = null;
    
            // GS - Tell the Estimate that I am its Task.
            if (_Estimate != null)
                _Estimate.Task = this;
            OnChanged("Estimate");
    
        }
    }

    The next thing we have to do is to create a controller with a simple action that will enable us to take the selected estimates and generate tasks from them. We only want this action to appear in the nested list of estimates under the project though. To do this set the TargetViewId of the action to be “Project_Estimates_ListView”. This will result in the desired behaviour:

    image

    Having done this, the only thing left for us to do is to write the code in the action’s execute function to create our Task from our Estimate, like so:

    private void CreateTasksFromEstimatesAction_Execute(object sender, SimpleActionExecuteEventArgs e)
    {
        //GS - Create a task from each of the selected estimates
        foreach (Estimate estimate in e.SelectedObjects)
        {
            ProjectTask task = View.ObjectSpace.CreateObject<ProjectTask>();
            task.Estimate = estimate;
            task.Name = "Task auto-created from: " + estimate.Name;
            task.Project = estimate.Project;
            task.Summary = estimate.Summary;
            foreach (ProjectManager.Module.Resource estimateResource in estimate.Resources)
            {
                task.Resources.Add(estimateResource);
            }
        }
        View.ObjectSpace.CommitChanges();
        View.ObjectSpace.Refresh();
    }

    Clicking on the action button then causes our tasks to be generated for us:

    image

    Righty ho; well we’ve covered a lot in this post so I think we all deserve a nice cup of tea and a sticky bun, don’t you? Join me next time when we continue our project management application.

  • Digital Nomad – What’s in your Mobile Toolbox?

         

    The best thing about working from home is that you are at home. The worst thing about working from home is… well…you are at home, and that is especially true during the school holidays. With my wife also working at a school it means the house, which is normally empty and peaceful is suddenly filled with the noise of battle as two teenagers, a pre-teen and a frazzled mother “debate” the important issues of the day; like who’s turn it is to walk the dogs or do the dishes.

    Luckily, because I’m an evangelist, I travel a lot and so I have amassed a collection of good mobile tools, which means that I can work anywhere, allowing me to seek the relative peace and tranquillity of the local Borders bookstore, the library or indeed, downtown Baghdad. Anywhere quieter than here. So I thought in this issue of “Outside the DXperience”, I’d give you a run down of what’s in my mobile toolbox.

    First there’s the netbook, small enough to fit in my handbag, if I had one, but powerful enough to get the job done. I use an Acer Aspire One AOA150-1447 8.9-Inch netbook with 1.6 GHz Intel Atom N270 Processor, 1 GB RAM, 160 GB Hard Drive. I replaced the XP SP3 operating system with Windows 7 RC1 gaining an improvement in performance and battery life. I have also purchased a 7800mAh extended life battery for this machine which gives me 9 – 10 hours of battery life, although I get around a third less if I’m running my mobile broadband dongle.

    Which brings me nicely onto broadband connectivity. You can only work “anywhere” if “anywhere” comes complete with broadband access to the Internet. I have two methods of solving this problem. Firstly, with my iPhone contract with O2 I have access to WI-FI hotspots proved by The Cloud, of which there are 12 in Dundee, so plenty of choice there. If The Cloud fails me then I have a pay as you go mobile dongle with Three.

    Well that’s about it for hardware. Moving on to software; what do I use on my netbook? Well one of the downsides of the netbook form factor is the lack of screen real estate, especially with regard to the start menu. You only have to have a few nested levels of menus before things start to look ugly and usability takes a nose dive. A great little utility to combat this is Launchy. From their web site:

    Launchy is a free windows and linux utility designed to help you forget about your start menu, the icons on your desktop, and even your file manager. Launchy indexes the programs in your start menu and can launch your documents, project files, folders, and bookmarks with just a few keystrokes!

    The 160GB hard drive on the AspireOne is pretty generous, but some netbooks are not so generous, especially if you take the SSD option. To combat this, and for general mobility reasons, I use the PortableApps suite. The suite of stand alone applications installs to a pen drive and allows you to plug and play with your favourite software. Note though that, as of the time of writing, OpenOffice does not support Office 2007 file formats. Of course the PortableApps Suite, although powerful, doesn’t contain everything I need, I still had to install Visual Studio so that I can work with XAF and the other DevExpress products; and of course, where would I be without the my trusty Windows Live Writer for blogging?

    Well that’s about it for this edition and the tour around my mobile toolbox, but if you’ve got a favourite “digital nomad” utility or piece of hardware then don’t forget to share it with the rest of us via the comments!

  • Chrome OS – A new Operating System from Google

         

    What is Google’s Chrome OS?
    I go away on holiday, not turning my back for five minutes, and what happens? Google go and announce a new operating system (Chrome OS). Can I not leave you alone for two minutes? You’re worse than the kids! Seriously though, what is this Chrome OS then? Well, it’s an operating system that will be “initially targeted at netbooks”, but Google hope to roll it out to desktops too. It will be open source, based on the Linux kernel and Google are already working with technology companies (Acer, Adobe, ASUS, Freescale, HP, Lenovo, Qualcomm, Texas Instruments and Toshiba) to ensure that it will be available on netbooks when it ships during the second half of 2010.

    What is the hype around Chrome OS?
    Not surprisingly, such an announcement from Google has created a lot of buzz and hype on the Internet, typical of the response is this from Rob Enderle, President of the Enderle Group

    “This is huge! This is the first time we have a truly competitive OS on the market in years.”

    Well this is clearly hype and doesn’t stand up to scrutiny. Firstly, since Chrome OS doesn’t ship until the second half of 2010 there is no real way to tell at the moment if it, is or is not, going to be competitive (more on this later) but even if it is, it’s hardly “the first time in years” that this has happened. New, niche, distros of Linux are respun on a fairly frequent basis. If they are lucky they get a small but dedicated following but never really go anywhere; and under the hood, Chrome OS is just a Linux respin.

    Is Chrome OS a Microsoft Killer?
    Google’s stated aim with Chrome OS is to challenge Microsoft’s current market dominance. With over 90% of the desktop OS market Microsoft are the obvious target for any company wanting to gain market share. But then there’s the issue Google face straight away, that 90% relates to Microsoft’s share of the desktop OS market, is Chrome OS really going to be able to compete there? Look at the use cases for a PC user (as apposed to a netbook user). Gaming? Nope, can’t do that on Chrome OS. Photo and video editing? Nope, can’t do that out of the box with Chrome OS. Music ripping and creation? Nope, can’t do that out of the box with Chrome OS? You get the idea? On the desktop, Chrome OS in no way competes with the current OSs in the market place.

    So what about Google’s stated initial target for Chrome OS, the netbook? Well, Google does have certain advantages here. Firstly, Chrome OS will be free. I had to smirk when I saw this for the first time. Google aggressively entering a market place by giving away a product that the market leader currently charges a premium for, does that tactic sound at all familiar to you? Secondly, Chrome OS will be targeted specifically at this platform, so the user experience will be much more rewarding than that of a general operating system. Thirdly, there is, umm… well nothing really. That’s it. When you look at it like that Chrome OS doesn’t seem to have that strong a position. For a start the sub-notebook market is small and not one that Microsoft has been that interested in recently, though that may change now of course. As for Google giving away Chrome OS, well I’m sure MS could easily afford to give away a netbook only version of Windows 7. Whether or not they do of course is another story, as that opens up a “whole can of worms”. Giving away an OS sets a precedent and will open MS up to pressure to give away other versions; say Windows 2000 to third world countries for instance. However, giving away a netbook version is a road they could go down, to compete with Google, if the need arose.

    So will Chrome OS rock on the netbook?
    As an evangelist, I’m a bit of a digital nomad, I have and use extensively a Acer AspireOne netbook running Windows 7 RC1, and so I’m the target market for Chrome OS, so let’s see how it will fair with my use cases.

    Firstly, travelling to Leeds to present at a user group meeting. This means a four hour train ride for me and so I want to download the currently unread items from the DevExpress forums, into Thunderbird, so that I can read and answer them during my train journey. When I arrive at the hotel I want to use the wifi there, or my mobile dongle, to connect to the Internet and upload my replies to the forum. Currently I can do this. With Chrome OS I can’t.

    Secondly, travelling to LA to demo XAF and XPO at PDC means an 11 hour plane ride. During that journey I want to write blog posts, read and respond to email, and get up to date with what is happening in the blogosphere. Currently, using a mixture of Outlook, Windows Live Writer and my favourite RSS reader I can do this. With Chrome OS I can’t.

    The pattern here is a simple one. If my netbook runs Chrome OS and I can’t connect to the Net, then what I have is a 300 dollar paperweight.

    What about Chrome OS on the desktop?
    On the desktop the story is even worse. The above holds true, without connectivity the Chrome OS netbook is a brick, but even with connectivity the purely desktop tasks – video editing say – rely on someone creating a service to do that which will run on Google’s servers. Once someone has created such a service you can carry out these tasks, until they do you can’t get your work done. Unless of course you have one of the many desktop OSs already available in the market place for which companies have already written mature applications to carry out these tasks.

    Can we trust Google?
    The biggest issue I think that faces Google in this area, however, is one of trust. At the end of the day Google is not an operating system company, it is an advertising company. If you read the EULA that Google issues that cover anything you upload to their severs (and that includes your work in Google Apps) then you will see it gives them quite a lot of rights over it. Ever sent an email to a friend, in Google Mail, recommending a product, only to see ads for that – or competing products – show up the next time you use Google Mail? Think what it could be like once everyone is sending more and more of their data to the Google cloud. Is this what we really want? At the end of the day, it could be this fact, rather than it’s lack of functionality, that retards it’s uptake amongst netbook owners. I’m interested to know what you guys think though, so please feel free to leave your thoughts in the comments. Right, time to get back to my holiday, where did I put that beer…

  • XAF – Distributed Pair Programming and Fast Prototyping

         

    Using XAF recently reminded me of my Smalltalk days in the early ‘90s, more on why that was at the end of the post, but for now let’s talk about pair programming. You know about pair programming right? It’s a practice in eXtreme Programming whereby two programmers sit at the same keyboard and work on the same programming task. One concentrates on the strategic purpose of the task, the other (normally the ‘driver’) concentrates on the tactical aspects of getting the task done. Working this way, the theory goes, both together can be more productive than two programmers working separately and, to be fair, this is generally true.

    I’ve been involved with agile since back in the mid ‘90s when I worked with DSDM at IBM and I’ve tried most agile practices, some I like and they work for me others, not so much. With paired programming however I’ve always managed to get the sort of productivity gains that have been advertised, I guess I’m just one of those types who works better collaboratively.  There is one area however, where paired programming can be a bit of a PITA and that is if the guy playing the “strategic role” can’t keep his mitts off of the “tactical role”, those are fun days.

    The solution for this, I’ve found, is to pair with a subject matter expert. They have no problem keeping their mind fixed on the strategic goals, as it’s all they know, and they are happy to let you bash away on the keyboard and handle all the “tedious” tactical stuff. Okay, now I know that this is not the way paired programming is supposed to work and I know that doing this will mean that I lose some of the benefits of pairing, but it works for me and it gets the job done; which, at the end of the day, is what the Agile Manifesto is all about, right?

    So, in general, that’s worked well for me in the past, back when I had a proper job cutting code. Now of course, I’m an evangelist for an American company and I work from home on the banks of the Tay in Scotland. How can I pair program now? Well, as it happens, there are tools that will help you do that if distributed paired programming is your thing. I found this out earlier this week when I had a conversation that went something like this…

    Her: This sucks!
    Me: Something in particular, or just everything in general?
    Her: We have this information and it’s all locked up in places I don’t need it to be and that sucks!
    Me: (Knowing what’s coming) Yeah, that certainly sounds sucky.
    Her: What I really need is an app to handle all this…
    Me: (Wincing) Hmmm…
    Her: How long would it take you to work your XAF magic on this problem?
    Me: Longer than I have to spend on it.
    Her: Oh puuuleeeeeeeese! Besides, coding stuff is fun, you know it is.
    Me: (damn she found my week spot) Okay, let’s do it!

    Now as we don’t work together in an office “doing it” is a little more complex than her just moving her chair over to my desk, but there are tools that help. So we got on Skype so we could talk, and we started up SharedView so she could see my desktop and I fired up XAF so we could hack away and in under an hour we had a working prototype of an app that solved her problem.

    So what’s my point? Twofold really, firstly, just because you are not co-located does not mean that you can’t work in an agile manor. Secondly, XAF is a cracking prototyping tool! So if you have XAF, even if you have no intention of using it to build your finished product for whatever reason, don’t forget that you can use it to build a prototype, in real time, whilst you sit down with your subject matter expert.

    A fact, that brings us full circle. Remember I said, at the top of this post, that I’d been reminded of my Smalltalk days when using XAF? Well this is why. One of the first jobs I had as a Smalltalker was in a C++ shop, prototyping work that was to be carried out by the C++ devs? Why? well because with Smalltalk we calculated that I could get code up and running in around a fifth of the time that they could. You can get similar productivity gains by using XAF, so why not check it out?

More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.