service - restructuring my ruby on rails app -
currently i'm working on rails app , consists of 2 parts: client , server.
so every time client makes call server, server returns json documents. put business logic(most of them fetching data db , converting format) helpers @ server side , controllers call helper methods directly. helpers grow crazily after i've made many changes. @ time have refactor code base.
then, i'm wondering these business logics(fetching , converting data) shall split them isolated modular services or still keep logic in helpers , put rest services? if it's latter one, should remain , should moved away?
thanks!
the dominant view on put business logic models (so resides on server side). controllers focus on working endpoints , calling right model methods.
when find models getting "too fat", can recommend article you: http://blog.codeclimate.com/blog/2012/10/17/7-ways-to-decompose-fat-activerecord-models/
Comments
Post a Comment