Sunday, April 13, 2008

is it just osCommerce?

... or are most PHP based sites implemented like we did in the 90'ties in JSP model 1?

First, I'm not much of a PHP developer, but I've written a thing or two, but the last couple of days I've been playing with osCommerce (last downloadable version) and I must say - it's a big pile of spaghetti wiring.
Second, I do appreciate the developers of osCommerce to volunteer their time and effort in developing an open source product like osCommerce but I'm glad I don't have to spend most of my time, extending osCommerce.

So - whats wrong with it?

  • Model 1 like "architecture" where a PHP page starts with a switch case of a parameter typically called "action" which decides what action to take (and do), much like:
    • switch ($action) {
    • case 'create':
    • .... do whatever to create, make SQL, call MySQL and such
    • case 'update':
    • .... do whatever to update, make SQL, call MySQL and such
I think you get the point!

default is ofcourse to write the HTML of the page, with submits back to self and a hidden parameter called "action"

As you might imagine, this leads to huge files, with a lot of code hidden behind if's and switches and not having you daily routine going thru osCommerce files, it's damn hard to figure out where goes where and why.. Well - for me anyway!

A simple event system would be nice, because most extensions (I think) are based on integrating osCommerce with external systems and had an event system been included, it would be rather simple to, for instance, synchronize osCommerce customers with ERP systems whenever a customer was created or updated.. well - maybe i'll write one and stop bitching about it :-)


Post a Comment

<< Home