
Sarah
- how the database is organized
Entities, attributes, attribute types,
rules, behaviors, assemblies, query parameters
The database is divided into two sets of tables: the relationship
between entities, attributes, and attribute types and the relationship
between rules, behaviors, assembles, and query parameters. In case you
were wondering, “Sn” stands for SkyNet. When designing the tables, we
noticed that a class called “Attributes” already existed in MSDN, so as
a convention we added the letters “Sn” before all of the database
classes.
- what is stored in the database
Entities and Attributes
Many to Many Relationship
Entities can have many attributes
Attributes can be of many types
Entities and attribute type have a many to many relationship. Entities
can have many attributes and each attribute type can be used by many
attributes. For example, two fairies have an HP attribute and an MP
attribute. The HP and MP are attribute types and therefore there will
be two entries in the attribute type table. However, there will be four
entries in the attribute table because each fairy has its own HP and MP
values. The attribute table is a way of mapping two one-to-many
relationships into a many-to-many relationship to keep track of the
value of the attribute.
Type Safety
The type of the attribute value is specified by the attribute type
Two columns in the attribute table for attribute value
Edited Gentle code for placement, updating, and retrieval
The attribute value can either be a double or a string. The type of the
attribute value is specified by the attribute type. There are two
columns in the attribute table for attribute value: string value and
double value. By looking at the attribute type table, the Gentle code
is able to determine which column to place, update and retrieve the
attribute value.
Rules and Behaviors
Stored in database
Keyed by Name
Rules and behaviors are also stored in the stored in the database. They
are keyed by their name and mapped to the assembly table.
Assembly Table
Keyed by guid
Store the assembly filename
Pull rule/behavior from .dll