The Register® — Biting the hand that feeds IT

Comments on: The database abstraction framework strikes back

You'll need refection 

Posted Wednesday 22nd November 2006 16:45 GMT

Your replacing the reflection that hibernate uses to map classes to the database (with help of mapping file) with a code generator that generates the classes out of a mapping file.

This may have advantages over the hibernate solution because mapping an file are consistant but it also has a major drawback:

you cannot just write your classes and - at any point when your programmlogic is at some state - go over and start thinking about persistence. You would have to write a mapping that generates the classes you have written before - nobody will like this work.

I'm afraid as long c++ doesn't provide a reasonable reflection system languages such as Java are - in those special problem domains - better because it is possible to write better libraries and frameworks.

Perhaps a c++ reflection library could solve this problem. There are some (http://seal-reflex.web.cern.ch/seal-reflex/) but this comes to the next c++ drawback: its just more complicated to get a library to run it with the compiler you use(compile and link as debug and release-Versions, as dynamic and static library). But thats another topic ...

A matter of trends? 

Posted Saturday 25th November 2006 00:41 GMT

Thanks Daniel for this enlightening essay.

I believe one can be astonished by Java being more popular than C++ amongst the framework developers because both languages first appear to be quite similar in their main paradigm (object oriented). If you have a look at an elementary piece of code (say a Java class), you'll notice that you could turn it into C++ in 2 sec, the two syntaxes being so close.

Nonetheless, this naive observation must not hide the distinctions between Java and C++. The 'sexiest' part of Java is to be a cross-platform language (at least on the developer side). The application/framework developer does not have to worry about porting issues. Java virtual machines are done for that purpose. If you combine the native support of threads, this looks pretty much appealing. Now, what I like about C++ merely lies on the technical ground: generic programing with templates for instance. In a project management perspective, I believe it's more difficult to justify the choice of C++ (especially now that JVMs are more and more performant).

This said, I'm not sure there is a lot of stuff that you could achieve with Java and not with C++. Reflection is cool, but is it mandatory for any projects? Would the project development be cheaper though, if you could use reflection? That's probably one of the questions that drive the language choice. Still, I reckon it is most often a matter of sector, its constraints and also its trends.

Finally, I think your article will encourage the C++ enthusiasts to prove that useful, widely used frameworks that already exist in Java can just as well be written in C++.

Don’t Miss

SunSun's surviving staff hit with 'motivation' missive

Exclusive Code: Your solace, our savior

Ubuntu teaser Ubuntu's Karmic Koala bares fangs at Windows 7

Review Shuttleworthian scrap

AppleChange your views: OS X tags exploited

Mac Secrets Apple windows insider

JavaSun preps cell-phone Java plan for netbooks

OpenWorld 09 Modules not globules