Let’s start from separation of concerns:
Model - is something that is considered serializable by nature, basically it’s used to establish API contract between software’s, that’s why doing this:
Considered as bad practice e.g. adding business logic to a model:
Adding business logic to a model is often discouraged because it violates the Single Responsibility Principle (SRP). When a model handles both data structure and complex rules, it becomes a “God Object”—too large, hard to read, and difficult to maintain.
You have to think about model as something you should keep a description of stuff you want to build from it.
Let’s move on:
You are seeding random in the model, but WHY? And from why I mean its kind of anti-purpose of model. Like you create a runtime that seeds random to model, instead your business logic should look for a seeder (that is something in runtime) and get current seed from it.
The model is something like a repository, you don’t want to send real-time changes to it, instead you want a cleanly separated series of commits - undo/redo.
E.g.:
Let’s imagine we have a slider, user moves slider in real-time what would you want to send to model?
- A real-time value
- A result of slider movement (e.g. the slider position when user released the slide)
You see what i’ve seen in your patch is some general misconceptions:
- Model entries - describe structure
- Runtime entries - something running in background e.g. texture sources, generators (correct me if i’m wrong)
- UI - kind off model representation that should operate on scopes, e.g fetch data from model hold real-time update call business logic
- Business logic - something that should glue this all together
The application normally has few states, like a immediate state, is where all the widgets are and a deferred one where the model is… The immediate state is a composition of a lot of smaller slices, where each slice responsible for some part of the state, where the deferred keeps whole structure, and based on deferred state the immediate should be created…
Idk i’ve checked this model runtime stuff by dottore it didn’t gave me the clear view in terms of separation of concerns. Maybe you can describe whole thing as some sort of user flow scenario so we can start from that? Or i do miss something here…
Like I want user to draw a circle, we want drawn circle to receive a seed from runtime, or we want for circle to have something updated in runtime what happens next…