Skip to content

Commit 6d5ebe0

Browse files
Methodology notes - 1 & 2
1 parent c024bf5 commit 6d5ebe0

28 files changed

+264
-0
lines changed
942 KB
Binary file not shown.

OMSCS/Courses/DB/Methodology 1 - Analysis.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,99 @@ tags:
44
- DB
55
---
66
# Methodology 1 - Analysis
7+
## Assumptions
8+
- business processes are well-designed
9+
- documents are known
10+
- Anything input to or output from the application(s) that run(s) on the DB
11+
- tasks are known
12+
- any processing that takes place using those documents
13+
- any processing that takes place which generates those documents
14+
- any processing that takes place which updates those documents
15+
- system boundary is known
16+
- "Where does the application(s) end, and where do external stakeholders begin?"
17+
- one database schema unifying all views can be designed
18+
- difficult: interests, goals, power, politics
19+
- problems with the methodology?
20+
- problems with the organization?
21+
- "organization: an entity created to pursue a shared set of goals"
22+
- "It is ALWAYS a problem with the organization."
23+
24+
## The Software Process
25+
Waterfall
26+
- business process (re-)design
27+
- ***analysis***
28+
- ***specification***
29+
- ***design***
30+
- ***implementation***
31+
- testing
32+
- operation
33+
- maintenance
34+
35+
The "bol-talic-ized" terms are the subject of this course.
36+
37+
## Overview of the Methodology: Data First!
38+
- In general software development processes, the process comes first.
39+
- In DB development, it's data first. Once the data is designed, we hang the processes on where they fit.
40+
41+
![[Pasted image 20250917205917.png]]
42+
43+
## Example
44+
[[GTPEgtonline_description.pdf]]
45+
46+
## Information Flow Diagram (IFD)
47+
![[Pasted image 20250917210449.png]]
48+
49+
- boxes are document names
50+
- boxes can be input and/or output documents
51+
- ovals are task names
52+
- tasks can interact with multiple documents
53+
- arrows represent information flow
54+
- broken line represents the system boundary
55+
- the central feature is the database, represented as a box
56+
- this is NOT a control flow diagram
57+
- never connect 2 documents
58+
- never connect 2 tasks
59+
60+
## Requirements (Example)
61+
- Users must log into the system via the Login screen
62+
- inputs: email, password
63+
- buttons: register, login
64+
- purely an input document
65+
- New users must register first
66+
- inputs: first name, last name, email, password, confirm password
67+
- buttons: cancel, register
68+
- purely an input document
69+
- Users are able to edit their profile
70+
- Many different fields, many different types of fields
71+
- This is an input and output document
72+
- User profiles contain professional information and educational information
73+
- DB maintains list of employers
74+
- DB maintains list of schools
75+
- Rapid fire
76+
- search screen is an output document
77+
- "request new friend" screen is an input document
78+
- friend request status screen? input and output document
79+
- friend list form is an output document
80+
81+
## IFD (Example)
82+
![[Pasted image 20250917211421.png]]
83+
84+
## Word of Advice
85+
- START with the documents.
86+
- DON'T start with the TASKS.
87+
88+
## Specification
89+
- EER Diagram
90+
- Data Formats
91+
- Constraints
92+
- Task Decomposition
93+
94+
## Document Specification
95+
- What goes into the database?
96+
- What comes out of the database?
97+
- These are mechanical steps to take the "art" out of database specification creation.
98+
- Everything in the database must come from somewhere.
99+
- Everything on the input documents must go somewhere.
100+
- Everything in the database must be used for something.
101+
- Everything on the output documents must come from somewhere.
102+

OMSCS/Courses/DB/Methodology 2 - Specification.md

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,171 @@ tags:
44
- DB
55
---
66
# Methodology 2 - Specification
7+
Ref: [[GTPEgtonline_description.pdf]]
8+
## Login Screen and Registration Screen (Example)
9+
> Requirement: All **Users** are uniquely identified by their **Email Address**. Providing a valid **Email Address** and **Password** combination will log the user into the system.
10+
11+
![[Pasted image 20250917212348.png]]
12+
13+
## Use Attribute Names
14+
- Use the attribute names from the documents in the EER diagram.
15+
- We want the EER diagram to become a high quality model of reality.
16+
17+
![[Pasted image 20250917212813.png]]
18+
19+
![[Pasted image 20250917212800.png]]
20+
21+
## Users vs Admins (Example)
22+
> Requirement: All **Users** (except **Admin Users**) have a profile containing basic information about them.
23+
24+
![[Pasted image 20250917212915.png]]
25+
26+
> Requirement: Admin users have some of the same information as regular users (\[fields listed here\]), but do not have a full profile and cannot request friends. A user must be either an admin or a regular user, but never both. Admin users also record the datetime that they were last logged in to the system.
27+
28+
## Education Section of a User Profile (Example)
29+
> Requirement: A list of **Schools** from which the user can select, is maintained in the system. Assume that all **School Names** will be unique. A user can have any number of schools associated with their profile, and can provide a **Graduation Date** for each school. It is possible that the same school will appear multiple times with different graduation dates.
30+
31+
![[Pasted image 20250917213115.png]]
32+
33+
![[Pasted image 20250917213131.png]]
34+
35+
> Requirement: Each school must have a **School Type**. There are 4 possible types \[listed here\]. It should be possible for the DB admin to add new school types from behind the scenes.
36+
37+
![[Pasted image 20250917213919.png]]
38+
39+
![[Pasted image 20250917213929.png]]
40+
41+
## Professional History of a User Profile (Example)
42+
> Requirement: Admins are responsible for managing the list of **Employers**. Assume that all Employers have a unique **Name**.
43+
44+
![[Pasted image 20250917214625.png]]
45+
46+
> Requirement: The **Job Title** field is not managed by the administrator and can be any value provided by the user. A profile can contain multiple **Employers** and the same **Employer** may even appear multiple times as long as the **Job Title** is different in each case.
47+
48+
![[Pasted image 20250917214728.png]]
49+
50+
## Friendship (Example)
51+
> Requirement: **Friendship** is not always reciprocal. Just because Emily is friends with Sarah, this does not imply that Sarah is friends with Emily. The **DateConnected** field is set when the friend request is accepted, not when the request is originally sent.
52+
53+
![[Pasted image 20250917214858.png]]
54+
55+
## EER Diagram (Example)
56+
![[Pasted image 20250917214925.png]]
57+
58+
![[Pasted image 20250917215129.png]]
59+
60+
## Data Formats - beg, steal, borrow
61+
![[Pasted image 20250917215222.png]]
62+
63+
User
64+
- Email: max 36 characters
65+
- Password: max 20 characters
66+
- Name:
67+
- FirstName: max 25 characters
68+
- LastName: max 40 characters
69+
- Addresses (when needed) are very very difficult (USPS Publication 28: https://pe.usps.com/text/pub28/welcome.htm)
70+
71+
Regular User
72+
- Birthdate: Date
73+
- Sex: {M, F}
74+
- Current City, Home Town: max 20 chars each
75+
- Interests: multi-value with 16 characters each
76+
77+
Beg, Steal, Borrow: If someone has already spent a lot of time developing a specific data format, why would you replicate that work to create something bespoke?
78+
79+
## Constraints
80+
Examples:
81+
- Date Connected is NULL until request is accepted.
82+
- Cannot be Friend with yourself.
83+
- Users can only comment on Status of Friends.
84+
85+
Already Covered, i.e. DON'T include these when enumerating constraints of the application.
86+
- Data formatting constraints
87+
- Constraints that can be expressed in the EER Diagram
88+
89+
These are constraints that cannot be (easily) programmed into the schema of the database, and therefore must be encoded/handled by the software application.
90+
91+
## Task Decomposition
92+
- Look at each task in the IFD. Is that task a single task, or can it be broken down into multiple tasks?
93+
- Rules of thumb
94+
- Lookup vs modify (insert, delete, and/or update)? (different database locks)
95+
- How many schema constructs are involved? (many database locks)
96+
- Are enabling conditions consistent across tasks? (let run what can run - scheduling)
97+
- Are frequencies consistent across tasks? (index only what must be indexed)
98+
- Is consistency essential?
99+
- ACID transaction properties
100+
- Bank transfer requires high consistency, for example
101+
- Is mother task control needed or not?
102+
103+
## Web Apps vs Traditional Apps
104+
- Web apps
105+
- Traditionally, almost stateless
106+
- must have some state (e.g. login sessions)
107+
- May need some click stream history.
108+
- Web 2.0 and AJAX technologies provide more rich user interface in Web browser.
109+
- Traditional apps
110+
- in a traditional app, it is much easier to manage local state separately from the DB
111+
- a whole slew of changes can be collected before submitting them all to the DB
112+
- Supports better control of ACID transaction execution
113+
114+
## View Profile Task Decomposition (Example)
115+
View Profile
116+
- three lookups for a Regular User
117+
- Personal Information
118+
- Education Information
119+
- Professional Information
120+
- all three are
121+
- read-only
122+
- enabled by a user's login or a friend's lookup
123+
- same frequency
124+
- several different schema constructs are needed
125+
- consistency is not critical, even if the profile is being edited by the user while a friend is looking at it
126+
- They can be done in any order
127+
- all three must be done in order to display the View Profile view, so a mother task is needed.
128+
- Should be decomposed into 3 sub tasks.
129+
130+
![[Pasted image 20250917220858.png]]
131+
132+
**View Profile - Abstract Code**
133+
- Find the current User, using the User Email
134+
- Display User Name
135+
- Find the current RegularUser using the User Email
136+
- Display RegularUser Sex, Birthdate, CurrentCity, Hometown, and Interests
137+
- Find each School for the Regular User
138+
- Display SchoolName and YearsGraduated
139+
- Find SchoolType
140+
- Display SchoolType Name
141+
- Find each Employer for the RegularUser
142+
- Display Employer Name and JobTitles
143+
144+
![[Pasted image 20250917221129.png]]
145+
146+
## Edit Profile Task Decomposition (Example)
147+
- Lookups of Personal, Education, and Professional information of a Regular User (use: **View Profile** task)
148+
- Lookups of School and Employer lists
149+
- Edits of Personal, Education, and Professional information
150+
- Read, insert, delete, and update
151+
- All three are enabled by a user's login and separate edit request
152+
- Different frequencies (in which fields are edited)
153+
- Several different schema constructs are needed
154+
- Consistency is not critical, even if the profile is being looked at by a friend of the user
155+
- Lookup done first followed by any number of edits and lookups
156+
- Mother task is needed
157+
- **Must be decomposed into sub tasks**
158+
159+
![[Pasted image 20250917222356.png]]
160+
161+
![[Pasted image 20250917222445.png]]
162+
163+
## Task Decomp Friend Requests etc.
164+
![[Pasted image 20250917222518.png]]
165+
166+
167+
168+
169+
170+
171+
172+
173+
174+
372 KB
Loading
241 KB
Loading
209 KB
Loading
288 KB
Loading
288 KB
Loading
37.8 KB
Loading
75.7 KB
Loading

0 commit comments

Comments
 (0)