packages in coldbox

Just reading through the docs and I found packages. I was trying to figure how I was going to do something but it seems like this is my answer. I have a basic data driven app, there is a public side and an admin. These are both separate modules to me. They have their own handlers/views/etc but share a lot of the same modules. Are packages my answer to dived the 2 into their own applications? I need a public side that anyone can see and then the admin locked down using the security plugin.

Hi, Dan:

I’ve had the same questions and with the advent of modules, in 3.x, modules to me seems the way to go. That way, you can have an “admin” module that has unique views, models, etc., but can also utilize the view/modules, etc., of the base site. Seems to make sense to me to do it that way, but it will be interesting to see what other more experienced CB folken have to say.

Kevin

Hi, Dan:

I’ve had the same questions and with the advent of modules, in 3.x, modules to me seems the way to go. That way, you can have an “admin” module that has unique views, models, etc., but can also utilize the view/modules, etc., of the base site. Seems to make sense to me to do it that way, but it will be interesting to see what other more experienced CB folken have to say.

Kevin

modules seem like they are meant more for something that is distributable… But like you I am going to defer to the experts :wink:

Hi Dan,

not necessarily. Modules do give you lots of options later on if you want to distribute, package, active/deactivate, etc. However, they also give you autonomy, separation and decoupling. They can have their own ses rules, wirebox binder configuration, etc.

In all reality I am nowadays tending to build more modules than anything else, even for things as RSS capabilities, commenting, api services, etc. They are quite more elegant than just packaging.

However, packages DO have their place and good judgement is needed to distinguish what deserves a module or package.

ok so is my main application the public view and the module the admin? can a module (the admin) share models from the public app?

Yes,

Your modules can use anything in the parent and anything in other modules. WireBox add scan locations for objects in all modules and the parent application so you can easily retrieve them.

You can also create your own mappings for your module objects and so forth. You can even render parent layouts, views, use plugins, etc.

Also remember that modules are skinnable via the parent layout and view overrides also.