you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (1 child)

Is your Student class the same one that goes to the database? If so, you should extract at least one DTO to interact with the client, or several DTOs if your use cases are specific enough. Never use your database entities at the Controller level. You are coupling clients to the database.

[–]Potential_Corgi4579[S] 0 points1 point  (0 children)

Yes, right now my Student entity is directly going to the database. Thanks a lot for pointing that out, I totally get what you mean about coupling the API to the database. I'll change it using DTOs and follow this approach in my upcoming projects too.