Hi all --

I'm curious what the recommended practice is in this situation:

I've got an MG3 app, and each major section of the app has been broken out
into its own ModelGlue XML file, as well as corresponding Controller and
Service.  So, I have someting like the following:

/config/MG_User.xml
/config/MG_News.xml
/config/MG_Videos.xml

...and there is a matching UserController.cfc and UserService.cfc, and the
same is true for "News", "Video" and the rest of the site.

Via MG_User.xml, I can broadcast a "user.isLoggedIn" message to determine if
the user has logged in, and so on.  What I'm running into now is, there are
times when I'll be in (for example) my NewsController.cfc, and will need to
run code that currently exists in the UserController.cfc (usually I need to
determine of the user is logged in, or a member of a particular
group/security setting, etc).

I'd like to get a "sanity check" from someone about what they do when in
this situation. Is this a sign that the controllers are too heavy, and that
code should be moved to the Service Layer (so I can get to it via the
"beans" scope, in all my Controllers, and not worry about this any more)?
Would you refactor common code into a BaseController and inherit from that,
providing the functionality in both Controllers?  Something else that I'm
missing entirely?  Does this even make sense? :)

None of these options are striking me as definitely the right way to go.
What would you do?

Thanks,
Nolan

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to