This pull request introduces a new UserRepository class to handle user data persistence and refactors the Admin class to use this repository. Additionally, it updates the User class to implement Serializable for file operations. The main changes are summarized below:
Introduction of UserRepository:
Created UserRepository class to manage user data, including methods to add, delete, save, and load users. (br/com/treinotrack/data/UserRepository.java)
Refactoring Admin Class:
Replaced direct ArrayList<User> management with UserRepository for user-related operations, such as creating, reading, updating, and deleting users. (br/com/treinotrack/models/Admin.java) [1][2][3][4][5]
Updates to User Class:
Made User class implement Serializable to enable file operations and removed unnecessary default constructor and IMC methods. (br/com/treinotrack/models/User.java) [1][2]
Changes in AdminFacade:
Added a call to saveUsers method of Admin class to ensure users are saved when the application exits. (br/com/treinotrack/facades/AdminFacade.java)
This pull request introduces a new
UserRepository
class to handle user data persistence and refactors theAdmin
class to use this repository. Additionally, it updates theUser
class to implementSerializable
for file operations. The main changes are summarized below:Introduction of
UserRepository
:UserRepository
class to manage user data, including methods to add, delete, save, and load users. (br/com/treinotrack/data/UserRepository.java
)Refactoring
Admin
Class:ArrayList<User>
management withUserRepository
for user-related operations, such as creating, reading, updating, and deleting users. (br/com/treinotrack/models/Admin.java
) [1] [2] [3] [4] [5]Updates to
User
Class:User
class implementSerializable
to enable file operations and removed unnecessary default constructor andIMC
methods. (br/com/treinotrack/models/User.java
) [1] [2]Changes in
AdminFacade
:saveUsers
method ofAdmin
class to ensure users are saved when the application exits. (br/com/treinotrack/facades/AdminFacade.java
)