I have a web application written mostly in Java. There are a few users that hope to use ruby to tailor this application to suit their own needs. How would I write an API that allows Ruby developers to interact with my application?
I’m really looking for some direction here – I know it’s a broad question..
I think rmk has the right idea here, but I think rails is overkill. You’ve really got two feasible options:
The first option would be to leverage JRuby to allow them to provide JRE classes that you can interface with your code. They can write classes in ruby, compile them with JRuby, and you can deploy them with your app.
The other viable option would be to create a restful API using your existing java codebase and let them consume your api from ruby, much like rmk suggests. If you’re providing a restful api, there’s no need to add the overhead of jruby and rails unless you have some desire to.