π πππ―π΅π² ππ»π΄πΆπ»π² ππ
π²π°πππΆπΌπ» π πΌπ±π²πΉ
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

11.15K
142
The content on this page is provided by third parties. Unless otherwise stated, OKX is not the author of the cited article(s) and does not claim any copyright in the materials. The content is provided for informational purposes only and does not represent the views of OKX. It is not intended to be an endorsement of any kind and should not be considered investment advice or a solicitation to buy or sell digital assets. To the extent generative AI is utilized to provide summaries or other information, such AI generated content may be inaccurate or inconsistent. Please read the linked article for more details and information. OKX is not responsible for content hosted on third party sites. Digital asset holdings, including stablecoins and NFTs, involve a high degree of risk and can fluctuate greatly. You should carefully consider whether trading or holding digital assets is suitable for you in light of your financial condition.

