🚀 𝗗𝘂𝗯𝗵𝗲 𝗘𝗻𝗴𝗶𝗻𝗲 𝗘𝘅𝗲𝗰𝘂𝘁𝗶𝗼𝗻 𝗠𝗼𝗱𝗲𝗹
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,973
70
本頁面內容由第三方提供。除非另有說明,OKX 不是所引用文章的作者,也不對此類材料主張任何版權。該內容僅供參考,並不代表 OKX 觀點,不作為任何形式的認可,也不應被視為投資建議或購買或出售數字資產的招攬。在使用生成式人工智能提供摘要或其他信息的情況下,此類人工智能生成的內容可能不準確或不一致。請閱讀鏈接文章,瞭解更多詳情和信息。OKX 不對第三方網站上的內容負責。包含穩定幣、NFTs 等在內的數字資產涉及較高程度的風險,其價值可能會產生較大波動。請根據自身財務狀況,仔細考慮交易或持有數字資產是否適合您。

