英国 software engineering 课程作业样本 Modeling languages
原站著录信息
摘要
Chapter 2 Functional Analysis "A picture is worth thousand words". This old truth has been embraced by software modeling language. Modeling languages are visual but supplemented with text. Sometimes, a graphical model needs to be further clarified to avoid mis…
Chapter 2 Functional Analysis
"A picture is worth thousand words". This old truth has been embraced by software modeling language. Modeling languages are visual but supplemented with text. Sometimes, a graphical model needs to be further clarified to avoid misinterpretation.
A diagram is a graphical view of a model that displays software symbols. Each diagram represents different aspects of the model or represents the model at a different level of abstraction.
A general division of diagrams distinguishes among diagrams capturing a systems state, behavior and state changes.
2.1 Data Flow Modeling
Undoubtedly, data flow diagrams (DFDs) are one of the most popular modeling techniques in the history of software engineering.
Context DFD
The purpose of the context data flow diagram is to show the scope of the system.
The following context DFD was created based on the literature review, the model of travel decision behavior show in figure 1-1.
Figure 2-1 Context DFD
Level-0 DFD
The next step after a context diagram is to focus on further details of the system. A level-0 diagram represents a system’s major processes, data flows, and data stores at a high level of detail (Valacich, George, and Hoffer, 2001).
Figure 2-2 Level DFD
2.2 Entity - relationship (ER) modeling
Entity - relationship modeling is a data modeling technique which has been popularized by structured analysis and design and which remains a popular technique for modeling database structures at higher levels of abstraction.
ER models are presented visually as entity - relationship diagrams (ERDs). The diagrams define three modeling elements: entities relationships and attributes.
Figure 2-3 Entity relationship diagrams for the MCEOS project
Entity
An Entity Set is a class of Entity Instances which are of interest to the database owner and about which the owner keeps information and which share common data characteristics, in this project e.g. Tour, Customer
Attributes
These are the characteristics of entity types whose values are stored in the database, In this project e.g. Tour Code, Sex, Address
Relationships
This is an association between two or more entity sets, in this project e.g. Customer browse Tour information.. Relationships may link instances of two different entity type..
One to Many Relationships (1:N) The most common relationship is 1:N, where precisely one instance of one entity type is linked to many instances of the other entity type. In this project,
Examples
1 Customer choose Many Tour Orders
Many : Many Relationships (N:M)
These commonly occur, e.g.
Many Customers browse Many Tours information
After analyzing, the researcher shows the data Model by ERD in Figure 2.4
Figure 2.4 Magic Cities European operation system data model
Chapter 3 Technical Design
The chapter pertains to how the processes will accomplish the various functions as outlined in Chapter 2 and the basic design of the DB (normalized ERD) with attribute types and meta data description.
3.1 Definition of terms
Now, first a few definitions about database normalization:
A Data Model introduced by E.F. Codd in 1959/1970, particularly well suited for business data management. In this model, data are organized in tables. The set of names of the columns is called the "schema" of the table.". The work of E. F. Codd, and also Chris Date, is based on relational algebra, which is well outside the scope of this article.
Database Normalization: A series of steps followed to obtain a database design that allows for efficient access and storage of data in a relational database. These steps reduce (should eliminate) data redundancy and the chances of data becoming inconsistent.
A table in a relational database is said to be normalized if it satisfies 1st normal form. The higher normal forms deal with different levels of redundancy elimination. Codd's original work defined three such forms, but there are now five (and a 6th coming up) generally accepted steps of normalization.
The output of the first step is called First Normal Form (1NF), the output of the second step is Second Normal Form (2NF), etc.
Another profitability from the normalization process is that a normalized database is much easier to write code against. This first lecture will step through the 3 different normal forms which are generally accepted as useful to comply with in database design.
The Three Normal Forms; Formal Definitions
These formal definitions are taken from the book by Chris J. Date: An Introduction to Database Systems Volume 1 4th edition, © 1996, Addison-Wesley Publishing Co., Inc., Reading, Massachusetts.
First Normal Form
‘A relation R is in first normal form (1NF) if and only if all underlying domains contain atomic values only.’
Second Normal Form
‘A relation R is in second normal form (2NF) if and only if it is in 1NF and every non-key attribute is fully dependent on the primary key.’
Third Normal Form
‘A relation R is in third normal form (3NF) if and only if it is in 2NF and every non-key attribute is non-transitively dependent on the primary key.’
3.2 What does it mean to normalize a Database
Database normalization can best be characterized as the process of organizing a database. The goal of normalization is to reduce problems with data consistency by reducing redundancy.
Figure 3.1 shows the ERD (Entity Relationship Diagram) for the Magic Cities European Data model that was introduced in Chapter 2, Notice the relationship between the Customers and Tour Order tables. As a quick review of how relationships work in a relational database, the primary key of the parent table is carried in the child table as the foreign key. In this case, the Customer ID field is carried in the Tour Orders table. This is how order records for a specific customer can be associated with that customer.
Figure 3.1 The Entity Relationship Diagram for the Magic Cities European shows a relationship between customers and Tour orders.
It seems clear that if the researcher has only one instance of a given data element in a database, it leaves nothing to interpretation and guesswork. When researcher updates First Name in the Customers table, The researcher can be sure that every report that relies on First Name will be accurate and up to date. Why? Because First Name is not carried redundantly in the database, and as a result, consistency is ensured. The same concept can be seen throughout the data model in Figure 3.1. Greater consistency through the elimination of redundancy—this is the goal of normalization!
3.3 Steps to Normalize Data Model
All the attributes the researcher had identified for a given entity are probably grouped together in a flat structure. This is where the process of normalization comes into play — to organize the attributes. The researcher begins by taking the previous structure and placing it into the first normal form.
3.3.1 First Normal Form: Eliminating Repeating Groups
The first normal form (1NF) involves the removal of repeating groups. The question remains, "What is a repeating group?" The previous example has two repeating groups: contacts and category. Remember, for a given customer, one or more contacts and one or more categories can exist.
To illustrate the normalization process, the researcher considers the following list of un-normalized data items: Organized tour table
• Tour Code (primary key)
• Tour Name
• Transportation
• Place Name (one to many)
• Date
• Interests Name (which describe cultural interest, for example, galleries, museum, buildings, music events, etc.)
For each repeating group one encounter, the repeating group is moved to a separate table. In thi
全文与附件
提交申请后,可在会员中心查看原件和附件的查找进度。
