Should Enterprise Java entities be dumb?

前端 未结 8 632
醉酒成梦
醉酒成梦 2020-12-02 14:32

In our legacy Java EE application, there are loads of value object (VO) classes which typically contain only getters and setters, maybe equals() and hashC

8条回答
  •  难免孤独
    2020-12-02 15:25

    I think your point is valid.
    See this for more - http://martinfowler.com/bliki/AnemicDomainModel.html
    With JPA, the Entities are light-weight objects. So I don't think its any problem having logic in them.

    In case of use with SOAP/Web Services, I'd add a separate Facade Layer.

提交回复
热议问题