NAJU-Sachsen / NAJU-Adebar

Management tool used by the NAJU Sachsen to keep track of volunteers and the like.
http://naju-sachsen.de
GNU General Public License v3.0
0 stars 0 forks source link

Overhaul person module #30

Open rbergm opened 6 years ago

rbergm commented 6 years ago

A person should act as aggregate-root for its various profiles. Therefore these should be made immutable. This change would also enable a more elegant distribution of events such as the update of a person's data (See #29). Dedicated update(...) methods should be introduced and make the inner workings of mangers more clear and easy to understand. Futhermore these managers are better placed inside their corresponding model packages rather than in a separate app package. As the profiles will be immutable it will be their job to update the profiles accordingly. This would also solve the issue of updating entities through "dark magic". Last but not least the usage for four different manager classes should be re-evaluated and most likely be replaced by a single one.

rbergm commented 6 years ago

First steps have been taken here: 226e69fe71af56503ffd3df128fc3dbead33cbf9

rbergm commented 6 years ago

Actually it is not necessary to make the profiles immutable. Instead they could just notify their related person about the changes performed. This would also solve some weird usages of the resulting API. Copying a person would also cause issues with the way Spring handles domain events.

rbergm commented 6 years ago

Moving classes which are not directly related to persons to the more general model package here b59acd4698b2ab5f7f54d1c38d8aaa78ec13dccd and d98ff6a3834d70da957155520e17edfea85ff152

rbergm commented 6 years ago

What we are missing right now