🚀 𝗗𝘂𝗯𝗵𝗲 𝗘𝗻𝗴𝗶𝗻𝗲 𝗘𝘅𝗲𝗰𝘂𝘁𝗶𝗼𝗻 𝗠𝗼𝗱𝗲𝗹 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,21 tn
142
Innehållet på den här sidan tillhandahålls av tredje part. Om inte annat anges är OKX inte författare till den eller de artiklar som citeras och hämtar inte någon upphovsrätt till materialet. Innehållet tillhandahålls endast i informationssyfte och representerar inte OKX:s åsikter. Det är inte avsett att vara ett godkännande av något slag och bör inte betraktas som investeringsrådgivning eller en uppmaning att köpa eller sälja digitala tillgångar. I den mån generativ AI används för att tillhandahålla sammanfattningar eller annan information kan sådant AI-genererat innehåll vara felaktigt eller inkonsekvent. Läs den länkade artikeln för mer detaljer och information. OKX ansvarar inte för innehåll som finns på tredje parts webbplatser. Innehav av digitala tillgångar, inklusive stabila kryptovalutor och NFT:er, innebär en hög grad av risk och kan fluktuera kraftigt. Du bör noga överväga om handel med eller innehav av digitala tillgångar är lämpligt för dig mot bakgrund av din ekonomiska situation.