|
4 | 4 | - DB |
5 | 5 | --- |
6 | 6 | # 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 | + |
0 commit comments