sam98uele / DB2Project_EJB

3 stars 0 forks source link

Proposals of fetch type #8

Open alessandriniluca opened 3 years ago

alessandriniluca commented 3 years ago

Maybe the fetch type of the questionnaire response list in the class Product could be set as "EAGER", and also the list of statistical answer answered by users in the class QuestionnaireResponse can be set as "EAGER" (I think that the latter one has already been modified), because every time a user load the product of the day page, he needs also the reviews by other users. I am anyway implementing for now retrieving of both leaving them in the "LAZY" state, but I think that during the next meeting we can spend some time in order to discusss this better (leave this issue open until next week, and append here messages about this topic, we will face them together in the next meeting in order to avoid merging all branches and in order to avoid having people modifying the same attribute multiple times). This message is for @sam98uele, who is working with me on the services part

sam98uele commented 3 years ago
  1. questionnaireResponses in class Product, it's good to have it LAZY, because it is used also in other classes, and it's better to load them when needed. Because there could be a lot of objects in that list.
  2. statisticalAnswers in class QuestionnaireResponse, is not a List, so it is EAGER by default.
  3. marketingAnswers in class QuestionnaireResponse, it is EAGER.

FOR NOW Leaving it as it is, I think this is the best until now. We will discuss it at the end when we will have a complete overwiew of all the methods and all the operations we need.

GUIDELINES

  1. If we will need to fetch only the object Questionnaire Response for any reasons without needed the answers, then it could be good having the List in it.
  2. If we do not need in one method to have the Product questionnaire response, then it is good to have it LAZY (because it could make heavy). If not we can evaluate to have it EAGER. Even if in this case it is much better having it Lazy!
alessandriniluca commented 3 years ago

Perfect

alessandriniluca commented 3 years ago

Leave this issue open until PPT is completed