Friday, January 25, 2013

MongoDB and Java Persistence

I've been taking a look at how to approach persistence with Java and MongoDB.  Leveraging the Data Mapper and other JPA-related patterns seems like a good practice to continue with Mongo - especially given its non-relational status.

My colleagues and I are currently doing a bake-off of the different frameworks and are publishing our results over on our company's blog.  

In the interest of not incurring any DRY violations, I'll simple link to the articles from here.  However, I'm interested in hearing what everyone thinks and whether or not there is even a need for Data Mappers with Mongo.


Thursday, January 17, 2013

Reverse Engineering Java to UML Class Model

Found a great little tool for generating UML Class diagrams from existing Java classes. It's a plugin in Eclipse that outputs the image to Omnigraffle. The good news is that Mac OS X users can create diagrams in their favorite tool.

Its available in the Eclipse Market place as 'javatoomnigraffle' or you can check out the page here.

Granted you have to pay some bucks for Omnigraffle, but its worth it and now with the Eclipse integration, it will make for some good pictures for upcoming blog posts.

Monday, January 07, 2013

Configuring PHP Values for OpenShift

This is probably basic stuff for you PHP experts out there, but recently I was doing some work to upgrade my ownCloud instance that's sitting in OpenShift.

There were some significant changes in the upgrade which required completely replacing the php directory - at least according to the upgrade instructions on ownCloud's site.

This was a fairly smooth process as I made sure I had checked out my latest deployed instance on OpenShift. Then, I removed everything in the PHP directory but the config and copied in the latest ownCloud version, committed the changes and watched the OpenShift magic automatically deploy the new CodeBase.

Well almost. I ran into an issue where the session.save_path php variable was not set to a writeable directory. Simple enough fix, just modify the php.ini to do this - except on OpenShift. The next place to set this then is to configure it in a .htaccess file. So in the .htaccess file I added -- 'php_value session.save_path /tmp' and then did an rhc app restart owncloud -l. Viola, I'm off and running again.

To fix it correctly, I need to modify the .htaccess to use one of the environment variables for openshift - most likely OPENSHIFT_TMP_DIR, but for now this works and I can tinker with the latest bits of ownCloud.

So in the future, if you need to modify a PHP variable, make sure to use the .htaccess file for this.

Now my next thing is to make sure that I modify the ownCloud openshift quickstart to use the latest code.