[LRUG] Multiple Rails apps sharing common UI

Paul Doerwald paul at liquidmedia.ca
Tue May 19 06:59:26 PDT 2015


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. 

I would satisfy my desire for code order by looking to the commonalities of the application — the overlapping user base, for example — and writing a single app that addresses those commonalities. Make the domain of your application broader than it actually is so that your components/modules are implicitly included in that broad domain. Your users don’t care that it’s all one app — in fact, they’ll probably prefer it without being able to express why — and you’ll have a lower long term maintenance burden on account of it. 

Paul.

-- 
Paul Doerwald
Chancellor, Liquid Media Inc.
902-412-2492


On May 19, 2015 at 11:37:41, Graham Ashton (graham at effectif.com) wrote:

Are there any relationships (in the business domain) between the data that the two apps deal with? I'm wondering whether it would (user interface and code-complexity issues aside) make sense to store them together. It could provide another useful angle on whether keeping things separate makes sense.

If putting it all in one database sounds good (or at least, doesn't feel uncomfortable) I'd favour the cheapest approach approach to maintain that delivered a good end-user experience.

I suspect that means I'd favour a single app, organising the code in namespaces, and sharing all the stuff that's common. It's easy to over engineer stuff like this, and force yourself to jump through costly hoops.

Namespaces are great. In my experience, we Rails developers don't use them enough.

If you're reluctant to use namespaces, is there a specific problem you'd be trying to avoid?

Cheers,
Graham


On Tuesday 19 May, Kerry Buckley wrote:

> Hi LRUG,
>  
> I have a small Rails app used by a closed set of internal users, and am
> about to create another, for the same users (or at least an overlapping
> group). They've asked that the two apps (and potentially more over time)
> are presented as one integrated front end, rather than users having to
> visit multiple URLs, log in separately etc.
>  
> I'm wondering what the best approach to this is. I don't want to go to the
> extreme of a JS front end with the Rails apps just presenting JSON APIs, so
> the main options seem to be:
>  
> * Separate apps with matching layouts, and headers, with some kind of
> single sign-on
> * One big app with namespaced routes, controllers etc to try and keep
> things vaguely separated
> * Separate apps into Rails engines, mounted in a master app that manages
> sessions etc
>  
> I'm kind of leaning towards the third option, but I've never used Rails
> engines before, and I'm not 100% sure how that approach would work out. My
> main concern is acceptance/integration tests – it seems to me like they'd
> have to live in the wrapper app as most of them would rely on users,
> sessions etc.
>  
> Has anyone had experience of this kind of thing, and if so, which of the
> above approaches would you recommend (or discourage)? Is there a better
> solution I've missed? I'm about to start spiking something with engines to
> see how things fall together, but some opinions from someone who's done it
> in anger would be great!
>  
> Thanks,
>  
> 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

_______________________________________________
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/0bd5970f/attachment-0003.html>


More information about the Chat mailing list