iroha
iroha copied to clipboard
[refactor]: Shallow objects in `data_model`
Currently objects in data_model
are nested. Domain
s contain Account
s and AssetDefinition
s inside it, Account
s contains Asset
s and Role
s and so on.
We should consider making objects shallow: so that all Asset
s would be sotred in the single place and only reference owner Account
by it's AccountId
.
This way iteration over objects will be more effective.
As a sidenote such structure more closely resemble data organization typically encountered in relational databases.
let's consider after new wsv
Another benefit comes from how our new state works, which favors granular updates to avoid extensive cloning.
First PR was merged.
Apparently, we're moving to a sort of static Entity-Component-System / Struct of Arrays, so all data model structs should eventually disappear.
This issue is about how the code should be structured. PR's containing these changes have been merged already. Therefore the issue is closed.