An UserAccount should not be directly coupled with a Person. Instead the data actually necessary for an UserAccout should be copied from the person it is created for. Whenever the Person is updated the changes should be propagated to its corresponding UserAccount.
This approach would provide the following benefits:
Lower overhead upon login - no data from tables other the the UserAccount needs to be fetched. This should improve performance
Cleaner code - an UserAccount actually is not interested in the whole Person with its ReferentProfile, ActivistProfile, etc. but rather only cares about the person's name, email and identifier.
An
UserAccount
should not be directly coupled with aPerson
. Instead the data actually necessary for anUserAccout
should be copied from the person it is created for. Whenever thePerson
is updated the changes should be propagated to its correspondingUserAccount
. This approach would provide the following benefits:UserAccount
needs to be fetched. This should improve performancePerson
and the entities aPerson
references implement theSerializable
interface. Implementing this interface causes a bunch of problems as for example theParticipantProfile
contains value objects such as the participant's date of birth which should not be serialized (see https://stackoverflow.com/questions/26451590/why-should-javas-value-based-classes-not-be-serialized)UserAccount
actually is not interested in the wholePerson
with itsReferentProfile
,ActivistProfile
, etc. but rather only cares about the person's name, email and identifier.