annotate docs/describe-data-struct.muse @ 96:1769e52bdd9d

Make dexfile_insert_class() pass the testcase
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 25 Jul 2011 16:49:28 +0800
parents e790c6b2d5d9
children
rev   line source
30
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
1 Data struct own some relation-ship or logics internally. Usually,
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
2 they are described in code spreaded over the project. The problem of
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
3 code is deattach relationships from the data struct. You don't see
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
4 the relationship with definition of data struct alone. You can also
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
5 not get the relationship from the code easily. So, we need a way
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
6 to describe relationship in the definition of data struct to attach
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
7 the information with data struct.
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
8
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
9 Attaching relationship is not only easy to read, but also parse-able.
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
10 Relationships are attached a part of definition of data struct. They
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
11 are not code, it means more easy to be parsed. A lot of code can be
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
12 generated automatically by tools.
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
13
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
14 Persisted data (in secondary storage) is usually a tree with reference
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
15 between branches while internal data struct is usually a group of
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
16 interconnected objects. We dont use persisted one directly because
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
17 they are more hard to be used. You need extra-logic to travel
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
18 persisted data struct. We need the code to convert persisted data
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
19 struct to internal one and in reversed, but it is tedious. With a
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
20 language to describe data struct with attaching relationship, we can
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
21 generate code for conversion of data struct from/to persisted to/from
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
22 internal ones.
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
23
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
24 ** Construction
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
25
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
26 - types
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
27 - relationships
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
28 - reference
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
29 - dependency
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
30 - constrain
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
31 - condition
e790c6b2d5d9 doc for data struct description
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
32 - path