Views in handlers directory, aka self-contained packages

I'm thinking about a self-contained bundle to provide some
enhancements to ColdBox. Conceptually it's sort of a plugin,
addressing a cross-cutting concern.

It would contain several pieces, including one or more event handlers,
interceptors, services, views, and possibly layouts. For code
cohesiveness and ease of installation, I'd like these all to be in a
single directory. Since it includes a standard event handler, I think
that needs to be the convention handlers directory.

I'm wondering if this file organization is practical. Interceptors can
be anywhere, so that's not a problem. The service is used only by this
handler, so the handler can instantiate it directly. I know typically
services get injected into objects that use them, for looser coupling,
which I value, but in this self-contained package I'm ok with this
direct approach .

The views seems to be an issue though. Is there some way for a handler
to invoke a view that's in its own folder, not in the convention views
or external views locations?



Check out ColdBox modules. I believe this is what you are looking for.

Curt Gratz

Thanks Curt, maybe so.

However, I've realized that this should be able run even before
ColdBox has been initialized at all, so I think it needs to live
outside CB completely, self-contained at the CF level.

Which brings up some other questions I'll ask in a new thread.