Page:
Technical future / Andreas
25
Technical future / Andreas
Andreas Svanberg edited this page 2025-02-14 18:19:45 +01:00
- Remove all database operations (JPA) from services and delegate to repositories
- Inject a reference to a
JpaRepository
instead of aEntityManagerFactory
inAbstractServiceImpl
- Remove usage of QueryDSL in services
- Remove interface
QueryDslPredicateExecutor
(it should be an implementation detail within the repository)
- Inject a reference to a
- 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
- Stop using "Open EntityManager In View" pattern and use
- 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.
- Keep repository interfaces in
- 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 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
- Requires good test data in
- 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 thecore
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>
- Do not return
null
- 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
- "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
- Replace
java.util.Date
withjava.time
- Stop using
DomainObject
sdateCreated
andlastModified
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
)