-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Collections, relationships and intersections are corners stones of Stem however there is a continued momentum away from 'smart' models and event driven business logic in favour of declarative forward calculating logic using simpler data containers - entities or POPOs (plain old PHP objects).
Our models are heavy and have provision for a lot of features that are no longer recommended practice. They hide too much behaviour in their internals meaning the consequence of changing properties can't be predicted. The event driven nature also means that cascade effects (one small change causing a performance draining rain of database hits as model after model takes the opportunity to update itself). Often this behaviour is required - those models do need updated - but perhaps more often they are unintended consequences of one small action.
The biggest problem is a lack of control - the developer can't reliably see or predict what's going to happen when they change a property or save the model.
I'm proposing a shift to making Stem hydrate simple POPOs. This would retain all of the power of collections, intersections, schemas and relationships but provide a much lighter vehicle for data movement.
This would also allow the main business logic for an application to be framework agnostic and require no additional plumbing to migrate those objects in and out of the framework.
No doubt there are many other suggestions for improving the expressiveness and efficiency of Stem - please get all your ideas down here, preferrably with code snippets of how you would see that change being worked out in practice.