In ASP.NET MVC applications and Java web applications, there's a common practice of keeping business logic in a separate package/dll and treating things like the database and delivery mechanisms (web application, web service, native mobile or desktop, etc.) as details that are plugged in.
Some of the advantages of this type of structuring I can tell are:
- Reuse of the business logic with different delivery mechanisms or persistence layers
- It's possible to run acceptance and unit tests of the business logic without having to load up a web framework or connecting to a database; the tests are very fast
- Thinking of the application in terms of what it is, not how it is delivered
But this practice is not common in the Rails community; I don't see any Rails application where the business logic is kept in gems and the main ORMs all tie together persistence logic and business logic. Is there something about Ruby that makes structuring applications in the way I mentioned unnecessary?