Friday, November 04, 2005

OOP

I have realised in the past months how reliant I have become on object orientated design. I was asked to write the website for work using a modular approach; which I have found quite difficult. When I look at the way I have structured things, I have tried to obtain the highest possible level of abstraction as I possibly can. I have done away almost entirely with global variables, using them only for the most important of variables; in most cases these variables are objects.

You saw right, the site is not entirely modular; I have succumbed to the temptation of using OO design for the sever side sessions, the template system and error handling. In fact I cannot imagain trying to program a polymorphic database abstraction layer using a modular approach.

Not only have I come to realise my reliance on the OO design methodology, I have also found a soft spot for it. The more I utilise it in my applications the more logical the approach seems, especially when it comes to modelling high level problems which such as those which you are likely to encounter in web development. While developing my site for work I think myself saying "this would be so much easier, if I were to use a Singleton to achieve this functionality" or "This data would be a lot better encapsulated in a class which manages the collection, validation and updating of the data by interfacing with the database abstraction object."

At university, we have started learning Java and we are doing another module to accompany it, which focuses on object orientated design in software engineering. So, I believe there may be some exciting times ahead and hop soon to buy a book on OO Design patterns to help further my knowledge. When I get the time, I will redesign the site I am working on using OOP, I do not believe this will be too difficult, because of the way I have written it - and if it is difficult it will serve as a learning experience.

No comments: