Archive

Archive for June, 2009

Method Overloading Workaround in PHP5

June 25th, 2009
Comments Off

This past week I had the need to use overloaded methods in PHP 5. Overloading a method in object oriented design is especially helpful when trying to achieve the same operation while the code needs to be triggered from different states of the application or even different locations of the application. In my case, I needed an overloaded constructor to a PHP class. Yes, constructors are also a bit different in PHP 5 but still workable.

overload_cargo

To make a long story short, in PHP 5 there is no real way to overload a method like you can with Java. However, it seems like the developers of PHP 5 did have overloading methods in mind and allowed some form of it. It seems like allowing a real method overloads in PHP would be a special case of what the core developers actually allowed to do. The reason behind the current syntax is beyound me. I even tried to look for a PHP roadmap and see if proper method overloading will be introduced in the future but I could not find anything relevant.

A user with the name Noel has posted on DZone a little snippet of code that shows exactly how method overloading in PHP5 can be achieved.

Do you know of any intentions on including real method overloading in PHP6?

PHP/MySQL, Web Development , ,

The Case for ZenCart: Supporting the Long Tail of eCommerce

June 18th, 2009

While Zen-Cart is one of the best open source ecommerce platforms it has plenty of deficiencies, however I recently understood that it will always be able to keep its niche and therefore always have a market.  Of-course this will remain the case as long as its leaders remain true to its spirit.

the_long_tail_of_open_source_ecommerce_platforms

Zen-Cart is an unwilling offspring of the popular osCommerce. Like all offsprings, it is an improved version of its predecessor with better templating system, class oriented design, and notification systems but still maintains its characteristics of spaghetti code and somewhat convoluted and non-flexible checkout process.

Zen-Cart’s strengths are its simplicity which gives many non-programmers the opportunity to tweak and add (or remove) features to their likings with no major effort. This means that implementing a Zen-Cart ecommerce website is usually inexpensive and fast. Another great benefit of the system’s simplicity is speed. Zen-Cart is many times lighter than many other ecommerce systems even without complex caching technologies. Together, these benefits support a specific market: the market of light ecommerce. I am talking about online shops with 1 to 100 daily transactions or even less. It can obviously support more than that but the simplicity and the light weight features will attract the small business which is budget oriented.

The light ecommerce market while being small in terms of overall sales figures is relatively large and will get larger and larger with time. This is also known as the long tail of any market, in our case it is the long tail of the ecommerce market. This means that the numbers of installations will most likely be large and not insignificant. It also means that it is a valid market and will not vanish overnight with any other solution such as Magento who now charges a hefty amount for licensing its Enterprise version.

Before you rush to declare this light and feature packed ecommerce platform the kind of the long tail ecommerce market, don’t underestimate the challenges that it is facing. With over a year and a half of no significant updates its market share is shrinking fast. The default template and the admin panel need some serious reworkings to get up to par in UI and design with other open source challengers and a major cleanup and reorganization of the backend configurations is way overdue. While it supports XHTML and validates correctly, the default template needs to be reworked without the tables.

In any case, Zen-Cart still serves its purpose as a free and light open source ecommerce platform. And here at Activo we have recently developed a Recurring Orders payment module that comply with PCI requirements and integrates well into the ARB module of Authorize.net. I’ll soon post links to an initial free version, a commercially licensed version should be available in about a month or so.

What do you think of ZenCart? here to stay or yet another open source project that will be lost in oblivion? somewhere in the middle perhaps?

eCommerce, Magento, Web Development, ZenCart , , ,