- 1. Requirements 06
- 2. Use Attribute Names
- 3. Requirements 07
- ➡️Identified Entities | LineDance
- 4. Requirements 08 - Edit Profile
- 5. Requirement 08.1 - Edit Profile
- 6. Requirements 09 - Request/Accept Friendships
- 7. EER (Extended Entity Relationship) Mapping
- 10. Constraints
- 11. ➡️Task Decomposition
- 🚩Rules of Thumb
- (1) Lookup vs Insert, Delete, and Update?
- (3) Are Enabling Conditions Consistent Across Tasks?
- (5) Is Consistency Essential?
- (2) How Many Schema Constructs are Involved?
- (4) Are Frequencies Consistent Across Tasks?
- 👀(6) Is Mother Task Control Needed Or Not?
- ❓12. Web Apps versus Traditional Apps
- Web Apps
- Traditional Apps (sowas wie ACCESS DB?) (Oder eine alte, native App?)
- 13. Task Decomposition | View (Screen) Profile V2.0 (LineDance : HomeScreen)
- Decomposition of LineDance Home Screen Tasks
- 14. Abstract Code | View (Screen) Profile V2.0
- (1) Personal
- (2) Education
- (3) Professional
- Abstract Code of LineDance Home Screen Tasks
- (1) Earned Badges
- (2) Proposed Dances
- (3) Search
- (3) Choose (from Random List)
- 15. Task Decomposition | View (Screen) Edit Profile V2.0
- 👀+++ LineDance | How is the Badges/Achievements domain (Is domain the right expression? Nope?) Edited? How Do I Need to Decompose?
- Rules of Thumb
- 17. Task Decomposition | Friend Requests V2
- 18. Specification
1. Requirements 06
Professor has chosen to introduce the composite Name composed of FirstName and LastName.
2. Use Attribute Names
Sex, BirthDate, CurrentCity, and HomeTown are all single-value property types. Interests is a multi-value property type modelled by the double ellipse.
Notice, that I am very careful to use the names that are provided in the Requirements Specification documents in my EER diagram. That way I tie the diagram very, very closely to document. The idea is that the EER really becomes a high-quality model of reality. Reality represented by the documents
3. Requirements 07
The Users actually have 2 subtypes: RegularUsers and AdminUsers
Requirement: All GTONline Users (except Administrative Users) have a profile containing basic information about them.
What do we learn from that?
We learn that they are not just Users, they are also AdminUsers. The way we specifiy this, is as follows:
Administrative Users have some of the same information as regular users (Email Adress, Password, FirstName, and LastName) … but do not have a full profile and cannot request friends etc. A user must be either an administrator or a regular user, but never both. GTOnline also tracks the last date and time that an admin user logged in to the system …
Because of this requirement, it makes sense to keep the entitiy User, and then divide it into two subsets RegularUser and AdminUser with different properties.
➡️Identified Entities | LineDance
On the HOME screen users get a list of proposed dances of 3-5 songs to dance several times - either serial or each song/dance one after another. They can choose to look at a YouTube video and/or - before or after that - on a teaching video. Each viewed dance shall be noted as an achievement. Groups of achievements lead to publishing badges. These badges - if any - shall be displayed in a list of badges at the top of the HOME screen. Below the list of proposed dances the user sees a random list of dance titles, in which she can choose another dance, if she does not want to stick to the proposal.
The random list dance titles shall be searchable and able to be chosen according to the dance level of the line dancer. Thus the dances within the list of proposed dances are chosen from (a) current dance level of the user (settings) and (b) achievements.
Achievements reflect how often a user has exercised a certain dance (repetitions). After xxx repetitions, this dance gets a lower priority (5 priorities) and will get a lower listing place in list of proposals. All dances without any repetition so far (i.e. new users) will be part of the list of proposals, but filtered to display only 3-5 dances.
4. Requirements 08 - Edit Profile
A list of Schools, from which the User can select, is maintained in the system (System Administrator). Assume that all SchoolNames will be unique (therefore Identifying). A User can have any number of schools associated with him or her and can proclaim GraduationDate for each School. It is possible that the same School will appear multiple times with different GraduationTypes.
For a particular School, there may be many RegularUsers that may have attended that School.
So, given one School, there may be many RegularUsers associated with that .
In a unique relationship instance between a RegularUser and a School, there is a YearGraduated associated with it. Since the may attend the same School for many different levels of education like Bachelors and Masters for example, the YearGraduated is a multi-value.
For a particular ProposedDance, there may be many Users that may have exercised that .
So, given one ProposedDance, there may be many Users associated with that .
In a unique relationship instance between a User and a School, there is a DateDanceWasExercised associated with it. Since the User will exercise the same ProposedDance many times, the is a multi-value.
Each School must have a SchoolType. There are four possible types: College/University, High School, Middle School, and Elementary School. It should be possible for the administrator to add new SchoolTypes from behind the scenes.
Each ProposedDance will have a ProposedRepetitionRate for a CertainDay. There are zero to three dances to be repeated per day. It should be possible for the administrator to add new DanceRepetitonRates from behind the scenes.
5. Requirement 08.1 - Edit Profile
Just like a RegularUser can have multiple SchoolsAttended, a egularUser may have had several Employers.
Here you see the screen, an AdminUser uses to maintain a list of Employers.
Administrators are responsible for managing the list of Employers. Assume that all Employers have a unique EmployerName.
So, we have an entity type of Employer
A RegularUser may have multiple Employers, and obviously a particular Employer may have multiple RegularUsers.
The JobTitle is not managed by the AdminUser and can be any value provided by the RegularUser. A profile can contain multiple Employers and the same Employer may even appear multiple times as long as the JobTitle is different in each case. It is a multi-value, because over time a particular RegularUser may have held different JobTitles for this same Employer.
So, we have an entity type of Badges.
A User may earn many Badges, and obviously a particular Badge may be awarded to multiple Users.
A UserProfile can contain multiple Badges and the same Badge is connected to multiple Users, which the User earned with various, different Achievements. JobTitle is a multi-value, because over time a particular User will collect many different Achievements under the roof of the same Badge.
6. Requirements 09 - Request/Accept Friendships
In the Pending Requests document (screen), the list of people who have requested to be friends with you. And below is the list of people that you have requested to be friends with.
A particular User can request multiple other Users to be friends. For each one of those requests, there is an instance of the Request Relationship. So, one RegularUser may have requested several different Friendships.
When a User accepts a Request that adds an instance to the Accept Relationship. So, a particular RegularUser may have accepted Friendship from multiple different Users. The DateConnected records the date that the invitation was accepted.
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.
7. EER (Extended Entity Relationship) Mapping
Adding it all together, this is the EER diagram we have arrived at.
10. Constraints
Examples:
- DateConnected is NULL until request is accepted
- Cannot be friend with yourself
- can only comment on status of friends
11. ➡️Task Decomposition
Looking into the IFD (Information Flow Diagram), we need to talk about whether that’s a single task or whether it should be decomposed
Rules of Thumb are based on a deep understanding of the internal workings of a DBMS. In each one of the cases, I’m going to give you the rule, and I’m going to tell you what it is based on. Later on, when you do decomposition you are going through these rules in order to determine whether the particular task you are looking at should be decomposed or not.
🚩Rules of Thumb
(1) Lookup vs Insert, Delete, and Update?
Different database locks
From a DBMS perspective, there is a big difference between whether a task just is a Lookup task or whether it modifies the database through an insertion, deletion, or update.
The reason for that is that different database locks are needed in order to support lookup versus changes to the database.
If many different things take place, then that is an indication, that the task should be decomposed.
(3) Are Enabling Conditions Consistent Across Tasks?
Let run, what can run - scheduling
The next rule of thumb is based on what enables the different portions of a task. If some portions of a task are enabled, why not let those proceed instead of waiting to later on, when there might not be resource available to run those tasks that were earlier enabled?
The smaller portions of a task that can run, the easier it is to schedule the task.
(5) Is Consistency Essential?
ACID transaction properties
The next, really important rule of thumb is related to consistency of the database: Is it really essential that all the pieces of a task get done in one transaction, or is it ok that things get spread out a little bit over time.
An example of that would be transferring money from one bank account to another one. It is very important that all the steps involved are done together. For example - money must be available in the from-account, they must be subtracted from the balance of the from-account and they must be deposited in the to-account. All of those tings must be done together in order that you do not end up with an inconsistent database.
(2) How Many Schema Constructs are Involved?
Many database locks
The 2nd rule of thumb is based on how big a portion of the database is involved in the operation.
The bigger the portion is, the harder it is to acquire all the locks that I needed in order to support concurrent execution of transactions on the database.
So, if a large number of schema constructs are involved that would make you want to decompose the tasking to smaller tasks using smaller portions of the database
(4) Are Frequencies Consistent Across Tasks?
Index only what must be indexed
The next rule of thumb is based on what the frequencies of the things that are done by the task are.
If the task contains things that are done with a high frequency and things that are done with a low frequency, it is a good idea to split them apart. The reason is, that high frequency things you want to index to run fast, whereas low frequency things you may not need to index.
👀(6) Is Mother Task Control Needed Or Not?
Sometimes you need a mother task, sometimes you do not.
The banking example from before certainly needs a mother task.
We are later going to see things that may not need a mother task
❓12. Web Apps versus Traditional Apps
Before we look at decomposition, let us talk about web based applications and traditional apps.
Web Apps
Web based applications are almost completely stateless.
The amount of state maybe as little as the login information for a session user
There may be a small amount of clickstream data that is available in order to proceed with hte application.
Things however for web-based applications are changing. With new technologies such as Web2.0 and AJAX, it is now possible to provide much more state information with the application on browser level or behind the scenes on the server (but not in the database).
Because of that, web apps are beginning to act more like traditional applications.
Traditional Apps (sowas wie ACCESS DB?) (Oder eine alte, native App?)
In a traditional application, it is much easier to manage local state separately from the database (e.g. using smart widgets)
That means that a whole bunch of changes can be collected before submitted to the DBMS for execution.
That means, that there is not a run-trip to the DB needed. Every single time, a minor thing is changed, such as you have to do in a web app.
Traditional applications are much better to control support of ACID transaction properties. So, that is a big advantage.
Fortunately, web app technology is moving closer to traditional app technology. An understanding of this is necessary, as we consider examples of task decomposition.
The video is not dated, but it provides a general overview of web-based applications and traditional applications. When the video mentions "Web 2.0," it is referring to a term that was popularized in the early 2000s to describe a shift in the way websites and web applications were designed and used. Web 2.0 introduced interactive and collaborative features, such as social media platforms and web-based productivity tools.
In the context of the video, "traditional applications" refer to software applications that are installed and run directly on a user's device, such as native desktop or mobile applications. These applications typically have access to more resources and can store data locally on the device.
Examples of traditional applications can include MS Access DBMS, as you mentioned, as well as other desktop applications like Microsoft Word or Adobe Photoshop.
Web-based applications, on the other hand, are accessed through a web browser and run on remote servers. They rely on internet connectivity to function and often store data on a server rather than locally on the user's device.
It's important to note that the video may not provide the most up-to-date information on these topics, as technology evolves rapidly. If you have any further questions or need more clarification, feel free to ask!
13. Task Decomposition | View (Screen) Profile V2.0 (LineDance : HomeScreen)
First example of task decomposition. Let us now use our rules of thumb on the task View Profile task.
Decompose the View Profile into
- View Personal
- View Education
- View Professional
That is the task that supports the View Profile Screen (document). By looking at the screen, we notice that,
- there are 3 lookups (Suche?)
- Personal information
- Education Information
- Professional Information
for a RegularUser.
All 3 lookups are READ-only. There is no update or operation at the DB.
All 3 are enabled by a User’s login or a friend’s lookup.
All 3 have the same frequency
Several different schema constructs are needed for this task. Look into the EER diagram and see how big a portion the personal information covers, the educational and the professional education.
Consistency is not critical, even if the profile is being edited by the User, while a Friend is looking at it (woher weiß ich das?)
These can be done in any order, they do not need to be done in the order of personal, tehn education information. There is flexibility in execution.
However, all 3 must be done, so mother task is needed.
Most of the above are good indicators that the task should be decomposed into 3 subtasks.
Decomposition of LineDance Home Screen Tasks
By design, I specify that there are 4 tasks
- (1) Lookup and display of Earned Badges
- (2) Lookup and display of Proposed Dances
- (3) Search Function (*)
- (4) Lookup and display of random titles of all Dances (not ProposedDances) and display of searched DanceTitle (if any).
for a User.
(*) All 4 Lookups (4) are READ only; there is a lookup by the Search Input field, and then a display of the matching DanceTitles. There is no update or operation at the DB (planned so far, to be confirmed). I think, there is no update of DB, because the input field is kept on browser/app level until a DB operation is initiated.
14. Abstract Code | View (Screen) Profile V2.0
IF the BUTTON SAVE in Personal Section is pressed, then Update Personal. View Personal
IF the DELETE this School: Delete School. View Profile
IF the DELETE this Job: Delete Job. View Profile
IF the BUTTON SAVE in Personal Section is pressed, then Update Personal. View Personal
(1) Personal
The first step is to find the CurrentUser using User Email. Having found that we can display on the output document (screen) Profile.
>> Display UserName
Find the current RegularUser using User Email;
>> display RegularUser Sex, BirthDate, CurrentCity, Hometown and Interests.
(2) Education
Find each School for the RegularUser
>> Display SchoolName and YearsGraduated
Find SchoolType
>> Display SchoolType Name
(3) Professional
Find each Employer for the RegularUser
>> Display Employer Name and JobTitles
It is the ultimate step before writing this in SQL
Abstract Code of LineDance Home Screen Tasks
(1) Earned Badges
The first step is to find the CurrentUser using User Email. Having found that, we can display on the Home Screen.
(>> Display UserName)
Find the current User using User Email
>> display User’s earned Badges so far.
(2) Proposed Dances
Find all ProposedDances for the User and Current DanceDay
>> Display DanceTitle, Interpreter, Image, and SpotifyTitle, Level
>> Display ProposedRepetitionRate for the currrent DanceDay
(3) Search
Input search for DanceTitle, Interpret, SpotifyTitle.
>> Display searched DanceTitle, Interpret, Image, SpotifyTitle in random list
(3) Choose (from Random List)
Find a random list of all DanceTitles
>> Display 5 of the random list DanceTitle, Interpret, Image, SpotifyTitle
15. Task Decomposition | View (Screen) Edit Profile V2.0
The screen is both input and output that needs to be supported by the Edit Profile task. This is somewhat more complicated than the View Profile task.
The rule of thumb:
- Lookup of Personal, Education, and Professional information of a RegularUser in order to support editing it. We just specified the View Profile task, so we are using that for that.
- In order to populate the Edit Profile screen, it is necessary for us to go to the DB and lookup the list of Schools and the Employer lists, Without those, we would not be able to populate the dropdown menus.
- The Edit Profile task may and up editing each one of the three groups, the Personal, Education, and Professional information
- Both, reading from the DB, writing to the database are possible in the Edit Profile task. Reading for example to lookup the list of Schools and Employers, and writing could take place in order to execute an insertion, a deletion, or an update. Certainly an insertion is possible, if an extra School is added to the Education section, deletion is possible, if one of them is removed, and update is possible if information is changed, for example in the Personal information section.
- The only thing that is required to enable one of these operations, is the User’s Login and then - separate added request as you can see, there is a separate ADD and SAVE in each section.
- The frequencies, when these things happen, are somewhat different. Some of the information will not change, like Sex and BirthDate. CurrentCity might, Interest might change all the time, the Education may not change so many times, but the Professional history will change over time. These are not great differences, but there are differences.
- Clearly, there are several different schema constructs involved. There is the Personal information for User and for RegularUser. There is the whole Education portion, there is the whole Professional portion.
- Again, consistency is not necessarily critical. If someone else is looking up this profile, that the owner of the profile is currently updating, it is not essential that the latest version of information is available.
- There is some sequencing of what needs to take place: The lookup (or read of) the DB needs to be done first, and then followed by any number of edits or additional lookups.
- A mother task is clearly needed.
👀+++ LineDance | How is the Badges/Achievements domain (Is domain the right expression? Nope?) Edited? How Do I Need to Decompose?
Rules of Thumb
(1) Lookup vs Insert, Delete, and Update and
(2) How Many Schema Constructs Are Involved?
LineDance EER V0.1
(3) Are Enabling Conditions Consistent Across Tasks?
This answers the question “Should I do the update action on Badges somewhat later? For example, when the User returns to the Home Screen.”
Frequency of Badges update is less often than Achievements update. But they are defined as subtasks anyway before.
No.
👀This concept I did not understand until now. But I think, yes.
E voilá: IFD (parts of) Version 0.6 with Task Set Achievements decomposed into ALL subtasks. It always came to my mind, that there is complexity in it, and that’s the reason, why I am so deeply stuck. Now, it is obvious: It’s just complex.
Link (Remember, to not embed the Twitter links, because they will not show up on the Notion/SuperSite)
Verdammt, why does the image not show up on Twitter?
Oh, it does show the image. Just be patient.
17. Task Decomposition | Friend Requests V2
Without going into the same level of detail, let us take a look at task decomposition for Friend Requests.
The idea, again, is that we have the forms that are the interface to the application, and our job is to now talk about the decomposition of the task that are necessary in order to tie these forms through the task into the database.
If we did a closer analysis using the for task decomposition for this task we would arrive at the following result.
The Request Friend task would be separate from the others. This task would update the database with the Request.
The View, Cancel, Accept, Reject Request is the one that supports the “Request New Friend” form. It would end up being decomposed into 2 subtasks
- View the Request. This subtask supports the reading of User, RegularUser and Friendship information.
- Support the Accept, Request, Cancel the Request options. This subtask updates the Friendship.
ToDo @November 18, 2023 :
18. Specification
This basically completes the specification phase of our database development methodology.
We have generated an EER, we have looked at data formats, and we have looked at constraints, based on that we the looked at task decomposition and wrote abstract code for the tasks (ich nicht, nur einmal).
We now need to take a little detour. When we come back again, we are going to proceed with the design.
In the design we are going to translate the EER diagram to a relational database schema.