I must admit that you have me intrigued with your new approach to focusing more on the domain objects and making the services a lot thinner than perhaps they used to be.
I am keeping an eye on how I develop and looking for ways to make this happen. Any chance of a blog post to document this kind of approach. I adopted your one service per application area approach from the start and while I have rich business objects I still have quite a lot of logic in my services. Would be really interested in getting a better perspective on how I can shift most of the logic into the domain objects. --- James Allen E: [email protected] Blog: http://jamesallen.name Twitter: @CFJamesAllen (Coldfusion / Web development) Twitter: @jamesallenuk (General) Lead developer of http://errrrrrr.com -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Sean Corfield Sent: 07 April 2010 08:36 To: [email protected] Subject: Re: [Model-Glue] Sanity check / calling code from 1 controller in another On Wed, Apr 7, 2010 at 12:30 AM, Nolan Erck <[email protected]> wrote: > 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)? Yup. A controller should never call methods in another controller. Refactor that common logic down into the model - either the service layer or, better, the domain objects themselves - and call it from both controllers. Controllers should be relatively simple and dumb. Services should also be relatively simple and dumb. Domain objects should be where most of the logic lives. -- Sean A Corfield -- (904) 302-SEAN Railo Technologies, Inc. -- http://getrailo.com/ An Architect's View -- http://corfield.org/ "If you're not annoying somebody, you're not really alive." -- Margaret Atwood -- 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. -- 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
