Update Technical future / Andreas

Andreas Svanberg 2025-02-12 11:29:49 +01:00
parent 494a1dd854
commit bb6649195d

@ -1,48 +1,48 @@
* Remove all database operations (JPA) from services and delegate to repositories
* Inject a reference to a `JpaRepository` instead of a `EntityManagerFactory` in `AbstractServiceImpl`
* Remove usage of QueryDSL in services
* Remove interface `QueryDslPredicateExecutor` (it should be an implementation detail within the repository)
* Never return `@Entity` classes from services
* Never return `@Entity` classes from repositories.
* Stop using "Open EntityManager In View" pattern and use `EntityManagerFactory` rather than a "shared" `EntityManager`
* No Jakarta Persistence API usage in `core` Maven module.
* Keep repository interfaces in `core`
* Move repository implementations to their own module and isolate Jakarta Persistence API to their implementations.
* Stop with the "1 table-1 entity-1 repository-1 service" thing
* A service should work with some context, such as final seminar from a supervisors point-of-view, not the SQL table called "final_seminar"
* A repository can manage multiple `@Entity`s (and therefore tables)
* Remove manual transaction handling inside workers (`AbstractWorker` base class)
* Make all notifications event-based rather than direct calls from other service methods
* Make event handling asynchronous (such that a failure or slowdown in an event consumer does not interfere with the event producer)
* Replay events if a consumer fails?
* Introduce automated [Checkstyle](https://checkstyle.org/) analysis with no allowed violations
* Start with no rules just to have it set up
* Add rules over time and fix the violations simultaneously
* Replace Jersey (JAX-RS client) with Spring's RestClient?
* To get rid of a rather large dependency
* Use Spring Boot Maven plugin / main method to start SciPro
* Will automatically start Docker dependencies
* Faster reloading on changes
* How to solve secrets for Daisy integration?
* Use a local database running in Docker
* Requires good test data in `DataInitializer`
* Create a mock Docker container for Daisy API
* Removes the need for secrets
* Makes it easier to test integration with known answers
* Try to minimize / move to edges the Daisy integration to make as much functionality as possible useable without it
* `DaisyAPI` service should not reside in the `core` module
* Make it easier to schedule new jobs
* Right now you need a bean for the scheduling, a bean for the worker, and finally a bean for the actual job (unless you do it in the worker)
* Replace Wicket with Spring Web (REST API) + React (TypeScript)
* Must have a transition period where both work together simultaneously with smooth transition
* Automatic deployment to production after pull request is merged
* Do not accept `null` as a method parameter
* Add overloads without it
* Specify it as `Optional<T>`
* Remove stack traces from Maven test output
* Fix all warnings during Maven build
* Do not use repositories directly in Wicket components
* Improve the creation of test data
* Allow creating a new file that adds test data to minimize merge conflicts
* Should be easy to do repetitive tasks (such as create a user) in each new file
* Create some "How to work in Gitea" guide
1. Remove all database operations (JPA) from services and delegate to repositories
* Inject a reference to a `JpaRepository` instead of a `EntityManagerFactory` in `AbstractServiceImpl`
* Remove usage of QueryDSL in services
* Remove interface `QueryDslPredicateExecutor` (it should be an implementation detail within the repository)
1. Never return `@Entity` classes from services
1. Never return `@Entity` classes from repositories.
* Stop using "Open EntityManager In View" pattern and use `EntityManagerFactory` rather than a "shared" `EntityManager`
1. No Jakarta Persistence API usage in `core` Maven module.
* Keep repository interfaces in `core`
* Move repository implementations to their own module and isolate Jakarta Persistence API to their implementations.
1. Stop with the "1 table-1 entity-1 repository-1 service" thing
* A service should work with some context, such as final seminar from a supervisors point-of-view, not the SQL table called "final_seminar"
* A repository can manage multiple `@Entity`s (and therefore tables)
1. Remove manual transaction handling inside workers (`AbstractWorker` base class)
1. Make all notifications event-based rather than direct calls from other service methods
1. Make event handling asynchronous (such that a failure or slowdown in an event consumer does not interfere with the event producer)
* Replay events if a consumer fails?
1. Introduce automated [Checkstyle](https://checkstyle.org/) analysis with no allowed violations
* Start with no rules just to have it set up
* Add rules over time and fix the violations simultaneously
1. Replace Jersey (JAX-RS client) with Spring's RestClient?
* To get rid of a rather large dependency
1. Use Spring Boot Maven plugin / main method to start SciPro
* Will automatically start Docker dependencies
* Faster reloading on changes
* How to solve secrets for Daisy integration?
1. Use a local database running in Docker
* Requires good test data in `DataInitializer`
1. Create a mock Docker container for Daisy API
* Removes the need for secrets
* Makes it easier to test integration with known answers
1. Try to minimize / move to edges the Daisy integration to make as much functionality as possible useable without it
* `DaisyAPI` service should not reside in the `core` module
1. Make it easier to schedule new jobs
* Right now you need a bean for the scheduling, a bean for the worker, and finally a bean for the actual job (unless you do it in the worker)
1. Replace Wicket with Spring Web (REST API) + React (TypeScript)
* Must have a transition period where both work together simultaneously with smooth transition
1. Automatic deployment to production after pull request is merged
1. Do not accept `null` as a method parameter
* Add overloads without it
* Specify it as `Optional<T>`
1. Remove stack traces from Maven test output
1. Fix all warnings during Maven build
1. Do not use repositories directly in Wicket components
1. Improve the creation of test data
* Allow creating a new file that adds test data to minimize merge conflicts
* Should be easy to do repetitive tasks (such as create a user) in each new file
1. Create some "How to work in Gitea" guide