Mercurial > paraspace
view docs/describe-data-struct.muse @ 48:3936d223989a
Introduce null_relocatable for any relocatable without real instance
- Some dex type does not own a real instance, it actually a generator of
child type.
- null_relocatable is used to classify types without real instance.
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Mon, 20 Jun 2011 13:34:47 +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