Getbeans / Beans

Beans WordPress Theme Framework. The default branch is set to development, please switch to the master branch for production.
https://www.getbeans.io
Other
392 stars 61 forks source link

Containerized Data & State Management Model #237

Open hellofromtonya opened 6 years ago

hellofromtonya commented 6 years ago

Data and state management are currently held in globals throughout the framework. Interaction with these are through private functions within each API.

The problem with globals is they are globally readable and writeable. The ability for any piece of code to overwrite the global models is problematic as it can lead to unpredictable behavior.

I propose that we build a Containerized Data & State Management Model with its own API to interact with it. This model will be OOP-based. Why? OOP is best suited for this type of modeling as it:

The goal here is to ensure Beans is highly robust and predictable. Care will need to be taken to ensure the new architectural is performant.

hellofromtonya commented 6 years ago

Status Update: I've built a prototype and am in the process of benchmarking it. Once it's ready, I'll create a PR for all of us to review and improve.