icebreaker-science / backend

The backend (Spring Boot) part of the icebreaker.science application
Apache License 2.0
2 stars 0 forks source link

Refactoring #32

Open michael-kamel opened 4 years ago

michael-kamel commented 4 years ago

There are couple of things that are slowly diverting from a proper path that probably need to be addressed now.

dajenet commented 4 years ago

The test part has yet to be done.

chaoran-chen commented 4 years ago

Please also take a closer look at all the tests involving the creation of an account or are sending emails. Especially sendContactRequest_prepare_mail_success() needs probably to be adapted.

michael-kamel commented 4 years ago

We might also resolve the passing of business domain entities in the controllers as part of this issue if there is time. One point I may add is we have to keep track of each change we make to an entity. For example, It could have been the case that we forgot to explicitly set the enabled attribute to false on the account when registering, causing anyone to be able to register an enabled account without email verification. The main idea is that this coupling will have us keeping a lot of stuff in mind and might get complex with time when making changes in general and to entities specifically.

michael-kamel commented 4 years ago

We should also restructure the file structure according to the layers we have. Structuring according to the entities is becoming hard to maintain properly.

chaoran-chen commented 4 years ago

Maybe this means that we should modularize the project better? Or do you prefer a horizontal structure in general?

michael-kamel commented 4 years ago

Not necessarily modularize but the point is the following, as the project gets bigger we will need additional services which are not entity specific and we will have some APIs which will require business logic that intersects 2 or more entities in general. The idea is, since we are following a layered architecture, it is probably best if we structure it as one in terms of how files are organized.

For example, we currently have logic regarding mailing, crypto, exceptions and so on. All of these are either scattered around in the entity services as sole functions or we have them as packages in the same level of the entities.

inter layer dependency is much more common so a horizontal structure will probably be much easier to maintain