Product Development in Brisbane

Archive for the ‘Development’ Category

Drupal First Impressions

Tuesday, January 1st, 2008

As I recently posted, I’ve been using wordpress everywhere currently. It is simple and easy to use. I am, however, always prepared to learn new things, and use the appropriate tools for a job. So, after hearing drupal come up as an open source CMS at the CMPros summit in Boston, I figured that I’d try it out.

The basic install process was pretty straight forward. Download and untar the install available from drupal.org. I created the user for the database on my mysql instance, and followed the simple install guide to get it up and running, which finished with me having created an admin account and logging in as admin.

After completing the basic install, it was relatively easy to go and create content. The front page includes a create content link available, making it easy to create stories and static pages. I could go in and do this quickly, and get some nice rapid gratification by creating content. Unfortunately the urls were kinda ugly and drupalish. I wasn’t happy, figured that someone had to have come up with a way to do nice urls. I started with a quick look at the admins screen, and almost ran away after seeing the huge number of options.

Drupal Admin Screens

Google came to the rescue, and I downloaded the pathauto tool, and started reading documentation. Getting the friendly urls definately isn’t as easy as in wordpress. I had to go in and edit the .htaccess and set the path option:  RewriteBase /~rob/drupal-5.3

Installing a module is pretty straight forward, and simply consists of copying it into the modules directory. It is then enabled through the gui, using: Administer>Modules. When I did this for pathauto I noticed dependancies on the path, and token modules, which needed to be resolved before pathauto could be run.

As token wasn’t installed by default I had to pause my installation of pathauto. So I was left with exploring path, and the rest of drupal. Path actually works ok. It makes it easy to specify friendly urls for your pages and stories, via a simple text field.

Pathauto works pretty well to. After getting it installed (just unpackaging the tars for pathauto and node into the modules directory) I was easily able to update the configuration to ensure friednly paths are created. Functionally this ends up making the urls work as well as wordpress. The admin interface also provides heaps of additional options (which I didn’t really need).

I’ve started putting together a proof-of-concept module for EditLive! as well. After some input from the legendary support engineer (Suneth), we got this working.

Overall drupal seems to be much more powerful that wordpress. Like wordpress has a rich module system, allowing people to customise and enrich their installation. It is a good enough system, and while I don’t plan on replacing my wordpress installations with it, I can see that it may be useful for bigger sites.

Howto Keep Version History in a Single Table Using Hibernate

Friday, December 7th, 2007

 

Problem:

Keeping a history of data in a single table in hibernate, where all versions are treated as first class objects.

That is to say that every record in the database will be immutable. New records will be created with a new version number, but the old versions will never change. They are kept as the history of changes.

Solution:

When querying objects from hibernate ensure that they are initialised, and then detach them from the session:

Hibernate.initialize(result);
session.evict(result);

Then when saving the objects, ensure that the ID is null, and call thesession.save(businessObject) to save them.

//set the id to null to ensure that a new record is stored in the database.
businessObject.setId(null);
incrementVersion(businessObject);
session.save(businessObject);

The final part of the puzzle is to ensure that the class has it’s persistence properties set correctly, either by setting the annotations or configuring the xml file.

The important settings are:

  1. To help prevent updates, and improve performance set the mutable attribute on the class to false.
  2. The collection objects on the class have the lazy attribute set to false (ensuring that they are loaded when the object is retrieved, and the evicted object will work).

Following these steps will provide you with a versioned business object. It will be possible to retrive, and store the object to the database using the Hibernate search functionality.

Wordpress Everywhere

Monday, November 26th, 2007

Wordpress is a great product1, and I’m really liking it a lot, using it pretty much for most small sites that I am working on. The current list includes:

  1. This blog.
  2. My church website (Bayside Baptist)
  3. My hobby website.

I’ve been using WordPress because it has the following key features in its favour:

  1. Simple to use.
  2. A great community, providing plugins, themes, and hooks to lots of web 2.0 goodness. See wordpress.org.
  3. A rich interface, and doesn’t try and limit content creators too much.
  4. It has grown to be a nice lightweight CMS, not just a blogging platform, including support for pages (non-date based content) and posts (date based blog entries).
  5. Nice simple friendly URL support. Easily settable through the admin interface (using apache mod_rewrite, giving guidelines for how to do it).
  6. Simple HTML based back-end. My content isn’t locked away. If I decide I want to move it won’t be too hard (wordpress is actually the third different blog engine that I’ve used—I started with Movable Type, had a brief stint with typo 2 before ending up with wordpress).
  7. AJ uses it and has developed an EditLive! plugin, which means I get to use the most familiar WYSIWYG that I know :).
  8. php based, making it easy to deploy anywhere in a language that is well known and easy for people to edit and write.

Overall wordpress is a great little product that makes for a good starting point for a website.

1 - Ironically I'm posting this while sitting in the middle of a CMPros conference. I've had this sitting as a draft for about 9 months, and the time to post has come.

2 - while going through a heavy ruby on rails stage, and trying to use it everywhere.

Todays Cool Keyboard Shortcut In IntelliJ…

Wednesday, October 24th, 2007

..is cmd-opt-F7 (in Mac)

CMD OPT-F7 displays a list of  usages of the currently item (var/method) throughout the project, listing them in a nice inline dropdown list.  This is great for navigating around the usages of a method finding how they are used in context, before applying an aggressive refactoring.  I discovered the short cut recently while performing one of the other find usages options in Intellij (cmd-F7) and getting fat fingered and hitting CMD-OPT F7.

An AJAX Iteration

Friday, September 21st, 2007

I'm currently unwinding after only just managing to see all the cards1 move from the "this iteration" column2 to the "done" column3 on our XP storyboard.  While the estimates had us coming in at the same spot as earlier iterations, it ended up being quite a bit tighter than the earlier ones had been.  

There are a few reasons why, but the biggest cause would be the fact that we were moving from the comfortable world of Java actions into world of some heavy ajax ui.  I spent some time working with libraries and researching how to do things like JSON in Java, and AJAX popups.  It was a fun and stretching iteration, with plenty of prettiness to show for the work.

I learnt a lot including:

 AJAX with Prototype is great.  Prototype provides all the methods you want in the library.  I would consistently find the methods I would want in the library such as $('id') (to find an element with an id), and the serialize methods for forms are really nice. Kudos to the prototype team for a great library.

Scriptaculous provides nice effects that build on prototype.  The Autocompleter is worth the price of admission.

The popup library by Stuart Rackham works really nicely.  He doesn't have access to Safari so hasn't tested it there, but now I have, and while not all the features work, it is possible to produce nice popups that work in Safari with this library.  He has built this on top of Scriptaculous and prototype and he has done a great job.

JSON for passing around data is cool.  The whole eval on the client thing is a bit scary, but (almost as I expect now) at least prototype provides a nice evalJSON method to help alleviate a little my security paranoia. Of the millions of JSON libraries available, the standard java one works ok. (what's not to like about a library with a license that includes the text "The Software shall be used for Good, not Evil."  Mightier JSON libraries exist that do all kinds of magic, but the simple approach is working to start us off.

 

The biggest missing piece in my JavaScript Development is the fact that it isn't TDD. There seem to be bits and pieces out there, but nothing that is jumping out and saying "use me I just work.". The main reasons I am wanting to do Test Driven Javascript are for quality and pleasure. Doug spent some time researching options for acceptance testing of E2 front to back (including the javascript), which will definately help out the quality, but it still would be great to have a viable TDD option.

I never would have expected to say this, but it has been fun doing the JavaScript and AJAX in the past iteration. It really is much better than in the past, and I can see it only getting better.

1 - The card contains a unit of work

2 - The list of cards we are planning on getting done in the iteration, but haven't started working on yet

3 - The list of things we have finished this iteration.

Lean Software Development

Thursday, July 12th, 2007

“Every line of code costs money to write and more money to support. It is better for the developers to be surfing than writing code that won't be needed. If they write code that ultimately is not used, I will be paying for that code for the life of the system, which is typically longer than my professional life. If they went surfing, they would have fun, and I would have a less expensive system and fewer headaches to maintain.” Jeff Sutherland, CTO PatientKeeper

The quote above is a fun (if slightly confronting) way of thinking around the idea that Software Development is all about delivering value to customers.  The premise is that there is a long lasting cost to any line of code that is added to a software system.  The cost is much greater than the initial development cost, so making sure that the right features are added is key.  The implication is that the team (including the customer) needs to be sure that adding code (including complexity and future maintenance) does add enough value to justify the long term cost (the maintenance cost will be much higher than the initial development).

The term "Agile Software Development" is getting a little bit old hat.  All the cool kids are talking about Lean development, as described by the Poppendiecks. The Lean Software Development principles are taken from domains such as Lean Manufacturing, especially as seen in Toyota, and initially introduced byWilliam Edwards Deming (Jason Yip links to YouTube videos introducing the ideas). The book Lean Thinking also has been recommended as a good introduction to the topic.

I have been hearing Doug talk about the idea, but haven't had much exposure before attending a NetObjectives Webinar on the topic. The principles (as articulated by the Poppendiecks) are:

  • Eliminate Waste,
  • Focus on Learning,
  • Build Quality In,
  • Defer Commitment,
  • Deliver Fast,
  • Respect People, and
  • Optimize the Whole.

The most valuable thought for me was the idea of optimizing the whole.  That is to ensure that the whole process is considered when performing process optimizations, and care is taken to avoid making localized optimizations that end up actually hindering the effectiveness of the process.  Lean Development is a very interesting and useful looking way of working.    It is well worth looking at the references listed above, and learning more.

Example of a Good Open Source Project Website

Wednesday, June 13th, 2007

Open Source projects are known for dodgy websites, and rubbish documentation. I was overjoyed to see a project that got it right (URL Rewrite Filter). There are a number of things that I really appreciated with this site, and in the hope that people might take notice, I’m going to list the good bits here.

The landing home page has a nice concise description of what the project is all about. When I get to the front page, I can read the overview of the project, and get an understanding of what problems it was created for, and the goals of it. The front page told me enough to want to see more, but didn’t overwhelm me. I got a good feeling from the front page.

The other nice thing about the front page is the navigation structure. The side navigation bar provides the links which I am most interested in. One click to get to a download link (which has a direct link to the files). One click to the source code page (with instructions on svn access via http and the commandline). One click to the documentation. One click to get to the community support.

The documentation is excellent, and provides a good baseline for what documentation of a project this size should look like.

There are good examples of what the configuration file looks like, annotated in a way that makes it easy to understand what the code is there for.

The documentation provides a good reference for how to do the configuration.

It is a great site and provides a good example of what most open source project websites should look like.

Pretty URLs for any J2EE framework

Wednesday, June 13th, 2007

Making the browser location work like a command prompt is a good goal for any web application, and is possible for any J2EE web framework, even Struts 1.

To do this, having Rails style friendly urls is required. Traditionally J2EE frameworks and applications have not done a good job of providing friendly urls. It is easy to wander around the net and guess at what framework people used by the urls (e.g. anything .do is probably struts, .action’s are probably webwork etc.)

Of course one doesn’t have to be tied to this world. Pretty much anything is possible with Apache and mod-rewrite. This is handy when you are behind Apache, but that isn’t always the case. From time-to-time you may want to dot his completely within your J2EE application, making it independant of where you are running. The Servlet spec is powerful enough to make this possible, but for the lazy (like me) it is nice to know that someone has already done the hard work. The URL Rewrite library provides a filter which does the heavy lifting for you. There is a simple XML configuration file, which provides a rich language for customising your redirects using the Java Regex library, or a familiar directory traversal wildcard style syntax.

The library makes it possible to easily map urls like: products/1 to products.do?productId=1 or from: /australia/queensland/brisbane to: worldMap.jspa?country=australia&state=queensland&city=brisbane. There is a rich syntax for specifying the url rewrite conditions, as described in the comprehensive manual, and shown in the samples.

Advice to an XP Customer

Thursday, June 7th, 2007

I have been working hard at developing an understanding of what it means to be a product manager how to do this.  A part of the role has been to step in as an XP customer.  Recently I had a great IM conversation with Dan North about what the role is all about, and how to best do the job.  Dan was my XP coach when I was working on a project in London, is the father of BDD, one of the lead developers behind JBehave, and RBehave and an all round great guy.

Here are some of the highlights of what Dan had to say:

Focus on your outcomes.

Work out what it is you want to achieve, and how much you think that's worth.

Everything else is detail. If the project goes "over budget", it just means you didn't predict the future. As long as you're within your comfort zone for the benefit you're going to get then you're still ok.

Likewise the feature list is just detail as long as you and the development team are on the same page

The most useful thing you can do is inspire the developers with your vision.  Ideally find a way of sharing any success, so they feel vested in the outcome

Try to stay focused on the "what". As a techie, you will be really tempted to get involved in the "how",but you have to trust the team to do the right thing. Once you let go of the technical detail you can really get into "character" as a product manager!

Good Management

Sunday, June 3rd, 2007

Warning: if you are looking for an angry rant you won't find it here, instead this is a article about a truly good manager.

Like most people who have been in IT for as long as me, I’ve worked with some pretty dodgy management over the years. There have been times where I was sure Scott Adams was sitting in my cube farm, stealing ideas for dilbert.

I came to Ephox knowing that this wouldn’t be the case. I came knowing that I was going to be working for a good manager, Brett. Brett takes management, leadership and people seriously, as you can see in his recent blog post about a leadership course he is attending. Here he talks about what he has been learning about management and leadership, and how much he already understands and implements. You may read it, and think that he is perhaps self-deluded, but as someone who has been working for Brett, I can vouch for the fact that this isn't the case. Brett really does get people management. He understands the importance of putting people over process, and it makes a huge difference. It is his valuing of people that played a key part of my wanting to come to Ephox in the first place, and makes being a part of his team great.

Another thing that Brett does well is keeping commitments. In a recent InfoQ article on agile, there was the quote: ”…one of the quickest ways to take the wind out of a person’s sails is to break a commitment…”

I can’t think of a single commitment that Brett hasn't worked really hard to keep. He does well at making the right commitments, and sticking by them. One real instance of this that really sticks out in my mind was when I was nearing the end of my time in support. I could see that there might be value in me holding off transitioning (and I was willing to do so), but Brett stuck with his word, and made sure that I was able to transfer to development. It was great that Brett put in the work to ensure that this happened, and this commitment help keep my motivation high.

Brett spent time working on his management skills, and I really think this investment has paid off. Brett does really well at leading his team of developers, and creating an environment where we want to be. Having a good engineering manager is going to be a key part of helping Ephox to grow, enabling us to hire and keep good engineers.