Dominique Stender Good software is only the beginning…

1Jan/100

Thank you all and a Happy New Year

I would like to thank all of you who visited my blog in December 2009 for their interest in what I have to say. Thanks for making the WebDevelopment Dominique Stender a success in such short amount of time. Over 900 human visitors and almost 11,000 page views per month not counting spiders and bots is a solid number for a blog that is less than two months old in my book.

I'm glad you like the topics and ideas I present here. I'll continue to give my very best in 2010 and I promise I have a couple of interesting topics already piled up.

A successful and prosperous year of 2010 to all of you!

Bookmark and Share
29Dec/090

Another reason to upgrade to PHP 5.3

php codeIn case you haven't found any specific reason to switch to PHP 5.3, I have one: Static properties.

Consider the following scenario: You have a group of classes, each responsible for returning a specific statistic. All these classes implement the same API, as given by a common abstract class.

Now, some of these statistics are publicly accessible, others require a certain access control permission to be set.

The logical approach would be to implement a static property to the abstract class, denying access by default. Those classes that are indeed public will overwrite the static property with the correct setting and become accessible.

The property is static to gain speed: There is no need to instantiate the class, if the access control is not satisfied.

Stripped down to the bare essentials the whole set of classes to outline the issue looks like this:

abstract class StatisticBase {
    public static $acl = '0';
} // end: class StatisticBase

class PublicStatistic extends StatisticBase {
    public static $acl = '1';
} // end: class StatisticBase

class AdminStatistic extends StatisticBase {
    // default value for $acl is fine
} // end: class AdminStatistic

AdminStatistic is an implemented class that is private, indicated by the $acl property being 0. PublicStatistic on the other hand is public, hence $acl is 1.

Now before instantiating a specific class we can check whether or not the access condition is satisfied:

if ($user->isAdmin == true || PublicStatistic::$acl == 1) {
    // retrieve admin statistic...
} // end: if

But naturally this is cumbersome as soon as you have more than a handful of statistics - you don't want to add another condition to your if-statement whenever you add a statistic. So the logical solution is a loop:

$statistics = array(
    'PublicStatistic',
    'AdminStatistic'
);

foreach ($statistics as $statClassName) {

    if ($user->acl == 1 || $statClassName::$acl == 0) {
        // retrieve current statistic...
    } // end: if
} // end: foreach

Here PHP 5.2 will fail with a fatal error.

You can't access static class properties by means of using a variable for the classname. PHP 5.3 can. There is no really elegant solution for this. (If you know one, post it in the comments!)

While I'm glad that PHP 5.3 has one more OOP feature covered, It leaves me with the feeling that we still have a long way to go until PHP fully supports object orientation.

Now, if Novel would please release a PHP 5.3 package for SLES 10 and SLES 11... thank you

Bookmark and Share
23Dec/090

Great Indian Developer Summit 2010

Title: Great Indian Developer Summit 2010
Location: Bangalore
Link out: Click here
Description: From the website:
Great Indian Developer Summit is the gold standard for India's software developer ecosystem for gaining exposure to and evaluating new projects, tools, services, platforms, languages, software and standards. Packed with premium knowledge, action plans and advise from been-there-done-it veterans, creators, and visionaries, the 2010 edition of Great Indian Developer Summit features focused sessions, case studies, workshops and power panels that will transform you into a force to reckon with. Featuring 3 co-located conferences: GIDS.NET, GIDS.Web, GIDS.Java and an exclusive day of in-depth tutorials - GIDS.Workshops.

At GIDS, you'll participate in hundreds of sessions encompassing the full range of Microsoft computing, Java, Agile, RIA, Rich Web, open source/standards, languages, frameworks and platforms, practical tutorials that deep dive into technical skill and best practices, inspirational keynote presentations, an Expo Hall featuring dozens of the latest projects and products activities, engaging networking events, and the interact with the best and brightest of speakers from around the world.
Start Date: 2010-04-20
Start Time: 08:00
End Date: 2010-04-23
End Time: 18:00

Bookmark and Share
23Dec/090

The Power of Facebook: A Case Study

In case you or your company are still not convinced of the power of social media sites such as facebook and twitter or you're wondering whether they can give your company a sales boost, read this story on BBC.

In a nutshell a Facebook group formed to put the 17 year old Rage Against The Machine Song "Killing In The Name Of" on top of this years British Christmas Charts.

Here's their official video

YouTube Preview Image

The video itself does not say very much, the information text next to it on the YouTube page itself is much better.

The X-Factor is a Music Chart TV Show much like the "American Idol" or the German "DSDS". In the last years, the winner of the X-Factor show has always been the number one hit for the British christmas charts.

Apparently people have enough of this. Hence they formed the Facebook group to push another song into the charts - Rage Against The Machine with Killing In The Name Of.

You can help their cause by buying a download of the song either on iTunes, Amazon and various other sites.

Currently the song in fact is number one in the British charts.

This is a wakeup call to everyone that is not yet convinced about the potential of social media to drive business. The potential is there. Now it is proven again.

Bookmark and Share
18Dec/090

Web enabled custom fonts with cufón

cufonA frequent issue in web development is the clients wish for individual fonts for this site. This ranges from the understandable desire to maximize the companys corporate image by using the corporate fonts to more or less useless eye candy such as in headlines and menus.

The solution that comes up by reflex is to use graphics, often auto generated. But keep in mind that graphics are meaningless for search engines. Your SEO suffers if you use graphical headlines (the most important bits of information as far as search engines are concerned).

The next solution is flash. Google is able to read flash, so your SEO might suffer not that much. But what about your visitors? Ok, Flash is installed on virtually any PC these days. But not on the iPhone. So do you care about your mobile visitors? I think you should.

Furthermore, I use the NoScript Firefox extension as a security measure to disable JavaScript and many other "dynamic" content such as Flash by default. So I won't see your Flash headlines - all I see is a nasty empty box with the NoScript logo. Don't think I'll enable Flash just to see your headlines. Chances are that I leave your site in favor of another one with similar content, without flash.

Bookmark and Share
10Dec/090

Improved social bookmarks for Wordpress

statisticsI further enhanced the social bookmarking options in this blog by dropping the Tweet This plugin that I mentioned in an earlier post in favor of the wordpress plugin for AddThis. This was done because the CSS sprite hack I did on Tweet This kept bugging me although it worked just fine - I hate hacks. Besides, the many icons don't really make the blog look better.

The AddThis "Social Bookmarking & Sharing Service" provides the possibility to share my blog to virtually all social bookmark services (currently over 200) with a single (!) button and also has an easy option to send links via email. Similar to ShareThis, AddThis provides me with an analytics-like overview of which articles have been shared when and where. Pretty neat. The documentation on AddThis is better than the one for ShareThis though so I went for the former.

Since with removing the Tweet This plugin the "auto-post to Twitter" option is gone I installed WP To Twitter to compensate for that. In fact WP To Twitter has more options than Tweet This, making things even more flexible for me.

If social bookmarking is a concern for you, check out AddThis and WP To Twitter.

Bookmark and Share