Skip to content
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

Refactor: Implement JDBC and MySQL #11

Merged
merged 9 commits into from
Feb 4, 2025
Merged

Refactor: Implement JDBC and MySQL #11

merged 9 commits into from
Feb 4, 2025

Conversation

dorian-adams
Copy link
Owner

Drop serialization in favor of a MySQL database for data storage. Improve design:

  • Improve modularity.
  • Ensure single-responsibility principles.

Drop serialization in favor of a MySQL database for data storage.
Improve design:
- Decouple classes.
- Ensure single-responsibility principles.
Instead of using a Singleton pattern, ensure data consistency and prevent duplication of `allAnimals` by passing the same `AnimalService` instance between controllers.
Additionally, ensure data is not loaded twice by setting a flag that must be checked before calling `loadFromDb()`.
This maintains the benefits previously established by the Singleton while reducing complexity and improving testability.
@dorian-adams dorian-adams merged commit 23f0d38 into main Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant