Dear monks,

I am looking for a solution of - what I think is quite typical issue - but I was not successfull so far.

I am building a Catalyst application (say MyCatApp), with couple of web interfaces for different kind of users.

The interfaces should be accessible via subdomains:

All interfaces will be powered by a single Apache server.

What approach to choose?

Separate applications

Three different applications (MyCatApp::Public, MyCatApp::Provider, MyCatApp::Admin) sharing model (and probably some templates) with unique set of controllers (MyCatApp::Public::Controller::Deal, ... ).

This approach involves more code and inheritance and disallow (internal) calls between controllers from different interfaces.

On the other hand I can imagine the deployment where each application serves as handler for one virtual host in Apache config.

One application

One application with each interface having its controller namespace (MyCatApp::Controller::Public::Deal, MyCatApp::Controller::Provider::Order, ...). I think less modules, less namespaces involved, probably more comfortable coding.

But I am not sure about deployment, also about Catalyst URI to internal paths and vice versa resolution. Should I have again three virtual hosts but handled by the same application? How should I achieve that:

http://provider.mycatapp.xyz/order is resolved to /provider/order http://provider.mycatapp.xyz/deal is rejected # and vice versa $c->uri_for('/provider/order') # yields http://provider.mycatapp.xyz/order

What approach would you choose? Thank you very much for any recommendation.


In reply to How to build multirealm Catalyst application by roman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.