๐Ÿš€ ๐——๐˜‚๐—ฏ๐—ต๐—ฒ ๐—˜๐—ป๐—ด๐—ถ๐—ป๐—ฒ ๐—˜๐˜…๐—ฒ๐—ฐ๐˜‚๐˜๐—ถ๐—ผ๐—ป ๐— ๐—ผ๐—ฑ๐—ฒ๐—น 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,17ย rb
142
Konten pada halaman ini disediakan oleh pihak ketiga. Kecuali dinyatakan lain, OKX bukanlah penulis artikel yang dikutip dan tidak mengklaim hak cipta atas materi tersebut. Konten ini disediakan hanya untuk tujuan informasi dan tidak mewakili pandangan OKX. Konten ini tidak dimaksudkan sebagai dukungan dalam bentuk apa pun dan tidak dapat dianggap sebagai nasihat investasi atau ajakan untuk membeli atau menjual aset digital. Sejauh AI generatif digunakan untuk menyediakan ringkasan atau informasi lainnya, konten yang dihasilkan AI mungkin tidak akurat atau tidak konsisten. Silakan baca artikel yang terkait untuk informasi lebih lanjut. OKX tidak bertanggung jawab atas konten yang dihosting di situs pihak ketiga. Kepemilikan aset digital, termasuk stablecoin dan NFT, melibatkan risiko tinggi dan dapat berfluktuasi secara signifikan. Anda perlu mempertimbangkan dengan hati-hati apakah trading atau menyimpan aset digital sesuai untuk Anda dengan mempertimbangkan kondisi keuangan Anda.