I am maintaining a large Rails application, that consists of several
- The web interface (figures)
- Import of data from external providers
- Export of data to a large range of customers
It seems to me quite bloated to have all the code from 2) and 3) inside
the web-application, since they functionally have nothing in common. The
only reason for them being there, is that they also need the business
rules implemented in the models.
Enter Rails 2.3 and Engines…
I am thinking about restructuring the application the following way, and
my question regards whether this is a sound idea.
i) Make a Rails engine, consisting only of all models, that are shared
by two or more of the above “interfaces”
ii) Split my current application into 3 seperate applications - each
only containing what is nessecary for its own uses:
1a) Web interface should only keep: Controllers, Views, Mailer-“models”
(and other dependent files in e.g. lib)
2a) Import of data should only keep code needed for the import
3) Same as 2a)
All three of them should then add the “model-engine” in their vendor
I am not sure if Engines were meant to be used like this - but somehow
it fits in my mind. Any thoughts on this?