25
Technical future / Andreas
Andreas Svanberg edited this page 2025-02-14 18:19:45 +01:00
  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)
  2. Never return @Entity classes from services
  3. Never return @Entity classes from repositories.
    • Stop using "Open EntityManager In View" pattern and use EntityManagerFactory rather than a "shared" EntityManager
  4. 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.
  5. 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 @Entitys (and therefore tables)
  6. Remove manual transaction handling inside workers (AbstractWorker base class)
  7. Make all notifications event-based rather than direct calls from other service methods
  8. 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?
  9. Introduce automated Checkstyle analysis with no allowed violations
    • Start with no rules just to have it set up
    • Add rules over time and fix the violations simultaneously
  10. Replace Jersey (JAX-RS client) with Spring's RestClient?
    • To get rid of a rather large dependency
  11. 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?
  12. Use a local database running in Docker
    • Requires good test data in DataInitializer
  13. Create a mock Docker container for Daisy API
    • Removes the need for secrets
    • Makes it easier to test integration with known answers
  14. 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
  15. 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)
  16. Replace Wicket with Spring Web (REST API) + React (TypeScript)
    • Must have a transition period where both work together simultaneously with smooth transition
  17. Automatic deployment to production after pull request is merged
  18. Do not accept null as a method parameter
    • Add overloads without it
    • Specify it as Optional<T>
  19. Do not return null
  20. Remove stack traces from Maven test output
  21. Fix all warnings during Maven build
  22. Do not use repositories directly in Wicket components
  23. 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
  24. Create some "How to work in Gitea" guide
  25. "Make the change easy then make the easy change"
    • When making changes to the system, if it is not easy to do, make it easy first
  26. Replace java.util.Date with java.time
  27. Stop using DomainObjects dateCreated and lastModified for business logic
    • They should be for auditing and debugging
    • Things like project start date, first meeting time, final seminar date, and so on should have their own specific values (and proper date type which may not be Instant (java.util.Date)