I'm designing a Java application and the model data is stored in Oracle SQL Server. I'm trying to design the best user/role model according to what is necessary.
Because of business rules all users have basic common information:
- Identification ID
- Name
- Surname
- IsActiveUser
But then depending on the role, the user will have extra fields like:
Client Role:
- Birth Date
- Address
Lawyer Role:
- Specialty
- Professional Registration ID
Expert Role:
- Occupation
Manager Role:
- Region
I think in two possible solutions:
- User table will have all the common fields and the optional fields that will be filled depending on the role.
- User table will only have the common fields, and then I create a Detail_User table to save the optional fields that vary with the role.
Do you think this possible solutions are good? Is there an alternative better solution?
