Shrishambho / inquisitive-toy-7122

1 stars 0 forks source link

Project review #5

Open rahulkore opened 1 year ago

rahulkore commented 1 year ago
  1. Package bean sounds wrong for entity objects , Always keep entity objects inside entity package .
  2. Use @Data annotations from lombok package for dynamic getters and setters , won't have to create getters and setters manually for all the parameters in entity classes.
  3. Instead of prepared statements in DAO implementations , you could use JPA (Java persistence API) , it gives more flexibility in terms of querying the db.
    • It provides methods such as findById() where you won't have to write native sql queries explicitly.
    • Internally JPA uses prepared statements only , so it does the job of creating the corresponding queries for you.
  4. good job on separating the DB Util class . [nit] => always close the conn object that you open.
  5. conn object could have been globalized or passed as a reference .
  6. In jpa , no need to create conn objects , it does the job for us . pasting some links for JPA
  7. good job on creating custom exceptions .
  8. put Use cases classes in service layer where all the business logic must reside.
  9. separate controller , service layer must be present .
  10. could remove DBUtil from utility into configuration package and initialize the conn objects using dependency injection. Pasting some useful links for dependency injections below.
Shrishambho commented 1 year ago

@.***

On Sun, 18 Jun, 2023, 6:11 pm Rahul Kore, @.***> wrote:

  1. Package bean sounds wrong for entity objects , Always keep entity objects inside entity package .
  2. Use @DaTa https://github.com/DaTa annotations from lombok package for dynamic getters and setters , won't have to create getters and setters manually for all the parameters in entity classes.
  3. Instead of prepared statements in DAO implementations , you could use JPA (Java persistence API) , it gives more flexibility in terms of querying the db.
    • It provides methods such as findById() where you won't have to write native sql queries explicitly.
    • Internally JPA uses prepared statements only , so it does the job of creating the corresponding queries for you.
  4. good job on separating the DB Util class . [nit] => always close the conn object that you open.
  5. conn object could have been globalized or passed as a reference .
  6. In jpa , no need to create conn objects , it does the job for us . pasting some links for JPA

    https://www.baeldung.com/the-persistence-layer-with-spring-data-jpa

  7. good job on creating custom exceptions .
  8. put Use cases classes in service layer where all the business logic must reside.
  9. separate controller , service layer must be present .
  10. could remove DBUtil from utility into configuration package and initialize the conn objects using dependency injection. Pasting some useful links for dependency injections below.
  11. functionality is in working condition so that's good.
  12. Just focus on the aspects that i have mentioned above , you'll be good to go.
  13. good job on camel casing and meaningful variable names.
  14. Below site has some small projects with different spring boot concepts in it , do go through once on your own pace.

    https://www.springboottutorial.com/spring-boot-projects-with-code-examples

— Reply to this email directly, view it on GitHub https://github.com/Shrishambho/inquisitive-toy-7122/issues/5, or unsubscribe https://github.com/notifications/unsubscribe-auth/A24H7YWSKXWBJ3RRAWNLKUDXL3ZQXANCNFSM6AAAAAAZK3YO2Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Shrishambho commented 1 year ago

On Sun, 18 Jun, 2023, 10:41 pm Shrishambho Khade, @.***> wrote:

@.***

On Sun, 18 Jun, 2023, 6:11 pm Rahul Kore, @.***> wrote:

  1. Package bean sounds wrong for entity objects , Always keep entity objects inside entity package .
  2. Use @DaTa https://github.com/DaTa annotations from lombok package for dynamic getters and setters , won't have to create getters and setters manually for all the parameters in entity classes.
  3. Instead of prepared statements in DAO implementations , you could use JPA (Java persistence API) , it gives more flexibility in terms of querying the db.
    • It provides methods such as findById() where you won't have to write native sql queries explicitly.
    • Internally JPA uses prepared statements only , so it does the job of creating the corresponding queries for you.
  4. good job on separating the DB Util class . [nit] => always close the conn object that you open.
  5. conn object could have been globalized or passed as a reference .
  6. In jpa , no need to create conn objects , it does the job for us . pasting some links for JPA

    https://www.baeldung.com/the-persistence-layer-with-spring-data-jpa

  7. good job on creating custom exceptions .
  8. put Use cases classes in service layer where all the business logic must reside.
  9. separate controller , service layer must be present .
  10. could remove DBUtil from utility into configuration package and initialize the conn objects using dependency injection. Pasting some useful links for dependency injections below.
  11. functionality is in working condition so that's good.
  12. Just focus on the aspects that i have mentioned above , you'll be good to go.
  13. good job on camel casing and meaningful variable names.
  14. Below site has some small projects with different spring boot concepts in it , do go through once on your own pace.

    https://www.springboottutorial.com/spring-boot-projects-with-code-examples

— Reply to this email directly, view it on GitHub https://github.com/Shrishambho/inquisitive-toy-7122/issues/5, or unsubscribe https://github.com/notifications/unsubscribe-auth/A24H7YWSKXWBJ3RRAWNLKUDXL3ZQXANCNFSM6AAAAAAZK3YO2Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>