Is OOP dead?
While listening to DNR the other day, I was inspired by Carl's and Rory's discussion about this article about OOP. It is an interesting take on object orientation in programming, and while I don't agree with most of the opinions presented in it I have to defend the writer to some extent.
The article says: "Still trying to get OOP right after ten years? Something strange is going on here." It is certainly true that OOP has not been the be all answer to general and easy reusability that it promised to be in the early nineties. OOP has failed to be the basis for large scale reusability, mainly because complex class hierarchies quickly form a very tightly coupled and fragile construction that is hard to use and even harder to extend. Another example of where one could say that OO has gone too far is when the object paradigm is extended into distributed scenarios (RMI, DCOM etc). Location transparency (pretending that a method call is local even when it actually means calling a remote method running on the other side of earth) and thight coupleness is not a good thing to base your distributed architecture on. This has been seen on the ongoing urge towards service orientation (SO, SOA) as the base architecture for distributed systems. The basic idea there of course is that services are loosely coupled and calling them is explicit, both of which are part of the four tenets of SO. Taking OO to extremes (like distributed objects) might not be the best thing to do, as is the case of most things in life :)
So, given that the world is moving towards service orientation, what is the role of object orientation? Is it dead? Of course not, OO just isn't the topic that has the most buzz around it anymore. Naturally all of the good things in OO (and there are plenty) are still valid when these new service oriented systems are being built. It means that object orientation probably is the most popular abstraction that is used when the code that implements the services is written. And inside a service it is totally ok to use inheritance and other OO concepts wherever they make sense.
OO is in a similar state currently as COM, as Don Box likes to express it: "COM isn't dead, it's done". It means that COM is not anymore the piece of technology that evolves and is being developed further, instead it has reached a state where it works and continues to be used where it is applicable. Similarly, OO isn't dead, it's done: OO concepts are the dominant way most software is being built today, it just isn't the piece of technology that is in the center of attention.
I do agree with Carl & Rory in that copy/paste is clearly not a viable replacement of OO paradigm as the original article suggests. Also, it is interesting to note that before Java, C++ was by far the most popular OO programming language. At that time it was also considered very unlikely that nothing would replace C++ as the programming language of choice. Along came Java, and the rest is history. Java changed the rules of the game by introducing the concept of managed code and became the dominant OO programming language. A similar change might be lurking behind the corner regarding modeling: UML is considered to be the king of the hill in modeling currently. Along comes software factories and changes the rules: modeling should be based on domain specific languages that raise the level of abstraction significantly and are precise enough to compile. We'll see if it offers big enough improvement in developer productivity to be the future paradigm of choice for modeling. I for one think so, and so do others.