🚀 𝗗𝘂𝗯𝗵𝗲 𝗘𝗻𝗴𝗶𝗻𝗲 𝗘𝘅𝗲𝗰𝘂𝘁𝗶𝗼𝗻 𝗠𝗼𝗱𝗲𝗹 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,16k
142
Innholdet på denne siden er levert av tredjeparter. Med mindre annet er oppgitt, er ikke OKX forfatteren av de siterte artikkelen(e) og krever ingen opphavsrett til materialet. Innholdet er kun gitt for informasjonsformål og representerer ikke synspunktene til OKX. Det er ikke ment å være en anbefaling av noe slag og bør ikke betraktes som investeringsråd eller en oppfordring om å kjøpe eller selge digitale aktiva. I den grad generativ AI brukes til å gi sammendrag eller annen informasjon, kan slikt AI-generert innhold være unøyaktig eller inkonsekvent. Vennligst les den koblede artikkelen for mer detaljer og informasjon. OKX er ikke ansvarlig for innhold som er vert på tredjeparts nettsteder. Beholdning av digitale aktiva, inkludert stablecoins og NFT-er, innebærer en høy grad av risiko og kan svinge mye. Du bør nøye vurdere om handel eller innehav av digitale aktiva passer for deg i lys av din økonomiske tilstand.