node.js - Designing a thinner controller in SailsJS -


i new mvc programming.currently have user model 1 attribute timespent. using d3.js plot time spent per user in 1 of views. current way implementing incorporating logic of searching database , getting data in correct format in usercontroller.

from have read on sails docs, recommend "thin" controllers whenever possible. else can incorporate search/formatting code in more reusable manner?

controllers should thin because controllers :) it's common error when start using mvc framework put logic in controller, definetly should't there.

if working data stored in database , related model, suggest logic should in model. many people think, model shouldn't thin possible :)

and of course if not fit there, yann suggested, use services. part of yout application logic should there!


Comments

Popular posts from this blog

c - Calling a function within a loop -

vb.net - Unbound DataGridView add row with checkbox error -

How i fill combobox items in Radgridview manually using in vb.net -