--
--
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 model...@googlegroups.com
To unsubscribe from this group, send email to
model-glue+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en
---
You received this message because you are subscribed to the Google Groups "model-glue" group.
To unsubscribe from this group and stop receiving emails from it, send an email to model-glue+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Dan - thanks for the suggestion, will look into this. Would you use a queue to keep them separate or how, at the controller event level do you prevent it from running two work tokens simultaneously?
On Tuesday, February 12, 2013 12:44:49 PM UTC-8, Dan Wilson - sipa...@gmail.com wrote: --
--
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 model...@googlegroups.com
To unsubscribe from this group, send email to
model-glue+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en
---
You received this message because you are subscribed to the Google Groups "model-glue" group.
To unsubscribe from this group and stop receiving emails from it, send an email to model-glue+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
It shouldn't really be the case that your controller methods ends up being massive, if it is, then I'd hazard a guess that you're doing too much in your controller when really that code should be moved into a service layer.
--
--
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 model...@googlegroups.com
To unsubscribe from this group, send email to
model-glue+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en
---
You received this message because you are subscribed to the Google Groups "model-glue" group.
To unsubscribe from this group and stop receiving emails from it, send an email to model-glue+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Brian,
It shouldn't really be the case that your controller methods ends up being massive, if it is, then I'd hazard a guess that you're doing too much in your controller when really that code should be moved into a service layer.
Things like business rules, queries, orm functions or transactions in a controller method are a red flag, and code needs re-factoringIf I have complicated processes to handle then I place them in a service, the service will then take whatever inputs are needed and process them. If an error occurs I have my service throw a custom exception that can be caught in the controller.function myControllerMethod(event) {var args = event.copyToScope({}, "foo,bar,baz");try {var result = getMyService().doSomething(argumentCollection=args);}catch(InvalidFoo fooexc) {// foo was invalid, maybe redirect back to a form or something}catch(any e) {// something unexpected happened}// we're done, no errors, cool beans!}My controller has no idea what goes on inside the doSomething() method, only that it requires certain arguments, can throw a number of errors and returns a result. What the service does internally (maybe aggregating a dozen other service methods) is of no concern of the controller.As a rules of thumb, I only allow controllers to talk to services, and services to talk to gateways.Hope that helps,Chris
--
--
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 model...@googlegroups.com
To unsubscribe from this group, send email to
model-glue+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en
---
You received this message because you are subscribed to the Google Groups "model-glue" group.
To unsubscribe from this group and stop receiving emails from it, send an email to model-glue+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Dan - thanks for the suggestion, will look into this. Would you use a queue to keep them separate or how, at the controller event level do you prevent it from running two work tokens simultaneously?
On Tuesday, February 12, 2013 12:44:49 PM UTC-8, Dan Wilson - sipa...@gmail.com wrote: --
--
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 model...@googlegroups.com
To unsubscribe from this group, send email to
model-glue+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en
---
You received this message because you are subscribed to the Google Groups "model-glue" group.
To unsubscribe from this group and stop receiving emails from it, send an email to model-glue+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.