[21:35:16] 1. Controllers call out to a repository to answer questions (like give me comments for a post, or are there any active users)
[21:35:27] so the repositories contain those business rules
[21:35:37] the entities (orm models) contain the application agnostic business rules
[21:35:42] like what makes a valid person
[21:36:09] 2. The repository interacts with the ORM to get the entities
[21:36:42] 3. The controller is merely responsible for processing the request, calling out to the appropriate repositories, and constructing the response
[21:36:52] All of the interactions are injected of course
[21:37:17] Just FYI
[21:39:32] GDmac: Controllers contain application specific business logic that needs to be tested without the DB
[21:39:48] GDmac: Entities contain application agnostic business logic that also needs to be tested without the DB
[21:40:26] GDmac: So I inject the repository into the controller and the entities know nothing of databases
[21:45:33] Meroje: Notice the repo, it's MySQLAccount
[21:46:00] if I wanted to switch to Mongo, I just write a new derivative of AccountRepository called MongoAccount
[21:46:24] that also allows me to mock the repo in my tests so that I don't need the DB
[21:47:47] Meroje: I'll probably make it responsible for saving too, but I'm not sure yet.