How the Database is Organized - Software Engineering Methodology | COMP 410, Study notes of Software Engineering

Material Type: Notes; Professor: Wong; Class: SOFTWARE ENGINEERING METHODOLOGY; Subject: Computer Science; University: Rice University; Term: Spring 2006;

Typology: Study notes

Pre 2010

Uploaded on 08/16/2009

koofers-user-jlr-1
koofers-user-jlr-1 🇺🇸

10 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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
pf3
pf4
pf5

Partial preview of the text

Download How the Database is Organized - Software Engineering Methodology | COMP 410 and more Study notes Software Engineering in PDF only on Docsity!

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

The assembly table maps a guid to the path name of a .dll. A .dll can store rules, behaviors, or both.

  • how we search for everything, and how it is returned Querying Attribute types Entities Behaviors Rules By using the database adapter and different parameters, the model is able to query the database for lists of attribute types, entities, behaviors, rules. Attributes Add attribute type Get attribute type from string name or guid Get all attribute types Attribute types must be added to the database first before an entity and its attributes can be added. One can query an attribute type be its name or guid. You can also ask for a list of all of the attribute types currently in the database. Entities By attribute type (string and guid) By range of attribute value (of double type) You can query for a list of entities that have attributes of the same type. The type can be given as a string or a guid. You can also search for entities that have attribute values that fall within a specific range. For example, Behavior By name Behaviors can be queried simply by their names. John (I know this isn’t a clear division between speaking parts, but do you have any other ideas as to how we should do it.) Rules Mapping Behaviors Area of influence Two other search parameters Querying rules is a little different. While entities are just a collection of data, rules are defined in code. Also the querying parameters are independent of the rule itself. For example, you can query rules by their area of influence. However, a rule that alters a

Use this tool to generate Gentle.Net code In order to create the database classes, we first designed the tables in SQL Server Management Studio. We then used MyGeneration to generate the Gentle.Net code. Since there is already a tool to generate the code, there was no use in wasting time writing it ourselves.

  • how we have a database adapter so that the database can be switched in and out without affecting everything else To initialize, the DatabaseAdapter requires a string to the path of the database script. If the database back end need to be changed, only the database script and the concrete implementation of the database adapter need to be changed. Because the Interface to the database adapter remains the same, everything will work as before. Here are all of the possible graphics you can use. I don’t know how these will be physically arranged for the text, but at least you know some selection.