Archive for the ‘Software Engineering’ Category

Review: Deep Fried Bytes Podcast

Tuesday, August 12th, 2008
Deep Fried Bytes

Deep Fried Bytes

As previously noted, I’ve been listening to a lot of podcasts recently, here’s my first review

Deep Fried Bytes is an audio talk show with a Southern flavor hosted by technologists and developers Keith Elder and Chris Woodruff. The show discusses a wide range of topics including application development, operating systems and technology in general. Anything is fair game if it plugs into the wall or takes a battery.

The first thing I’ll say about this podcast is that it’s fun! The goofy intro music and southern accents are a breath of fresh air, especially for me being over on this side of the pond.

Woody and Keith never seem short of questions to ask and usually keep their guests engaged, often making them work pretty hard to explain their points. They make a point asking their guests to back track a little, getting them to give their slant on an acronym or buzz word that they have used.

Considering I’m an open source advocate, I’ve been pleasantly surprised to have enjoyed all the .net topics that have come up. While Deep Fried Bytes wants to be a Technology Podcast, as Keith and Woody are both currently .net guys, lots of their discussions and guests are based around Microsoft technologies. I think of the 9 episodes so far, only episode 4 with Joe Stump of Digg fame, has not involved some sort of Microsoft employee or MVP. This may be enough to put some non-Microsoft fans off, but I’d advise against it. Like I said, the shows are very interesting, good fun and might even give someone like me a little insight on what it’s like on the Microsoft side of the fence.

Another thing worth mentioning, the podcasts usually have a sponsor, it currently plays for about 10 seconds part way through the cast, is fairly unobtrusive and isn’t annoying or aggravating.

Conclusion

Definitely worth a subscription, doubt you will be disappointed. 8/10

Popularity: 70% [?]

Review: Gliffy.com

Monday, August 11th, 2008
Gliffy.com

Gliffy.com

I’ve been using gliffy.com for quite some time now and after recently signing up for a company licence, I thought I’d share my thoughts on it. This is far from a complete review, just some of the reasons we’re making good use of it.

Gliffy.com is a free web-based diagram editor. Create and share flowcharts, network diagrams, floorplans, user interface designs and other drawings online.

Firstly, I’ve used many open source tools for drawing diagrams, particularly UML diagrams and they all have their drawbacks. Some of them do particular things really well, but all have ended up not quite cutting the mustard, although some of these projects may have come along way since I’ve used them. To name a few, I’ve used:

Diagram types

UML Shapes

UML Shapes

Next up, what do I need a diagram tool for? Most of the diagrams I draw are very simple. I draw small class diagrams, sequence diagrams, use case diagrams, simple flow charts and the odd network diagram. Gliffy provides a reasonable collection of shapes and icons for all of these diagram types, which you can simply drag and drop on to your canvas. The gliffy examples page includes a class diagram and a network diagram, both showing these predefined shapes.

Collaboration

At my workplace, we need to collaborate on diagrams. We have multiple platforms in use (2 linux, 4 windows), so whatever file format we use must be accessible to all developers. As a desirable, it would be nice if the format was none binary, so we can see the difference between revisions in the subversion repository.

Gliffy Flowchart

Gliffy Flowchart

Gliffy.com provides export to JPEG, PNG and SVG formats. For those not in the know, SVG is a standards based xml format for storing vector graphics. I tried the SVG export and opened the file up in Inkscape and was very impressed with the export. As you would hope, all objects in the diagram were editable, including the text. The actual diagram I exported had an embedded image in, so Gliffy exported the diagram as SVG and included it with the image in a zip file, which also worked great. Another benefit, SVG is an xml format, we can stick the exports in the Subversion repository and diffs work great. One dissapointing part of gliffy, is you can’t upload SVG files to edit, so we have to stick with gliffy itself to make major changes, Inkscape for touch ups etc. This is probably a compatibility issue, the complete SVG specification is probably very difficult to implement.

Gliffy diagram in Inkscape

Gliffy diagram in Inkscape

File formats aside, gliffy provides shared storage for your diagrams, allowing colleagues to work on diagrams created by you. It also stores a revision history for you.

Usability

Gliffy Edit Menu

Gliffy Edit Menu

Gliffy provides the typical editor capabilities, copy, paste, cut, delete and undo, so most people should feel right at home, though I aren’t sure how well the keyboard shortcuts work. I use it with FireFox 3 on Ubuntu and the described shortcuts don’t seem to work.

Aside from that, it’s the regular run of the mill, drag and drop objects where you want them. It feels smooth enough, drop it in something like Prism and you probably wouldn’t be able to tell it’s a web app. One small gripe, if you have joined objects with the connector tool and then move the objects around, sometimes the connector flips it’s angle.

Support

Worth mentioning, we’ve made two support requests and both were dealt with very promptly and efficiently. The first was creating a new billing account for our free trial under a different username and the second was one of my colleagues asking for some diagrams transferring from his personal account to his company one.

Value

At $25 a month for 10 users, Gliffy provides a excellent ROI for our company. For our six developers, Visio Standard would set us back a one off cost of 1079.88 GBP. 1079.88 GBP would buy us gliffy for 10 users, for just over 7 years. It’s cross platform, accessible from anywhere where you have a web browser and an internet connection. Enough said.

Popularity: 69% [?]

Fat Models and the Data Access Layer

Tuesday, June 17th, 2008

There’s been some discussion recently on why active record:

  1. Sucks
  2. Sucks - but not like that;
  3. Doesn’t suck

I like the active record pattern, so I don’t think it sucks, but I do think it’s used a little out of context sometimes.

If you’re building a small lightweight app, then I think using your Data access layer as the M in MVC is a logical thing to do. It’s quick, it’s easy and you can extend either your active record in Rails, or extend your Table DataGateway in the Zend Framework and you wont go far wrong.

As soon as your app gets a little more complex, you might want to start creating custom
models that contain more business logic than simply pulling and pushing to the database. If your application is complex enough, chances are your model will need to interact with more than one database table, if not database, so at this point, like Bill Karwin pointed out, your model should be using the DAL, not being the DAL. Loosening the coupling between model and DAL, should also help with automated testing the business logic, in that mock objects could replace the DAL.

The only problem is, I don’t know the best way to do it.

I’m currently learning the ways of the Zend Framework and would be interested to see how people think the best way to implement this kind of complex model. I’m currently leaning toward something like this. I’ve included a Zend_Form object, to show how the Persons model encapsulates more logic than just pushing to and from the database. I think the biggest benefit of Zend_Form is validating input, which I consider domain logic, so should be part of the model. But I’m not sure the best way to make things easily testable, without pushing into the realms of fancy Dependency Injection and what not, which I’m not all that familiar with.

File: application/models/Persons.php

<?php

class Persons
{
    public function findByEmail($email)
    {
        $table  = self::getTable();
        $select = $table->select()
                        ->where('email = ?', $email);
        return $table->fetchAll($select);
    }

    public static function getTable()
    {
        // add some dependency injection?
        return new Persons_Table();
    }   

    public static function getForm()
    {
        // add some dependency injection?
        return new Persons_Form();
    }

    // ...
}

File: application/models/Persons/Table.php

<?php

class Persons_Table extends Zend_Db_Table
{
    protected $_name = 'persons';

    // ...
}

File: application/models/Persons/Form.php

<?php

class Persons_Form extends Zend_Form
{
    // ...
}

At first it may seem that the Persons model just ends up acting as a proxy to the Persons_Form and Persons_Table, but once you start writing methods that use both together, you’ll start seeing fatter models and thin controllers, which is all good.

This really is a request for comments really, as I’m personally not sure about the best way to go about this. Would be interesting if any of the people using the MVC part of the Zend Framework in the real world go about this?

Popularity: 93% [?]

Software development podcasts

Tuesday, June 3rd, 2008

I recently picked myself up an 8GB Ipod Nano, I spend a fair bit of time walking my little dog Murphy and I’ve found it great for both music and more recently podcasts. So much so, that I quickly got few to the few podcasts I was subscribed to, so went in search of more. I’ve listened to and liked very much:

  • PHP Podcasts rss
  • Stack Overflow rss

The new editions to my list are:

  • Audible Ajax rss
  • Code Sermon rss
  • Google Developer Podcast rss
  • WebDevRadio rss
  • The Web 2.0 Show rss

I’ll pipe back in a couple of weeks and give my thoughts on the new ones.

Popularity: 72% [?]

Being a Lead Developer - Part 3 - The Team

Friday, May 23rd, 2008

This mini-series is focusing on my experiences in my first Lead Developer role. Last time out I talked about the tools and methods I’ve introduced since taking on the role, this post is going to discuss any impact I’ve had on the team.

Laugh and Learn culture

Something I’ve tried to encourage within the team is to laugh at each others expense. This sounds bad, but I’m sure it helps lift morale and in turn we all learn from each others mistakes. It’s not to say that we actively encourage mistakes, but everyone usually finds out when someone’s written a WTF? piece and it may even make it to the wall of shame. I don’t know if this will turn round and bite me in the arse because somebody complains about being bullied, but it seems to be okay so far.

Professionalism

With the new methods and tools we’ve recently introduced, I feel like we’re starting to act like a proper development team and we’re doing less of the gun slinging. I hope this is making people ‘feel’ like they are part of a proper development team, which should improve morale. On the flip side, I’ve been getting everyone to take the piss out of one another, which may be frowned upon, but I don’t think that should be the case in a young industry.

Passion

This is something we particularly lack in the team, the developers get little creative freedom and tend to lack any sort of passion when developing.

“We need the developers thinking about their work when they’re in the shower”

Basically, we’re developing a system that will serve a great purpose for the company, but it’s just not all that fun to develop. I’ve been lucky enough to take on some smaller projects, where I’ve had creative freedom, or I’ve gone ahead and created some projects of my own that have been useful as a learning tool and in the end provided the team with a useful tool. For example I wrote a simple daemon in ruby that watches log files, sending any output in bursts to a jabber chat room. I’m not saying work should be fun all the time, but a little freedom can keep the work force happy and greatly benefit the company

Popularity: 61% [?]

Being a Lead Developer - Part 2 - Software Tools and methods

Monday, May 19th, 2008

This series is based on my experiences as a Lead Developer. The first part covered being a mentor, this part is going to focus on the tools and methods I introduced to the team in the last eight months.

Software tools and methods

A previous post on modern tools pretty much sums up the tools I’ve introduced to our team, the ones listed here are the ones that have been successful. To be honest, this sounds like a big list of buzz terms, tools and methods, but I can testify that these methods have helped improve our development environment.

Automated build, configuration and migration

We wanted a way to get the application up and running fairly swiftly in development environments and also a way of deploying code to testing, staging and production environments. I developed phing scripts to retrieve code from the subversion repository, configure it and then create/update the database. I feel this was successful, the scripts do what we need and as you’ll see lead on to better things.

Continuous Integration

Once we had automated builds in place, it made sense to get some continuous integration going. Initially it was with vanilla CruiseControl, but later switched to phpundercontrol. I consider this a success from the developers point of few, particularly because mistakes made with database schema updates or procedures are quickly highlighted. On the other side, the managers haven’t really embraced having a ‘cutting edge’ version of the application running and have pretty much ignored it. This may because of the dataset the database has, but that could easily be changed.

Unit Testing

This is definitely one of the most effective tools I’ve introduced and our collection of tests is growing. Originally I wrote a few unit tests for my own code using phpunit, but then started to encourage the other developers to have a go. One way in which I achieved this was to introduce the developers to writing tests for very easy classes/methods. We have alot of transfer object classes with various getters/setters, so to get them started I generated skeleton test classes for the value object classes and asked them to fill the gaps, even getting the trainees in on the act. Now everybody understands what the unit tests are for and how to go about writing them and we even uncovered a couple of mistakes in the transfer objects. Hopefully this will encourage the developers to not only write tests, but try to write code that can be tested in this way, along the low coupling, high cohesion track. Again, I see this as being a success with the developers, but will probably find managers questioning it’s usefulness.

Scrums/Stand up meetings

Part of my job requires that I anticipate problems in meeting deadlines on the development plan, to deal with this I introduced daily stand up meetings. Initially people, myself included, found it hard to focus on the three basic questions…

  • What did I do yesterday?
  • What stopped me achieving all I wanted to?
  • What will I be doing today?

… but in the end we started to get going and I think everybody found them moderately useful. This went a little wayward when our little meeting room got taken over for a period of time, but then we started running the scrums in a chat room. Not only did this make it easier for everybody, we didn’t all have to do it at the same time, but it stopped us getting carried away with things and also everything was logged. I can look back through the logs to see what we said at the scrum three Fridays ago etc.

Peer Code Reviews

This was quite a no brainer, it helps spot mistakes or code that’s not quite up to standards. I basically wrote a ruby hook for the subversion repository that emails a random developer asking to run a code review on every fifth commit. I also involved the trainees, so they get to review code the full time developers are writing for the main system, giving them a little insight into the applications codebase. These have been successful and the team confirmed this in a recent meeting.

Scheduling and Estimates

I’ve tried to encourage the developers to generate and provide better estimates for their workload to the managers with mixed success. Despite trying to explain the benefits of using a simple estimating technique, only two developers have taken to it well. I’m happy for the others to generate their own tools and methods for providing estimates, as long as they work.

Popularity: 18% [?]