Archive for November 2007
A step-by-step guide to Object Oriented Programming
According to Marcus Baker, if you are a PHP developer and new to OOP, it’s possible that your story will go something like this:
- You’ll learn the syntax and build an object or two.
- You’ll try it in a live project.
- You will realise that you are getting no real advantage, and you’ll post your code on the forums.
- People will tell you that your objects are just “smart data”, and that you should “think in objects”.
- You’ll start to build some top level objects, but get confused. Very confused.
- One late project and several rewrites later, you’ll come to the conclusion that this OO stuff is a waste of time and go back to procedural.
- You’ll repeat the whole sequence six months later.
- …and again six months after that, but this time you won’t listen to advice.
- A year after that, you’ll “get it”.
- You’ll then post lots of helpful advice on forums to other OO beginners suggesting that you “think in objects”…
For those who want to… “think in objects”;)
Implementing the Delegation Pattern Using Reflection
Times arise where a class (One) is supposed to do everything another class (Two) does and more. The preliminary temptation would be for class One to extend class Two , and thereby inheriting all of its functionality. However, there are times when this is the wrong thing to do, either because there isn’t a clear semantic is-a relationship between classes One and Two , or class One is already extending another class, and inheritance cannot be used. Under such circumstances, it is useful to use a delegation model (via the delegation design pattern), where method calls that class One can’t handle are redirected to class Two . In some cases, you may even want to chain a larger number of objects where the first one in the list has highest priority. The following example creates such a delegator called ClassOneDelegator that first checks if the method exists and is accessible in ClassOne ; if not, it tries all other objects that are registered with it. The application can register additional objects that should be delegated to by using the addObject($obj) method. The order of adding the objects is the order of precedence when Class OneDelegator searches for an object that can satisfy the request:
Read the rest of this entry »
The Future of Software Development
With the advent of modern programming languages (Java, PHP, Python and Ruby), rich libraries, and unprecedented infrastructure services like those from Amazon, we are arriving at yet another evolutionary step. Digg, del.icio.us, YouTube and other poster children of the new web era were developed by just a handful of programmers. To build software today all you need is a few good men (or women!). In this post we trace how we got here and where we are heading next.
An excellent post written by Alex Iskold about the future of Software Development. Read More…
The History of Programming Languages
For 50 years, computer programmers have been writing code. New technologies continue to emerge, develop, and mature at a rapid pace. Now there are more than 2,500 documented programming languages! O’Reilly has produced a poster called History of Programming Languages (PDF: 701K), which plots over 50 programming languages on a multi-layered, color-coded timeline.
