Java Objects as ActiveModel Objects

I am writing a Rails app and my model layer is written in Java. I have
services written in Java that return these model objects. My problem is
that I would like to use some of the Rails niceties that come from using
ActiveModel objects but I am having a hard time figuring out how to get
my
java models to behave like ActiveModel objects fully. Has anyone had
any
experience with this kind of architecture that could offer up some
advice.
I am open to any ideas on how to best work this.

Overview of a Request (as an example):
Browser GET /cart/5 -> Rails app/controllers/cart:get -> Java service to
get
contents of cart (java models) along with any other info needed for page
->
Rails controller with Java objects -> Rails view using Java objects

Take a look at https://github.com/nicksieger/refactoring-to-rails. It
attaches ActiveModel to several Hibernate models.

/Nick

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs