Where does business logic go in rails?

后端 未结 4 1322
借酒劲吻你
借酒劲吻你 2021-02-04 09:11

I\'m an ASP.NET MVC developer just starting with my first big project on rails however Im confused as where to put your business logic? on ASP.NET I create a library which conta

4条回答
  •  死守一世寂寞
    2021-02-04 09:29

    "Business Logic" or some might call it "Domain Logic" doesn't belong anywhere near Rails and/or your .NET MVC project. Rails and MVC should depend on your Domain not the other way around. I would recommend reading up on the Onion Architecture from Jeffery Palermo or watch "Architecture the Lost Years" by Robert Martin. (I think that's that talk anyway). There are probably more resources than that, but you'll thank yourself later for treating both Rails and .NET MVC like the 3rd party frameworks they are, and not the main house of your application.

提交回复
热议问题