Welcome Guest, Not a member yet? Register   Sign In
Entities and pivots
#6

Not trying to beat the dead horse, but I keep coming back to this. While I like the method you outlines generally, it still feels a little weird passing around an array of modified objects with their pivots injected. Without trying to create an ORM, I've been thinking about single-run storehouse idea ("cache lite"), where anytime an entity needed its relations it would check the storehouse first before calling the DB. That way you could still preload a batch of them and save the multiple database calls, and the relations would be available anywhere for that run.
I'm curious what you (and others) think. Right now I'm coding the storehouse as a static property of any model that needs it, but considering it as a separate library.
Reply


Messages In This Thread
Entities and pivots - by MGatner - 03-08-2019, 12:39 PM
RE: Entities and pivots - by MGatner - 03-10-2019, 10:26 AM
RE: Entities and pivots - by MGatner - 03-27-2019, 04:40 PM
RE: Entities and pivots - by kilishan - 03-27-2019, 07:17 PM
RE: Entities and pivots - by MGatner - 03-28-2019, 04:59 AM
RE: Entities and pivots - by MGatner - 04-12-2019, 06:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB