OOP Criticism

February 25, 2001

OOP Criticism -- "I have been programming small and medium custom business applications for most of my career. Most of my complaints against OO are related to this rather large niche."

IMO the #1 advantage of OOP is efficiency/quality through reusability (which isn't a guarantee, it's only achieved with competence and experience (or luck), through excellent design).

Programming small and medium custom business applications won't lead to many situations where reuse is going to happen.

Therefore, I feel his opinions are a predictable (if not extreme) result of his inexperience.

He hasn't done his homework either. He says:

"OOP often does not map well to relational databases. [...] Using relational tables with OOP requires converting (mapping) fields into objects and visa-verse when putting them back into the tables. This is a painstaking process and can waste a lot of programming time."

Sure, if you consider some crap like ADO or JDBC to be OO-database access (it's not), sure you can waste a lot of programming time. Wrapping SQL in a method call isn't any more OO than wrapping it in a salami.

Doesn't it stand to reason that in the 20+ years OO and RDBMS hav been popular that someone would have written software that abstracts this problem and makes it easy?

Well someone has! There's quite a few good packages that do this, the one I have the most experience with is called the Enterprise Objects Framework.

An example: PASBC is a critical application for the BC education system. It handles all the online admissions applications for the majority of the colleges and universities in BC. The PASBC source code doesn't contain a single line of SQL, yet all of the data it manages is retrieved from and stored in an Oracle database. There's lots of SQL flying between the application and the database, but noone on the PASBC team had to write it.

I could go on but there's little point.

Wait, I will go on.

PASBC could move it's database to Sybase or FrontBase (any database with an EOF adaptor), and PASBC's code wouldn't have to change. All the developers would have to do is update the EOModel file to point to the new database, and restart the app.

And we actually did this while PASBC was being developed. We used FrontBase (which rocks, btw) until our Sun/Oracle server arrived. The hardest part of switching to Oracle was installing the Oracle client libraries. :-)