-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Allen S. Rout wrote:
> I've had a bright idea, and I'm trying to determine if it's in fact
> not so bright. :) 
IMHO your message failed to prove any "bright" idea. What it did in fact
was to merely summarize HM's "bright" component-based design :))

> I can tell them to just use <& /header-main &>;  this is slightly
> discordant but not too bad.  
"Discordant" is good thing here! This is one simple and visible way to
differentiate i.e. between "taglib components" and "the other
components" ;-)

Farther more, I'd promote using even a more "discordant" prefix for your
"taglib", something like "/TL/" or something.

> I was wondering if there is established art to do this sort of thing
> in Mason land, or if there's a reason I don't Really Want to Do That
> anyway?
I doubt about the "art" term, but anyway, here's how you could make your
life easier within this scenario: use multiple comp_root. I (for one,
but I'm quite sure many amongst us use something similar) usually do it
like:

   my $ah = MyApacheHandler->new(
        ...
        comp_root    => [
                            [ private => $r->document_root ],
                            [ shared  => $SharedComps ],
                        ],
        ...
   ) or ...;

Inside $SharedComps folder make yourself a "TL" subdirectory where you
should keep your "taglib". This way, people could use it like <& /TL/... &>.

There are some issues you should take care of:
1. Protect your taglib
  # do not allow direct call to taglib components
  return NOT_FOUND if $r->uri =~ m{ ^ /TL (?:/|$) }x;

2. Don't "optimize"
  Don't even think about using some separate comp_root for your taglib
  (like: [ taglib => $TagLibDir ] ). It's just a clear case of shooting
  yourself in the foot:
    - overriding a taglib component will become a mess
    - no _clean_ way to protect direct calls to taglib comps
    - more comp_roots, more component resolving time
    - ... (TMTE, I could talk about this all day long, but for now,
    saying that I'm heavily using HM for more than 5 years should
    be enough)

3. (There could be some more issues that you should take care of, but if
 it's not coming to me at a glance... maybe they're not important) ;-)

cheers
- --
Marius Feraru
-----BEGIN PGP SIGNATURE-----

iD8DBQFD6ysztZHp/AYZiNkRArPlAJ4gq03IUNJqZmyKVrzpAJXCOJvg/wCfdp0b
RPi+P3+hDaf8EZygKODHEtA=
=1bPQ
-----END PGP SIGNATURE-----

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to