f1nal3 / Juniorgram

A C++ messenger for learning purposes in EPAM Brest C++ R&D Lab
14 stars 1 forks source link

An attempt to upgrade our DataAccess #663

Closed ivanboika closed 1 year ago

ivanboika commented 1 year ago

What's new

  1. Added new model system, but not implemented in the server side (must be done till the end)
  2. New model fields access system
  3. A test which shows how to deal with new model and a responce from PG DB. More description will be added later.

    Issues:

  4. Kinda weird naming
  5. File location (Idk where it should be located)
  6. Unifyed model does not fill SOLID, also it's a problem when we transfer data as a model in a request-responce form (because this model holds not only business information) Possible issues: No idea how this template magic will deal with gcc and clang
ivanboika commented 1 year ago

image image The same logic does the main createChannel method, so output is the same New method was created just by moving parsing data from bd logic in the hands of the model

ivanboika commented 1 year ago

No idea how to create ModelFactory properly, I guess need some help there. Maybe I'll find a solution later by myself, idk but it's still kinda tough issue there

ivanboika commented 1 year ago

Before: image After: image P.S: Logs are deleted for better comparing

ivanboika commented 1 year ago

I've decided to leave this code smell bc attempting to fix it generates even more code smells. Probably, this code smell tells that the model transfers from server to repository interface via move semantics(I'm pretty sure that via copy too) and this ctor isn't declared as noexcept and sonar wanted to declare it. However, compiler does everything by itself

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

88.1% 88.1% Coverage
0.0% 0.0% Duplication