-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Object Serialization, Proposal to improve Database-Scheme, #62
base: main
Are you sure you want to change the base?
Conversation
Update fork
…ty far along the way, but reader exists only as a concept for now.
…ctFeatures.ts to keep the old client interface, but use new db scheme under the hood.
Merge Pull Request
… the concept from the actual "model" classes.
…se. Adjusted ObjectHandler to use the Reader where aplicable.
… and written to and from db and entity objects.
… to getTableNameFromClass.
…ata. Use ProjectManager to interact with user_projects relation!
… membership logic from User and CourseProject, please use the Manager for this!
…ourses and CourseProjects. (this makes Serializable creation easier, because we dont have to touch the factory)
I updated the PR to fix merge conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your contribution! The changes are good, however, with many changed there is always much to complain :D The change requests are quite small though, so good job!
Please make sure that you never use any
(except for a view exceptions, but those shouldn't apply here).
Please also make sure that you lower the number of linter complaints. It is 18 on the main branch and 23 in yours. That should be solved by removing all of these any
s.
newSemester: selectedCourse.semester, | ||
newProjectGroupName: courseName, | ||
courseName: selectedCourse.courseName, | ||
newSemester: selectedCourse.semester, // ToDo remove |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who is that todo for?
- For you: Please fix
- For others: Please reference the issue ID with the TODO. Create an issue if necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SirJonithan that was your change, please decide what we need to do here.
I have successfully merged the upstream changes. Please handle the linting errors @SirJonithan and the one remaining requested change regarding your work! |
This issue closes #31 (Moritz Gorny, me), #23 (Jonathan Stern), #61(both of us).
These issues were combined because working on them in parallel at the same time was very useful.
#52: Jonathan and I reworked the Database Scheme for more consistent naming, no redundancy and better applicability of Serializer Pattern. See the original issue #52 for context.
#31: Implementing Serializer Pattern for classes that reflect Entities in the database. Motivation: hide the db-backend structure and SQL Queries from domain classes (Course, User, CourseProject).
#23: Creating Course and CourseProject classes
Rework of Database-Scheme
The new scheme has the following tables. No additional tables shall be created sneakily, you can also refer to databaseInitializer.ts for the table definitions.
Testing:
The DB changes were rigorously reviewed and checked, but the app has not been tested in its entirety.
UI:
No changes to UI were made. (apart from renaming endpoints etc.)
Fix Object Serialization
Serializer Pattern was implemented.
Interfaces: Reader, Writer, Serializable.
Use DatabaseWriter and DatabaseResultSetReader for reading and writing to/from DB.
To create new entries in the DB use DatabaseSerializableFactory, for getting Objects refer to ObjectHandler. Project Membership is managed in ProjectManager.
For Usage of the Serializer please refer to User class as an example.
There are still some parts of the server to migrate. But I have passed the mark of 40 hours of work on this and feel like this should be good enough for now.
Testing:
The basic reading and writing was tested in the provided serializer.test.ts file.
UI
No UI changes were made.
Creating Course and CourseProject classes
Added the classes.
How can this be tested?
Not very much to test.
Screenshots
No UI changes were made.
Checklist