In writing the articles on object oriented programming I have stuck with theory. After all, it is not language specific and takes less space to say what there is to say. However, I have been asked by serveral to provide a tutorial or include examples on object oriented code. Well, I’ve decided to do something more. My good friend Andrew Branch has pointed out many times before that we learn better when we do things ourselves. And so, in that spirit, we will start a new full-fledged project together. I will write along as we develope it about how we should try to do things, so we can more fully understand object oriented principles. And we can all write the code for it.
Going back to my roots, I learned to program by hacking on osCommerce code. I wanted to make my own ecommerce site and run my own buisness. It was then that I discovered how enjoyable programming was and stuck with that instead. The problem with osCommerce is, however, that it is very procedural. It has SQL queries inline with the HTML on it’s pages. It uses functions to output pixel images. It requires a lot of hacking to modify. It is an adequate example of what you might call “spaghetti code.”
We will be starting a new open source project that will implement all the features of osCommerce, but in a better way. And hopefully, since this will be more extensable, we can add many new features. We can call this project ooCommerce for object oriented ecommerce. I have already purchased the domains oocomerce.com, .net, and .org so that we may, eventually, have our own site for it. And I have submitted it to Sourceforge for pending approval. The benchmark of features we will be aiming for is listed on osCommerce’s site. And, because we are going full out object oriented, we will be using PHP 5. I am sorry if you were hoping for PHP 4, but in order to teach better OOP principles, and because PHP 4 is such a hack in terms of OOP, that’s what we need to use.
I hope ooCommerce will be, if nothing else, a great learning experience. Instead of a little pointless tutorial on saying “hello world” in an object oriented manner, we will actually create a full-featured system as our tutorial, implementing all that we’ve learned previously. We will look at planning this project out next week, so stay tuned.