Replies: 3 comments
-
Currently, root-state is operated through the following two types of interfaces - op-envThe op-env for root-state can be obtained in the following way
The limitations of this method of operation are as follows:
- accessorYou can get the accessor of the root-state in the following way
The limitations of this operation are as follows:
Therefore, adding set_object_by_path to the accessor you mentioned is equivalent to providing a mechanism to modify root-state across zones, which conflicts with our design principle "root-state can only be modified in the same zone". If we add a set_object_by_path to the accessor, we need to have a different permission design |
Beta Was this translation helpful? Give feedback.
-
From the perspective of a DecApp developer, manipulating data only within zones: When not using accessorStoring an object to the root-state:
Read an object from the root-state:
These two operations are the most common operations of writing and reading data in DecApp development. When accessor is usedthe read operation will become: This obviously reduces the complexity and understanding cost of the read data code I mean, is it possible to provide a similar function to make the code that writes data also less complex and less expensive to understand? |
Beta Was this translation helpful? Give feedback.
-
From the point of view of improving the ease of use of the interface, adding such an interface as For example, the issue mentioned in #189 , is the optimization of the op-env, in fact, it already contains part of the logic inside your requirements, if this optimization layer is provided, your sequence of operations will also be simplified Regarding the integration of global-state and non related operations, such as providing About how to design |
Beta Was this translation helpful? Give feedback.
-
Now we have the function get_object_by_path(path: impl Into) -> BuckyResult that gets the object itself directly from the root-state's path.
How about a function like this, providing a set_object_to_path? Put object to noc and set it to a path in root-state
I think it should be common to insert an object into the noc and bind it to the root-state
Beta Was this translation helpful? Give feedback.
All reactions