3 ms·
> If you want to not hate your life building a real-time multiplayer game, fully embrace data oriented design. I'd say if you want to not hate you life buildin
by bob1029 5y ago
> If you want to not hate your life building a real-time multiplayer game, fully embrace data oriented design.
I'd say if you want to not hate you life building any software, start with the data/schema/et. al. Before you open Visual Studio, open Excel and conference in your business stakeholders for a few design sessions.
We recently started down a "data-driven" path with our B2B application. We went from ~90% of the application being code-based to ~95% of the application being configuration-driven in a matter of months. We can bootstrap an entire customer's setup by doing some simple JSON copypasta now.
The best general model I have found so far would be to declare a global Domain type, and then put a List<T>/T of each constituent domain type within it. No nesting of complex types (reference types) should be permitted. All properties in the domain model types can map cleanly to/from SQL tables. The overall schema should be in 3NF/BCNF/DKNF. Relation types will be required. You can trivially serialize instances of the Domain type for whatever purpose. Each serialized copy of the Domain type can be thought of as a deterministic snapshot of all state, assuming you did everything correctly elsewhere.
Use of language features such as LINQ can make this approach almost fun to work with. A clean, well-managed schema is the most powerful tool in your box when dealing with complex problem domains.
- lostmsu 5y ago> We can bootstrap an entire customer's setup by doing some simple JSON copypasta now. This read badly. Why is JSON in the picture?
- bob1029 5y agoBecause with this model, it's a 1-liner to take an instance of our entire domain to/from a byte array. In situations where we have "bad things" happen, we can simply dump the entire domain instance to disk and then reload it on a dev machine.