Mercurial > paraspace
view docs/describe-data-struct.muse @ 142:50d09eba5166
Fix the issue of getting negative indices for _DEX_ClassData.
- It caused by calling _optimize_classdata() at end of restore_dependencies()
while the values cames from depend_idx_rel.get_value(). The values had
been optimized.
- Solution is to get value from <child>.data_idx while unlinking.
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Mon, 15 Aug 2011 10:04:12 +0800 |
parents | e790c6b2d5d9 |
children |
line wrap: on
line source
Data struct own some relation-ship or logics internally. Usually, they are described in code spreaded over the project. The problem of code is deattach relationships from the data struct. You don't see the relationship with definition of data struct alone. You can also not get the relationship from the code easily. So, we need a way to describe relationship in the definition of data struct to attach the information with data struct. Attaching relationship is not only easy to read, but also parse-able. Relationships are attached a part of definition of data struct. They are not code, it means more easy to be parsed. A lot of code can be generated automatically by tools. Persisted data (in secondary storage) is usually a tree with reference between branches while internal data struct is usually a group of interconnected objects. We dont use persisted one directly because they are more hard to be used. You need extra-logic to travel persisted data struct. We need the code to convert persisted data struct to internal one and in reversed, but it is tedious. With a language to describe data struct with attaching relationship, we can generate code for conversion of data struct from/to persisted to/from internal ones. ** Construction - types - relationships - reference - dependency - constrain - condition - path