[LRUG] Multiple Rails apps sharing common UI

Mark Burns markthedeveloper at gmail.com
Tue May 19 14:34:36 PDT 2015


> My main concern is that with one big app tests start taking longer and
longer to run

It sounds like this is your actual reason for avoiding a single app and it
sounds like it is founded on flawed premises.
Test suites shouldn't take that long to run, and there's plenty that can be
done to speed up test suites and tackle those problems.
Testing too much, hitting the db or network when you shouldn't/don't need
to, testing at the wrong level, etc.

If this is a greenfield app it means you can ensure that the test suite
doesn't get to that stage and have the simplicity of a single app.
Having worked with Pivotal on a project, I can definitely recommend the
engine approach they suggested (if and when it becomes necessary and not
too much before).

Breaking the app into smaller parts and/or namespacing is definitely a nice
way to reduce the overall complexity introduced (by e.g. two or more
separate apps and deploys etc) but maintaining a clear separation of
concerns.

Anyone that has had an issue with too much referencing of namespaces with
engines may have found that the dependencies/separation was not as clear as
it could be.
In general the namespacing can act as a really good code smell indicator.
If you have one namespace that is constantly referencing others then the
code has probably been split at the wrong boundary and/or is just too
highly coupled.
This pain just becomes more visible once you introduce namespaces and it
can help you to refactor to a cleaner structure at an earlier phase.
There is some faffing around with bundler, migrations, models etc that a
fair bit has been written about. It can mostly be solved with a couple of
lines of bash/aliases or something to get your equivalent to rake && git
push.
But most of the code in an engine based app only differs from an ordinary
rails app by having an extra module at the top and two spaces more
indentation.

On Tue, May 19, 2015 at 11:09 PM Kerry Buckley <kerryjbuckley at gmail.com>
wrote:

> On Tue, May 19, 2015 at 2:59 PM, Paul Doerwald <paul at liquidmedia.ca>
> wrote:
>
>> I’ll chime in with Graham about using a single app. There’s a certain
>> appeal to software purity, but I’ve found in the past (when I’ve carefully
>> written separate apps, or had clear delineations between parts of an app,
>> assuming a largely overlapping set of users) that as the application
>> matured, the two apps increasingly became one, and an eventual rewrite
>> forcibly made them one.
>>
>
> You make a convincing argument, and there's no doubt that a single app is
> easier (if not necessarily simpler). My main concern is that with one big
> app tests start taking longer and longer to run. I worked on a huge Rails
> app a few years ago where the full test suite took 45 minutes (there were
> some bad testing decisions as well as sheer size), and I never want to go
> there again!
>
> I guess the solution is to separate things in such a way that it's easy to
> run a focussed subset of tests, but I still want to be able to say "rake &&
> git push" without then having to go off for a coffee while I wait.
>
> Kerry
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> Archives: http://lists.lrug.org/pipermail/chat-lrug.org
> Manage your subscription: http://lists.lrug.org/options.cgi/chat-lrug.org
> List info: http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20150519/1108424e/attachment.html>


More information about the Chat mailing list