Welcome to Delicate template
Header
Just another WordPress site
Header

Why I switched to Doctrine

March 20th, 2008 | Posted by Michaël in ICT | Symfony | Web Development - (5 Comments)

As I said in my previous post, I would tell more about why I switched to Doctrine. I mainly started to think about the idea when I first heared that we were going to start a new project in Symfony at work. The lead developer decided to go for Doctrine ORM instead of Propel. So I wanted to know why go went for Doctrine. I allready knew that Doctrine is way faster then Propel 1.2 and it has more possibilities, but I just wanted to hear it from him. And I have to admit, he had good arguments.

The verbosity of the Doctine code is way better then Propel. The model mappings (in line of XML files or YAML) are bigger for Propel then for Doctrine, and in Doctrine you can do everything in PHP instead of using external files (consolidated code is a huge plus).

The API of Propel is also “time-consuming”. Check the following Propel code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$c = new Criteria();
 
$cton1 = $c->getNewCriterion(AuthorPeer::FIRST_NAME, "Leo");
 
$cton2 = $c->getNewCriterion(AuthorPeer::LAST_NAME,
array("Tolstoy",  "Dostoevsky", "Bakhtin"), Criteria::IN);
 
$cton1->addOr($cton2);
 
// add to Criteria
 
$c->add($cton1);
 
$authors = AuthorPeer::doSelect($c);

with this Doctrine code:

1
2
3
4
5
$authors = $conn->query("
 
FROM Author a WHERE a.first_name = ? OR a.last_name IN ?
 
",array('Leo',array("Tolstoy", "Dostoevsky", "Bakhtin"));

Propel doesn’t support his own query definition language like Doctrine, so every query has to be done through time-consuming API calls (and Doctrine also supports a object oriented API, so it is available if you need it). But it gets a lot more uglier if you when you need associations and eager loading in your queries, what can be run smoothley in Doctrine.

Doctrine supports 3 types of inheritance that you find back in Hibernate, where Propel is only limited in single-table-inheritance. This can be very usefull in the implementation of complex systems.

Doctrine support a sort of mixins (this at the act_as_* plugins of ActiveRecord), in a language that doesn’t support mixins :) . Even think about the “event listeners” like the before_save etc methods in ActiveRecord. (long live Rails right )

Doctine even supports migrations, and in the near future, they even will have automatic migrations (change the model definition, run auto-migrate and the DB is updated).

Some other nice features are full text searching, query/result caching, magic finders ($table->findOneByName), etc.

Doctrine is build in a logical way, the pragmatic use of ActiveRecord mixed with the power of Hibernate.

So be honost, I someone would tell you all the above, wouldn’t you just make the switch immediately?!?

Switching to Doctrine

March 18th, 2008 | Posted by Michaël in ICT | Symfony | Web Development - (0 Comments)

This weekend, I decided to give Doctrine a shot. Since Propel is the default ORM layer, I never really looked at Doctrine before. But reading on the subject got me interested. Luckely their is allready a nice Doctrine plugin available for Symfony, so the switch went smooth, without any problems.

I have to admit, that I was losing my mind in the beginning. I had to get used to the new syntax, and all the new possibilities of Doctrine just blew me away.

I made a backup of a running project developed in Propel (1.2) and just started refactoring the schema and chaning the code. It’s been allmost 5 days, and I wouldn’t go back to Propel at all. Even for the 1.3 version (where people say that it is even faster then Doctrine) . There are plenty of reasons why to stick with or switch to Doctrine, and to be honest, even those slightly speed increases of Propel 1.3 just can’t compete with them.

For those that are still not sure, just check out the Doctrine Documentation. You will find everything you want,  with some nice examples. And for some implementations in Symfony, you can download a Doctrine version of Askeet somewhere on the forum (I know it helped me a bit).

The project is going along nicely. I can’t say mutch yet, but I’ll keep you informed when it is  allmost finished. Their is still a lot of work to do, but I’m getting their, and with the help of Symfony and Doctrine, it just can’t go wrong.

Well, it’s been getting late, and after spending 15 hours behind the computer, I want to spent a few hours before the tv screen to relax.

I’ll explain later in detail what made me switch to Doctrine. In the mean time, let me know what you think about Doctrine or Propel and why you are using that specific ORM.

Longing for the summer

March 1st, 2008 | Posted by Michaël in Blog - (0 Comments)

As a lot of people, I’m looking forward to have a nice summer. Some good weather, and everything seems perfectly in order. Get a nice color, a nice sight in the city of all the nice women ( my girlfriend luckely knows I’m trustworthy ).

But besides a passion for ICT and women (specially my girlfriend, a little bit sucking up to here can’t be harmfull), there is a third thing…beautifull cars. That’s why I bought a ’79 Triump Spitfire 1500 TC last year. The idea came when a friend of mine bought a Spitfire Mk4. When I saw it, I was completly away from the nice design. That’s why I wanted to have one too. So the search began, and I got lucky, only after 3 weeks, I had my own Spitfire.

As a lot of oldtimers, there is still some hard work to do, to get the car in a perfect condition. Especially if you don’t want to spend to mutch money on it. But I like a challenge, and with some knowledge about cars, I started to give my beauty a nice makeover. The first thing I had to do, was reviewing the bodywork. That was in a poor condition. The previous owner had allready done the bodywork a few years ago, but it wasn’t done properly. He had covered the hood with “mastiek” like we call it Dutch. But he covered it with too mutch, and becouse of the heat of the engine, it started to crack. Their where also some places where the paint started to come off + a dend in the passenger door. Below, I have posted some pics so you can see the state it was in when I bought the car.

Triumph Spitfire 1500 Pic 1 Triumph Spitfire Pic 2 Triumph Spitfire Pic 3 Triumph Spitfire Pic 4 Triumph Spitfire Pic 5 Triumph Spitfire Pic 6 Triumph Spitfire Pic 7 Triumph Spitfire Pic 8

As you can all see, the car can realy use a new paint job. The interior has had its best time and the hard top needs to be renewed. Well, only the windows need to be renewed, but I bargained for a new one, so I will allways have this one as a spair, once I redo the windows. I didn’t fix the dend, just bought a second hand Spitfire door :) . Also the chrome needs to be redone and also the plastic bumperstops and grill will be replaced with a chrome one. And offcourse, new rimms. So I started to strip the car and remove the old paint.

Triumph Spitfire Pic 9 Triumph Spitfire Pic 10

I didn’t want to do the paint job myself, so I asked someone to do it for me, since that takes a lot a patient, and I didn’t do something like that before. The car is still in the garage, waiting for its paint job becouse the guy wanted to review the car totaly before starting to paint it. I still have to chose the color. I’m going for red again, but haven’t desided on what kind of red. The only thing I know for sure is that I want 2 white racing stripes going from the front to the back of the car, just to give it a better look.

After the body work, I will start redoing the electricity circuits and interiour. So when I get the car back, I will post some more pics and tell about my progress.

Hope you enjoy the pics, I know it is not mutch at the moment, but it will come ;)

Long live Active Scaffold

February 28th, 2008 | Posted by Michaël in ICT | Ruby On Rails | Web Development - (0 Comments)

Since I started my new job, I had to learn Ruby On Rails in a real quick pace. My employer wanted to step up to the next level with the web applications the company developed. For that, they chose for Ruby On Rails, so offcourse, like I was the new kid in the house, I had to start learning it.

Ruby is a very nice language to code in. It is totaly OO and the application structure and implemented patterns like ActiveRecord and MVC are just to die for. Not that I stop working in PHP (on the contrary, when I start developing in Rails, I simultaniously started learning the PHP Symfony framework).

During my learning proces in Rails, I came in touch with Active Scaffold. A quick way to develop a CRUD interface that adapts itself to your DB schema. So whenever you add an attribute later on to your table, You’re CRUD interface will automatically change.

At the beginning I have to say, I was a bit scepticle. I was still learning Rails (and still am) and the whole Active Scaffold thing was just overwhelming. I found it hard to get things done the way I wanted, just out of ignorence.
But after working with Active Scaffold for 2 months, I have learned its true power. Active Scaffold is just configurable in every way you want.

We have a project running at the moment that is totaly build upon Active Scaffold. Every CRUD functionality is based on Active Scaffold, and believe me, we have done some wacky things with it.

So living with Active Scaffold has been a real treat. I couldn’t work without it anymore. You save a lot of time creating a nice interface (you can easaly edit the CRUD to fit your needs in any way you want). I would suggest it to any Rails developer out there.

Anyone of you ever used Active Scaffold? If not, do it right away and let me know if you like it :) . Even you readers who have used it and probably still do, share your experiance with me, maybe you know some tricks I have not yet hear about.

The Truth

February 25th, 2008 | Posted by Michaël in TV - (0 Comments)

Yes, this is the end. Yesterday I watched the last double episode of The X-Files. It was a nice episode but it ended too soon. Like a lot of people who have seen the end and followed the serie, the ending is great. But it is too open. I know this was the intention the writers, but still I can’t figure out why they stopped after 9 season. Their are still plenty of details that could be explored and built on.

Ok, they know the date when the alien invasion will start, so what? They can still try and stop it and expose the shadow government. Luckily, I can always restart watching the show, but everything is still fresh in my memory, so it will take a few years before I will.

Another downside is that I have nothing interesting to watch anymore. The TV shows that are on at this moment are very weak. Maybe I’ll start wathing Prison Break or Lost again. But I still remember what happend so that won’t be so interesting.

Well, I still can watch Heroes season 2. It will be aired soon, perhaps in a week or two. So I’ll allways have one evening of good tv entertainment.

Any of you readers perhaps know a good show that I good purchase on DVD? Maybe an old show I might have loved and forgot about? Maybe I’ll buy a good anime, like Rurouni Kenshin :)

Cross-browser CSS

February 21st, 2008 | Posted by Michaël in ICT | Web Development - (0 Comments)

A few days ago, I had to finish up a new website. Nothing fancy and all that, just a basic, simple layout website. As usual, I developed the thing only viewing it in Firefox.  I thought it wouldn’t matter that mutch to other browsers since it was pritty basic. So after some nice work, I uploaded everything and let the client know his site was online.

After he must have viewed it, he let me know I forgot to post some pages. I didn’t understand what he was talking about, since I knew thos pages were available. So I mailed him back with some directions how to navigate too that page. He replyed he didn’t know what I was talking about.

And then it struck me. I realized I forgot to view the site first in IE6 en IE7. So I fired up IE6, and found no problem. That was pritty strange, since normally, it is allways IE6 that is b*tching the most with CSS layouts. So then I started IE7. And yes, their it was. I navigationbar has disapeared. For some reason, the navigation block was hidden underneath the the page content.

So I started reviewing my CSS code. Seemed like I have to enlarge my header and use less padding for the navigation bar. A small problem, that’s for sure, but it still took me almost 30minutes to figure out that was the problem.

I know that numeroes forum threads and other blogposts flame about the problem of css incompatibility between browsers. Well, I won’t becouse I don’t see any problem…
95 % of all CSS designs work alike under all none-IE browsers. The only browser that works his own way is IE, so it should be very simple for all internet users. Just kick IE out to the curb. Not only for the sake of those poor webdevelopers, but also to protect you from harm of mallware and virusses.

So do yourself a favor and download a browser like Firefox or Safari. This would make the internet a better place

I’m one of those guys that loves to switch between platform. One time, I just feel the need to use Linux, the other, I just run back to Windows. During those switches, I have experienced both sides through the development process of software and websites. But still I’m not so sure what platform fits my needs.

On Windows, everything is easy to install and configure. Click a few times and you are ready to go. I use some fairly popular developing tools. For PHP developing, I use Zend Studio. To testrun my PHP webapplications, I run WampServer. For Ruby On Rails, I chose Netbeans 6 with InstantRails to run them on. So thing run pritty smoothley.

On Linux on the other hand, you can run into a few problems if you run into missing dependencies. But still, that is easaly solved through yum on Fedora boxes. On linux I pritty mutch use Eclipse PDT for PHP developing and Netbeans for RoR. All those applications are run through a native install of Apache, PHP, MySQL, Mongrel, and RoR.

So it takes more time to get set under Linux. The thing I haven’t thought off is what the system performance is between the two. Windows XP is pritty fast, and with the comming of SP3, performance will increase. Linux is also pritty fast after some finetuning of the kernel. Probably even faster then XP when you finish up configuring your whole box.

So what platform is better? I just can’t choose, and I realy would love to finally stay with one system. There is even a third possiblity. I’m playing with the idea to buy a MacBook Pro. I never worked with a Mac before, but what I have hear of, it is pritty neat. The only thing I’m not sure of is if all the software I need is available on Mac. I like to use free software. I know that Zend isn’t free, but I need it for work, since we develop our webapplication online directly through FTP. And that is something that Eclipse and other development tools miss.

So maybe some of you readers can tell me your experience of the development platform you use, and all the pros and cons.
So don’t hesitate, and please do tell me :)

Since I re-develoment my website, I started to think about search engine rankings and google pagerank. So during the development, I made sure that I had clean HTML, and made proper use of meta tags.

I’m still “developing” as we speak, since I need some strong texts to put on the site, but I can allready see more incoming visitors through Google Analytics. But the thing that is bothering me is the pagerank.

My frontpage has a pagerank of 3, but when I go to other pages, I get a pagerank n/a (not available). Now, having a pagerank 0 would make sence to me, but a n/a is just to weird.

I have read a lot these past days about SEO and pageranks, and I know it is calculated through the number of high quality backlinks, but still that doesn’t explain the n/a status. I rather would expect a 0.

The next thing I would like to achieve is to rank higher in google. Since I have some tuff keywords like webdesign, webapplications and hosting, I know it will be hard to do well, but I can’t seem to find myself in google now when I search on these words.

So rewriting my texts will be the first thing to do, but if anyone of you readers out there know other ways to score better, please do let me know. I’ll be very greatfull.

Update frenzie

February 2nd, 2008 | Posted by Michaël in Games - (0 Comments)

I just bought Burnout: Paradise City, since I have some free time at hand. So once getting back from the store, I fired up my PS3 and wanted to try out the game. But when I started the game, I got a message I needed to update to version 1.1. I was like: “WTF…” .

Luckaly, it didn’t take to long to download and install, but it had me thinking. Since the next generation consoles came out, games and firmware can be easaly updated. And don’t get me wrong, it is a good thing if you ask me, but still, only one week after a game comes out, blam, an update. That’s just a bit off in my opinion. I don’t know what the update is about, but I think it will be bug solver. Good thing you can update right ;) . Well yes and no. Yes, otherwise you would be stuck with a buggy game and no for the fact that thanks to the easy update facilities of the next gen consoles, games get rushed from the developers to the store shelves.

That with the chanse of half finished games that still contain minor (or maybe in the future) big bugs in them. Hopefully, it won’t happen to mutch in the future.

Hello all

January 28th, 2008 | Posted by Michaël in Blog - (0 Comments)

Hi there. Welcome to my first blog post. Since blogs are still popular, I wanted to start my own. I know, I’m a bit late to jump on the blogtrain, but still, better late then never.

I probably had some people foold with the uri, since some of you might think this has something to do with The X-Files of The Lone Gunmen. Sorry, but it hasn’t in a direct way. I’m just starting to watch The X-Files season 9 on DVD, and during the previous seasons, I found that “Lone Gunman” and “The Truth is out there” had some fling ;) .

I know, I’m a big Xfilis in secret. I’m just a sucker for conspiracy theories and little green men.

The thing you might expect on this blog will be a variety of things that I like. From webdevelopment, ICT releated stuff to tv and some hobbies of mine.

So I hope you readers like my posts and please, feel free to comment.

Greetz