« | Main | »

Somebody who read the Rolle article just asked me about how Castor compares to Torque in terms of object-relational mapping.  I did not know about Torque when I started Roller.  Torque looks really cool.  Here are my off-the-cuff thoughts on Torque vs. Castor:

  • With Torque, you start out with an XML file that defines your tables and relationships.  Then Torque generates both a set of objects for each of your tables and database creation scripts for creating the tables within a variety of databases.
  • Castor assumes that you already have your Java objects and you database tables.  So, you need to provide mapping from objects to tables - this is the mapping.xml file that I discuss in the Roller article.
  • With Torque, the objects know to write themselves to the database.  But with Castor, Castor itself knows how to do that. So, with Castor the objects can be dumb data holders.
  • Also Castor has the XML binding built in and Torque does not. The Castor mapping file can be used to define how objects map to database tables and how they map to XML.  I use this in Roller to allow the export/import of user weblog data to an XML file for backup purposes.
  • I have heard that Castor has object caching and Torque does not. I'm not sure how important this is.
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed

« | Main | »

Welcome

This is just one entry in the weblog Blogging Roller. You may want to visit the main page of the weblog

Related entries

Below are the most recent entries in the category Roller, some may be related to this entry.