JCROM - annotation-based OM framework for JCR

I’ve just released the first version of JCROM (pronounced “Jack-rom”). JCROM (which stands for Java Content Repository Object Mapper, I’m not great at naming things) is a lightweight framework for mapping Java objects to/from a Java Content Repository (JCR). It relies on annotations only, so there are no XML configuration files involved. JCROM ensures that your objects are mapped to the JCR according to best practices, meanwhile abstracting the gritty details and making your code clean and readable. Last but not least, JCROM is open source, with an Apache 2.0 license.

Head over to the 2 minute intro for a quick overview, and then continue to the User guide if your’re hungry for more detail!

I am aware of the ocm framework that appeared in Jackrabbit 1.4 (the old Graffiti project). I’ve read the documentation, but I have to admit I have not taken it for a serious test drive yet! I guess it is a lot bigger and more powerful (and heavier) framework, with query service and persistence manager with support for locking, versioning, etc.

I wanted to create a lightweight annotation-based alternative (I am not a huge fan of XML configuration files, although I do realise that they are sometimes necessary), that just handles the mapping of the object to and from nodes (as I found myself writing lots of boiler plate code to achieve this in my applications). Transactions, versioning, locking, are all out of scope, and handled outside JCROM.

Then I added the DAO support classes (with all the CRUD methods implemented), and extending classes can then add custom finder methods (usually just one-liners utilising the protected finder methods from the abstract class). Now I create applications with Jackrabbit and JCROM that require half the amount of code that my old Hibernate applications needed.

There are some discussions on the Jackrabbit dev mailing list regarding JCROM, and it is some people’s opinion that using JPA (Java Persistence API) annotations might be a better approach for the future. From my perspective, I did not want to wait for a specification to change, I needed a framework for this right now. Something lightweight and easy to use. Couldn’t find it, so I built it. But I am more than happy to look into adding support for JPA annotations to JCROM. I just need to read the JPA spec in more detail…so much to do, so little time :)

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • LinkedIn
  • TwitThis
This entry was posted in Software and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*