Using Spring MVC to develop a web application. Earlier I was using Controller layer, Service layer(business logic), Model layer(entity) and DAO(DB) layer.
But someone pointed out that i should introduce two more layer ie. dto layer for collecting data from front end and transforming layer which will convert than dto into model(entity) layer objects.
Now I am using:
- Controller layer (which will send the data to DTO layer)
- DTO layer (which will send the its data to transforming layer)
- Transforming layer(for converting dto layer objects into entity layer objects)
- Service layer(Business logic)
- Entity layer(POJO which will map with database)
- DAO(which will use entity objects to store the database)
In this way we can keep front end and backend data different. Please help me out, is this a proper structure for Spring MVC ?