-
Spend time writing following project was about 1.5 hour, without any AI help.
-
I wonder how fast it could be done using AI tools with following strategies:
-
fully rely on, starting explaining APIs and requirements. (with tools like firebase.studio or Cursor AI)
- let the AI split the task, and figure out each part.
-
Splitting and planning would be done by me. writing each class/method by AI. (with llms such as deepseek, chatgpt, ...)
- using bite sized problems in order to let AI use less contexts for each problem, allowing me to refine each unit in a better way.
-
Using AI for generating tests. (copilot, ...)
-
-
jdk15 issue
- https://spring.io/blog/2022/05/24/preparing-for-spring-boot-3-0 jdk17 is minimum for using spring boot 3.x
- security issues:
- CVE-2016-1000027, Score: 9.8 on
org.springframework:spring-web:5.3.31
- CVE-2016-1000027, Score: 9.8 on
- IDE and tools:
- IntelliJ IDEA 2024.3.5
- Spring Initializer
- Env:
- Linux Ubuntu 22.04
-
Abstraction (Interface segregation)
- Of course, we can create an interface for each service and implements them, but due to limited scope of this task I consider it an overkill.
- And also testing is simple yet. Almost everything can be done with simple mocking.
- So I'm gonna postpone this matter, unless there is actual second implementation of services, or testing gets hard.
-
SecondMethod:
- Is it Ok to serve stale data?
- For the sake of simplicity we don't allow that.
- however it's not too hard to do that. instead of simply
rw.lock()we canrw.tryLock()
- File lock machanism on diff platforms (win/linux)
.lockviaposix(?)way
- consistency upon whole file:
- Well Because we're serving data by single key each time so it doesn't really matter but it's simple.
- Is it Ok to serve stale data?
-
ThirdMethod:
- Implementations:
- simple read and write with locks: not performant:
writeValueNaive - cache last read values then update and flush it: doesn't consider external changes
- cache values, monitor for changes, invalid cache upon external change, then update and flush: looks good yet.
- enqueue writes, try to commit after we got the lock.
- simple read and write with locks: not performant:
- Filesystem sync and flushing considerations?
- Implementations:
- I just wrote simple tests for SecondService.
- And also generally I'm avoiding Tests which needs Spring Contexts. They're heavy, running is time-consuming, and sometimes messy.
- Tests I didn't write:
- Services: Tests for each: todo
- Controllers: WebMvcTest: No need yet.
- Integration tests: postponed,