What disadvantages do you see in the next design (and what will be your ideal architectural proposal) for a typical three-tier web application?
My current approach to the project is very rude (assuming Java, Spring, Hibernate, JSP)
Controller
Standing, potentially wrapped in a read-only transaction (to avoid lazy initialization exceptions), get entities from the persistence store only through the service, passes them to the view as a model. Conducts business logic on them (should BL be located only in the service layer?), If necessary, return to the service level for saving.
The benefits . For a read-only transaction, there is only one connection, the absence of redundant hits for the same persistent object, it makes better use of the query cache, the service level should not “know” the request parameters or init is required, avoid lazy initialization exceptions.
Cons . A read-only transaction approach can be risky, controllers are not an ideal place for business logic ... it is very difficult to make JUnits (your input is a request ...)
View
Non-transactional (access to non-lazy collections / members will result in a lazy initialization exception)
Pros :
: //DAO ()/ ( ). , ,
Model
( ), .
: POJO, , , .
: , , , , .
Transactional, , DAO . , BL , , , BL .
DAO
, BL,
, :
?
( ), ( , ..)? , , - ( )?
? POJO ? beans ( )?
, , , , "".