In Spring Boot - Too Many Public Classes?

Can I take a spring boot MVC CRUD app and

  1. lower the number of public classes?
    1. As a way to enforce rules like only services should call *Repository.java classes.
    2. And @Entity classes should only be used by services and *Repository.java classes.

This idea comes from Spring Office Hours - Episode 43

I want to give it a spin and put some notes in this blog post.

Also, what do you think of the two rules above? Should services only use services? Should @Entity classes only be used by a service to interact with the database via the *Repository.java classes?



Tags: spring, spring-boot, java

← Back home