RailsCasts Pro episodes are now free!

Learn more or hide this

Eugenijus Radlinskas's Profile

GitHub User: eugenijusr

Site: http://www.eugene.lt

Comments by Eugenijus Radlinskas

Avatar

My first thought also.

Coming from .NET/Java this was the first concern I had with Rails. Where does business logic go? I was baffled to find out there's no standard way of doing that. Sorry, but putting it into model code always seemed like a hack to me.

Service layer has been the industry standard of coding complex business logic for quite a while now. This vid is great, but it just scratched the surface. Imagine dealing with trees of business logic or testing parts of it in complete isolation by stubbing out the context. Exceptions, transactions, logging all managed automagically using AOP. Sigh... those were the days :)

Next up - moving the instantiation and lifetime management of these service objects to config or DSL using some dependency injection framework.