I have worked a bit with Django and I quite like its project/applications model : you can build a Django project by assembling one or more Django applications. These applications can be autonomous, or some applications can be built on top of other applications. An application can easily rely on another application's models, as well as its controllers (Django dudes call them "views") and even its views ("templates" in Django-speak).
I am now working on a relatively large scale Ruby on Rails project, and I am surprised to see that there is apparently no easy way to do the same thing in Rails. Basically, in Rails, one project = one application. Our project has started off as a huge monolithic app, and we are now trying to figure out how to split it into smaller chunks.
For example, our current application allows us to manage partners and contracts (among other things). I would like to have a "Partners" application which would manage our partners (address, contacts, etc.) and a "Contracts" application which would manage our contracts with our partners. The "Contracts" application would rely on the "Partners" application (but to avoid a circular dependency, I would like the "Partners" app to have no knowledge of the "Contracts" app).
For now, I see the following as the main options:
- make these applications communicate through REST requests (each app would act as a Webservice): this is nice, but it seems to prohibit reusing other applications' views. For example, if the "Partners" app has a nice page to show the details of a partner, and if I want to display that page, slightly modified, in the middle of the contract-details page, I see no other way to do this than to have the "Contracts" app ask the "Partners" app for the partner details through a REST request (it will get an object representation, not a view), then copy/paste the partner-details page's source code from the "Partners" app to the "Contracts" app.
- turn these applications into plugins : not as nice, and a bit more difficult, but seems to allow model & views reuse
- use svn external to share some models from application to application: simple but ugly.
Thanks for your advices.