๐ ๐๐๐ฏ๐ต๐ฒ ๐๐ป๐ด๐ถ๐ป๐ฒ ๐๐
๐ฒ๐ฐ๐๐๐ถ๐ผ๐ป ๐ ๐ผ๐ฑ๐ฒ๐น
Logic and Data Decoupling Execution Flow
โ๏ธ In Dubhe Engine, business logic execution is completed by system modules, while state reads and writes are performed through Schema modules.
๐ This decoupling allows developers to independently evolve logic and data structures:
๐งฑ When Schema structures need expansion or modification, old data can be migrated to new Schema through migration scripts (such as migrate.move) and hot upgrade mechanisms provided by Dubhe.
Business logic changes can also be implemented by publishing new system module versions without affecting underlying storage layouts.
During execution, system modules cooperate closely with Schema modules.
๐ฆ For example, when system logic needs to create a new object instance, it actually calls Schema modules to create that object in on-chain resource storage and assign a unique key.
๐ When system logic queries or modifies attributes, it also accesses or updates corresponding fields through functions provided by Schema.
๐งฉ This pattern can be compared to Entity-Component-System (ECS):
-Schema defines components (data)
-System modules play systems (logic)
-Certain on-chain object IDs are similar to entities, Mounting different components to entities through dynamic fields.
๐ The result is higher modularity and upgradeability of on-chain state models while ensuring performance, similar to upgrading from manual low-level storage management to using high-level database ORM development experience.
@DubheEngine #DubheEngine #Sui #SmartContracts

2,98K
70
De inhoud op deze pagina wordt geleverd door derden. Tenzij anders vermeld, is OKX niet de auteur van het (de) geciteerde artikel(en) en claimt geen auteursrecht op de materialen. De inhoud is alleen bedoeld voor informatieve doeleinden en vertegenwoordigt niet de standpunten van OKX. Het is niet bedoeld als een goedkeuring van welke aard dan ook en mag niet worden beschouwd als beleggingsadvies of een uitnodiging tot het kopen of verkopen van digitale bezittingen. Voor zover generatieve AI wordt gebruikt om samenvattingen of andere informatie te verstrekken, kan deze door AI gegenereerde inhoud onnauwkeurig of inconsistent zijn. Lees het gelinkte artikel voor meer details en informatie. OKX is niet verantwoordelijk voor inhoud gehost op sites van een derde partij. Het bezitten van digitale activa, waaronder stablecoins en NFT's, brengt een hoge mate van risico met zich mee en de waarde van deze activa kan sterk fluctueren. Overweeg zorgvuldig of de handel in of het bezit van digitale activa geschikt voor je is in het licht van je financiรซle situatie.

