Vitamin launched today!

I’ve been waiting for this; Vitamin by Carson Systems. It’s branded as “Vitamin is a resource for web designers, developers and entrepreneurs”, and I first heard about it in a podcast a while ago. I was so impressed by their lineup of ‘advisors’, that I actually spammed my own forum telling people to signup, before I really knew what it was all about. ;) That doesn’t happen often.

Anyhow, looks promising and their design is just .. well, pleasing. Makes me want to take some vitamins.

Spot the dinosaur

Microsoft, the dinosaur
Don’t you just love that illustration? I think it says so much. It’s from an article in The Economist about Microsoft and the new threat from emerging Web 2.0 products.I mean, who wants to use the calendar in Outlook, when Google Calendar was just released. In fact, who wants to use Outlook at all, with an online alternative such as GMail? And as for writing documents I, for one, prefer Writely over Word.
Microsoft must feel this wave of free online software competing with their main products – and I think they are trying to keep up. They are doing something with Live, although I’m not quite sure what they’re aiming at. And they recently released Hotmail’s brand new outlookish, webtwoish style. But can the dinosaur compete? With teams such as Flickr, doing incremental development and releasing a new version of their product every week? Microsoft’s product cycles are measured in .. hmm, years? It takes a long time to turn around a dinosaur. So, which marketing genious decided to make commercials that “show office workers as dinosaurs, stuck in a bygone era.”, as Economist so aptly put it? Anyway, just wanted to show you the illustration, that was all :). Happy easter!

PEAR DataObjects vs. Propel vs. EzPDO vs .. Java!

Using an object perstistence layer can be greatly benefitial for any medium to large size project. Or, any project at all some would say. If you don’t know what I’m talking about, I’ll give you a quick example. Usually, in PHP we would do something ugly-bugly like this to retrieve info about a certain item in the database:

$res = mysql_query(“SELECT * FROM article WHERE ID=5”); if($row == mysql_fetch_assoc($res)) { echo $row[“title”]; // do something here }

Compare it to this:

$article = new Article(5); echo $article->getTitle(); // do something here

Ah, the beauty of OO.

My first experience with this was the PEAR DataObject package. I was amazed – it could generate classes based on the tables found in my database automatically, and I could start using them instantly! Yummy!

Lately I’ve been having a look at Propel. You see, I know the Symfony guys chose Propel, and after listening to a podcast with an interview with one of the project leads there, I’m convinced that the guys behind symfony are smart. Smart people choose the best frameworks, so my logic tells me to look at Propel :)

I haven’t tried it yet – but at first glance it looks better than PEAR DO. Why? Well, Propel will generate 4 classes for each table in your database. Overkill you say? Well, read this from the Symfony Model documentation:

Why keep two versions of the data object model, one in model/om/ and another in model/?
You will probably need to add custom methods and attributes to the model objects (think about the ->getName() method that outputs the FirstName and LastName together). But as your project develops, you will also add tables or columns. Whenever you change the schema.xml, you have to make a new call to symfony propel-build-model to generate the object model classes. The Base architecture allows you to keep using the symfony propel-build-model command even after you added custom code to your classes. Here is how it works: the Base classes kept in the model/om/ directory are the ones generated by Propel. You should never modify them since every new build of the model will completely erase these files. But if you need to add custom methods, use the regular object classes of the model/ directory that actually inherit from the previous ones.

Of course, you could just extend the PEAR DataObjects created but it just … well, it just doesn’t seem to be encouraged. I like when a framework encourage me to do stuff The Right Way(TM).

So, Propel it is, I thought – but that was before a co-worker of mine suggested EzPDO which supposedly had a bit of a different approach. They brand themselves as “A simple solution for PHP Object Relational Mapping and Data Persistence” and they seem to be worth a look.

The final solution I’m looking at for solving this issue is using Java combined with PHP. Using the new Zend Platform it’s possible to use Java objects, in PHP code – is that great or what. A little illustration for you, which I found here.

java in php

That way the db stuff can be handled in EJB’s maybe, everything is transferred via SOAP and I can use objects in PHP like I would with Propel etc. It’s all a bit sketchy, but it’s something I’m looking at.

Comments anyone? I’d love to hear some feedback from people who have actually done this ..