My application is based on a typical three-tier layer architecture, and the goal is to create a SpringMVC website and a Spring batch solution that supports and supports our products and database promotions, where speed is a very important factor.
I am using Spring JdbcTemplate to manage an obsolete database. Some of my tables contain many columns that I don’t use, and extracting whole rows showed a negative effect due to the size of some fields (drops that we don’t even need to display), so I created several beans matching the columns I want to get. eg:
- Product . Contains a 1: 1 ratio with fields stored in the database.
- ProductDetailsView . Contains identifier, name, price, description, stock.
- ProductListItemView - identifier, price, name, stock.
The DAO layer brings these beans back to the service layer. AFAIK creating a DTO to expose it in my service interface for Product may make sense, but
1) What about ProductDetailsView and ProductListItemView ?
2) Should I make a 1: 1 comparison of these “views” or “forecasts” in the DTO with the same attributes? Why?
3) In any case, where would you post the JSR-303 annotations to verify your web login?