ibrow

ibrow blog

archive for the ‘Development’ category

Website Development: Workflow process

Wednesday, August 20th, 2008 by Rob

This morning I was asked by a client to sketch out the work flow process for web development projects. Thought I’d upload it to see if anyone has any opinions on it - note this is just a sketch and not a complete philosophy or anything like that.

The workflow of building a website slightly varies depending on the type of site your building, and who the target audience is for, but the basic elements pretty much remain the same.

1. User requirements (requirement analysis/user story/etc)
This has to be done to find out what the user (customer, client etc) wants from their website, goals of it and what they want to achieve. If you don’t do this stage, then you don’t know what you’re trying to achieve.

2. Information Architecture (IA)
This is probably the most crucial part of the whole process, if this is done wrong, ignored, missed out etc then the rest of the project will be unstructured and won’t achieve the goals/requirements laid out in phase 1.

IA consists of breaking down everything to do with the site: who the target audience is, what the customer wants to say and how the site will say it. It breaks down the content into coherent and cohesive sections that will make sense to the target audience and will allow the site to meet the requirements. If this stage isn’t done then you don’t know what you want to say, how you want to say it, how this is structured, who you’re saying it to or how any of this will achieve any of the goals set.

3. Wireframes
This comes after the IA, and is the process of collating all the elements and the structure discovered in the IA and interpreting them into basic visual representations. The wireframes are all about the structure and flow of the site. As such, no design, graphics or even content (except latin) should be applied to the wireframes unless central to illustrating either the structure or the work flow - e.g. menu items, headings etc. The wireframes will help test the IA and ensure that the user paths through the website work, and meet the defined goals. If not, back to IA.

4. Technical Spec
This usually only applies to heavily dynamic sites that are bespoke built, or larger application. Once the wireframes are signed off and the functionality within them is defined, then this can be mapped out in a document used to start planning the technical aspects of the build.

5. Technical Planning
With the tech spec and wireframes as a reference, the sites functionality can be abstracted down into actual buildable chunks. Database structures planned etc. In a website this is also the place to decide how many templates or template snippets (shared bits of template across 1 or more pages) there are, and what they consist of based on the wireframes.

6 . Design.
The wireframes are interpreted into actual visual concepts, designs chosen, whittled down, blah blah etc etc. (ask Elizabeth about this!)  [Note for blog readers - can you tell I’m not a designer?!]
(can be carried out at same time as 4 & 5)

7. Templating
Once designs have been done, the templates as decided in 5 can be built

8. Build
This can be done at the same time, and in conjunction with 7 as the functionality (from 5) behind the templates can be built whilst the templates are, but the templates need to be complete so they can be integrated with this functionality.

9. Test
Make sure the thing works. Can also doe requirement testing etc

10. Deploy
Once fully tested and stable, release the product (or upload to the live site)

11. Relax and have a holiday
This is one of the most crucial stages of the entire project. Not to be skipped under any circumstance

12. Go to 1

Installing Subversion on CPanel/WHM

Thursday, March 27th, 2008 by Rob

Just a quick tip for those who (like me) have wanted to install the Subversion client on their CPanel/WHM VPS. (I have my repositories hosted with SVNRepository.com so no need for a Subversion server to be set up). I have a couple of VPS servers set up and wanted to install subversion on both. After a bit of Googling I worked out that by simply logging into the command prompt as root and installing Subversion via YUM

# yum install subversion

It should install fine, and on the first of my VPSs (CENTOS Enterprise 4.6 x86_64) it did. Great!

However, on the second VPS, it came up with the error:

Error: Missing Dependency: perl(URI) >= 1.17 is needed by package subversion

This VPS is running CENTOS Enterprise 4.6 i68. Initially I tried to install Perl URI via YUM, using the command yum perl-URI, but it reported that there was nothing to do, so I tried to clean the cache (yum clean all) and try again, but still no luck. The solution was to find a suitable RPM, download and install manually. After a bit of searching, I found a list of RPMS, one of which was suitable for my distro. I installed the RPM, everything went well, so had another go at installing subversion and all worked fine. These are the steps I followed:

# wget ftp://ftp.wavelink.com.tw/pub/Cent4464/CentOS/RPMS/perl-URI-1.30-4.noarch.rpm
# rpm -i perl-URI-1.30-4.noarch.rpm
# yum install subversion

To test I tried

# svn –version
svn, version 1.1.4 (r13838)
compiled Aug 21 2005, 20:56:55
…. etc …..

Which means it’s working!

Hope this helps someone out there.

Top 7 Tips for Successfully Outsourcing Development

Thursday, November 15th, 2007 by Rob

As a self-employed web developer I’ve had numerous experiences over the years outsourcing work to other providers. This is the option I turn to when a relatively “simple” clearly defined project comes in that I’m either too busy to take on myself, or I don’t want to be distracted from a larger, more complex project. I have also hired a number of single outsource developers to work as a “team member” where we both work on the same project together and tackle things in a much more fluid way. Like most experiences, sometimes it’s worked, and other times it hasn’t, also some of the providers have been great, some have been simply awful. This post is about what I have learned from experience.

1. Communication

The number one most important tip I can offer is that you must have a good line of communication with the provider. If you are outsourcing a single project, make sure that it is as fully spec’d as possible, with clearly defined goals and timescales. Also, make sure the provider agrees to the spec and that they fully understand what is entailed. If you are working on a more fluid, lengthier project you must stay in touch with the provider as much as possible. Obviously if you are working in different time zones I’m not suggesting that you should switch to using their clock, but the provider needs to know when you will be on line, how they can contact you if there is a problem/question etc. Instant messaging, email, Skype and wikis are all valid means of communication, each with a specific job, and I strongly suggest that you use as many of these lines of communication as you feel comfortable with, or that the project entails.

  • Instant Messaging
    This is the number one tool for day to day communication. You should always have your Instant messenger fired up and online so if there the provider needs to ask a quick question, they can easily get in touch
  • E-mail
    If a question is too complex for a quick IM, email should be used to outline the problem and also record the decided solution. Email should definitely be used to make statements about the project, timescales, methodology and anything else that needs to have a record kept.
  • Skype (VOIP)
    Sometimes confusion can arise within IM and email. This is especially true if your provider is from another country and does not necessarily speak the same language, or understand the same cultural nuances as you. I can remember with one provider once insulting him over IM because he wasn’t as indoctrinated with the British sarcastic sense of humour as I am. If this is the case, sometimes actually speaking, so the tone of voice can be heard, goes a long way to facilitate communication.
  • Wikis
    I find I’m using wikis more and more when dealing with outsourcing. I find they are invaluable when spec’ing out projects, detailing any changes and also documenting coding guidelines, stating reasons for why the code is as it is. Wikis are also a handy place for the provider to find any links to staging severs, get access to SVN etc. In return the provider can outline the structure of their code and explain why they have done things in a certain way etc.

2. Clearly Defined Expected Outcome

This relates heavily to point 1, but it is absolutely imperative that you have a clearly stated outcome you are working towards, including expected timescales or date of completion. I have found if there aren’t clearly defined expected outcomes, regardless of whether it is a single project, or a “team member” type scenario, the provider doesn’t have anything to aim at. If there is no outcome to aim for none of the functionality will ever get properly written. And, if there is no timescale agreed, there is no urgency to get anything done!

3. Clearly Defined Methodology

As well as having good communication with clearly defined expected outcomes I have found it is imperative to have a clearly defined methodology. This may be as simple as “please email me at the end of the day with a progress report” or be as complex as instructing the provider to always use your online collaboration suite and submitting to the Version Control System for the nightly build. Which methodology you choose to use really depends on how mission critical your project is. Whatever methodology you do use, it is important to define this from day one, as it is very easy to get into a habit, but impossibly hard to break one.

4. Have Good Tools

This is linking in a little bit with point 3. It’s necessary to have good tools with which to implement your chosen methodology. It is also important (critical in fact) that your provider knows how to utilise the tools. One (very irritating) time I noticed that a provider I had just hired promised that he knew all about Subversion, but was downloading, file by file, the entire code base from the browser, and not with an SVN client like TortoiseSVN. Needless to say, he didn’t last long.

These tools should include, in my opinion, at a minimum a version control system and bug tracking software. I am a big fan of Trac but I don’t know if that is just me coming from an Open Source mentality. Also, as I think it is brilliant, I recommend Mantis as a bug tracker if you don’t want to get as complicated as Trac or BugZilla. Damn, that means I also must mention FogBugz, but enough – on to point 5.

5. Treat your Provider with Respect

This isn’t just about being polite, which of course is an absolute must, but is really about trusting your provider to be able to actually work on your project without you having to hold their hand and check up on them every 5 minutes. Yes you should always be there if they need help or have a question, after all they aren’t as up-to-speed on your project as you are in the beginning. However, trusting your provider and treating them with a little programming respect will not be as hard if you heed point 6.

6. Find the right provider for the job

One of my first mistakes when outsourcing work was to just hire the first provider that came along and said they could do the job. Every provider I have since found out says they can do the job, but it really depends how well you want the job done. The more providers I used, the more I realised that getting a provider is really like finding someone to employ. You want to get the right person for the job. Also, a big mistake I made was thinking that a bigger price equals a better provider; this is not always the case. So when you are looking for a provider, ask to look at some example work and some of the code that makes it work. Maybe even give them a little test. You want to make sure you get the right provider after all…

7. Don’t forget, it’s your money

This might seem a stupid point, obviously it’s your money (it may be your client’s money eventually, but you will still have to pay for it first). As it is your money, if you feel unhappy, or are not confident the provider can do what they said they can do, or complete the project, don’t waste your money and your time. There are a hell of a lot of providers out there, you can find someone you are confident with and who can complete the project. When I first started using outsourcers I was often too nice, I helped them out and was very communicative, all good. However, with some of them I realised I was doing more explaining and helping out than the provider was coding. I had to keep on referring them to the coding standards I wanted them to adhere to, or the function spec I had written for them. After a while I twigged that this was costing me money. If the provider cannot do what you are asking, find someone who can. Nevertheless, saying that, if you find a provider that keeps getting it right, doing what you are asking and in the timeframes you’ve requested – hang on to them, they will help your business invaluably!

Rewriting web apps, continued

Wednesday, November 14th, 2007 by Rob

Yesterday I wrote about whether I should rewrite or refactor a website I have now taken over. As this website is the lively hood of my client, and because I have fallen into the trap or rewriting before, I have decided instead to refactor the code piece by piece as and when I encounter it.

I’ve had a further scoot around the web for some different opinions (or matching ones) and came across quite an interesting, if slightly old (2005 - positively ancient! ;) ) article by a guy called Marcus Whitney: Refactor vs Rewrite. Something that struck true with me was:

and immediately began ranting about how the code was crap and needed to be replaced. Well… that attitude is pretty much crap. Obviously the code did SOMETHING for the client prior to my arrival.

I absolutely agree, and this goes along with my conclusion of my earlier post: One of the main reasons I started the rewrite was my pride - I could do better than that, but I was really missing out on the bigger picture: that site is my client’s livelyhood.

Anyway, thanks for the post Marcus, spot on.

Rewriting web apps: pros and cons.

Tuesday, November 13th, 2007 by Rob

I’ve recently been thinking a lot about software rewriting, more specifically rewriting web sites and web apps. The reason for this is that I’m currently working on some code for a client that has transferred me onto their project after getting annoyed with the original developers failing to meet expectations. Without divulging too much, the site I’m working on is a shopping cart application and I was bought on just after launch because of many associated problems with the previous developers.

Now, in my opinion, the code isn’t very good. For starters the output isn’t XHTML compliant using CSS, the display logic is intertwined with the business logic, e.g. there is not template engine (which I’m not a great fan of) functions and patterns are repeated and it isn’t Object Oriented when it seems like an ideal candidate for OOP.

So the dilemma I’m having at the moment is “Should I rewrite from scratch or should I refactor?”

I’m going to let you in on a little secret: I’ve been here before, in a pretty much identical situation, and taking what I’ve learnt from this past experience I’m going to choose to refactor piece by piece. Last time, I chose to rewrite, and this is what happened.

Last time I was asked to make some important additions to an existing code base. However, this codebase was appalling, I could easily do better, I could really make it clean, efficient OO code, reducing the overhead on the server, making the codebase more extensible, producing superb XHTML which can easily be reskinned due to using a template engine produce the output. I just need to plan it out, think about it a bit, seeing how I could incorporate the important additions and rewrite the code and away we go!

Or so I thought.

What I completely forgot about was that I wasn’t re-writing the codebase in a vacuum: this was a live site, which (partly due to the original codebase and partly due to client requests) had to be updated/bug fixed/amended from time to time. Before long I had 2 codebases which both had to be amended to incorporate any new changes submitted by the client. This wasn’t feature creep, this was important changes and bug fixes which had to be done – the manufacture changing product specs, the credit card company being changed etc etc. Very soon I was bogged down by these changes. I spent more time re-planning the new code base to incorporate these changes, and amending the original code base the rewriting wasn’t getting anywhere. The months wore on and I had not released the new site, or made many of the original additions called for at the start of the project. Not surprisingly, the client dropped me. I had become so wrapped up in making the codebase “just utterly fantastic” I lost sight of the bigger picture: This was a real website with real customers and if the new features weren’t implemented the owner would lose business.

What stopped me seeing this was pride. I was far better than the other guys, I could write better, faster, more extendible code – but of course, this isn’t always true and better code isn’t always a better business decision.

I’ve been reading a lot into this at the moment, and I wish I had stumbled across these blogs before I started rewriting the project above.

Kevin Barnes “To rewrite or to not rewrite, that is the question” (ironically what I was going to call my article!) http://codecraft.info/index.php/archives/69/

Chad Fowler “The Big Rewrite” http://chadfowler.com/2006/12/27/the-big-rewrite

And of course:

Joel Spolsky “Things You Should Never Do, Part 1” http://www.joelonsoftware.com/articles/fog0000000069.html

Thinking about the situation I found myself in with the possibility to rewrite, I had these thoughts in mind:

  1. Is the project mission critical? If the rewrite takes longer than expected, will your client suffer? If they will, think carefully about rewriting
  2. Is the project fluid? I.E. will you have to make changes to the live site which will need to be included into the rewrite? If so be prepared to work on two code bases at the same time?
  3. Will you be able to devote a substantial amount of your time and brain power to the rewrite? This sort of works with point 2. If you either can’t support two code bases at the same time, or you won’t be able to spend the majority of the time on the rewrite then strongly consider not rewriting.
  4. Why are you doing the rewrite? Is it genuinely to improve the code, or is it because you simply think you can do it better? If the latter, or the latter is the majority reason for the rewrite, strongly reconsider the rewrite

All of these pointed me to rejecting my rewrite plan. So, this time, my plan will be different. This time I’m not going to ditch the old code base (even though I really want to). This time I’m going to do it bit by bit. Improving each area that I have to fix a bug for, or make an addition. I’m going to refactor slowly, but carefully.

And most importantly I’ll be keeping in mind the real reason I’m doing this: this site is my client’s lively hood, not my plaything.

Open Source Licence for Web Apps

Monday, October 22nd, 2007 by Rob

I am in a bit of a quandary, and hopefully someone out there has the answer.

I have an idea for a little web app. It’s not an amazing idea, nothing new or ground breaking, and there are already several products out there that do almost what I want. But not quite. Which is why I’m contemplating building it myself. When built this app will certainly fill a hole for my business, and I should think a couple of my clients. My idea is to eventually host this web app for others to use, charging a small amount of subscription.

So far so good, but the idea itself isn’t the quandary, it’s the licence.

As stated there is nothing new or ground breaking in this actual project, which is why I am thinking of adopting an Open Source licence. My reasoning for this is simply that once finished, and if I decide to turn it into a hosted web app, pretty much anyone would be able to subscribe, see it’s features and within a couple of weeks have a clone. As this is the case, why not open it out to begin with? By opening it up, everyone can benefit from the code, and the only competition (I can imagine) will be who has the better service (daily backups, customer support etc), which in my opinion is the most important thing as far as a web app goes.

But here comes the stumbling block. Which Open Source licence allows for this sort of usage? After doing a lot of searching and reading, I’m still not entirely sure.

Here’s my check point list of things that I need to cover:

  • People can easily clone it, so why not allow them to use the same code base so all can benefit
  • Product will be run as a hosted web app and a small monthly subscription may be charged to use the service
  • I do not want to sell the code, but I may want to sell "installations" (e.g. someone pays me and I install the thing on there in house servers)
  • Include the ability to use existing (Open Source) code to enhance the product
  • Hopefully provide something of value to a community that has greatly benefited me over the years

What I certainly do not want to do, nor be accused of is to Open Source my project as a marketing gimmick or to get free (as in beer) labour from the Open Source community which I then sell on and take all the profit. The Open Source community has been hugely beneficial to me over the past decade, and at last I’m in a position that I can hopefully provide something of use back.

Many thanks for your time, and I’m looking forward to any replies

Sites and pages that have been useful

PhpClasses: ReallySimpleContentCaching

Saturday, October 13th, 2007 by Rob

How very exciting. My ReallySimpleContentCache class has just been approved for PhpClasses.Org

You can see the ReallySimpleContentCache class page here, and also the trackback url is here

One day when I have time I’ll write up a little tutorial for this, but not today - England play France!

On the Web at Ajax Flakes

Monday, October 8th, 2007 by Rob

During the usual browsing that happens when looking for ajax/javascript/php/development/etc/etc/etc stuff, I came across this article:

Open source social platforms available today: 10 of the greatest

Seemed like a pretty interesting list and Ajax Flakes looks like a site worth watching.

One day, when I find the time I’d love to help out with a few open source projects, and these look like a good a place to start as any. Who knows, I might make Qwango open source one day?? Also when I have the time, I might do a quick "why I love open source" post. But this seems to be in the realms of fantasy right now. Oh well

Really Simple Content Caching (PHP)

Tuesday, October 2nd, 2007 by Rob

I have built a (as the title suggests) really simple content caching class in PHP. I had a particular itch I wished to scratch today, and the ReallySimpleContentCaching class is the result.

I am currently working on a project that has a Flash front end that communicates with PHP in the backend via XML. Based on what is passed in the XML, PHP goes off interrogates a database, generated an XML reply. The building of this XML reply can be quite complicated and make a lot of DB calls. Also, it might be high load and therefore impact on performance.

The solution is caching.

There are a lot of caching methods out there, Smarty has excellent built in caching, and there is PHP Output Buffering. But my needs were to small to warrant Smarty and I was not caching the output, So I built my own little class.

You can see an example of it in action here. Note: This is a very boring page!

You can also download the source code for the ReallySimpleContentCaching class and associated files here (zip file).

I have tried to include as much commenting as possible so you can see what I did. (As ever) I will try to get around to writing a brief tutorial on this if I have time.

But otherwise, download, play with it, improve it and enjoy.

Nifty Monthly Calendar Class

Wednesday, September 26th, 2007 by Rob

Recently I had to build a monthly calendar that could be outputted via a templating engine (notably Smarty). I had a brief look around the web, but couldn’t find anything that was light weight and could be used via a templating engine. So I decided to build my own.

I have created a demo for you to have a look at, which you can find here and you can also download a zip file of the source.

What I tried to do as much as possible with this class is to keep all the complex processing out of the template engine. As such I have created a class which collates an array of "Days". Each of these "Days" not only have information on the day, but also instruction to the template, eg "I am at the end of the week" etc, so a new week (eg row of table cells) can be started. No processing going on in the template, just a quick call along the lines of  "if start of week then start new row"

Play with, download and enjoy, and if I have time I’ll write up a tutorial!
 

ibrow.com


tel: 020 7183 2328