I'm familiar with the DAO pattern and can read everywhere that it enables to separate data access from business logic. I'm now designing an application with some heavy business logic and encouter the following dilemma:
Given an OrderDataTransferObject (OrderDto) and a OrderWithBusinessLogic (OrderLogic), how do I link these two? I'd actually like OrderLogic to extend OrderDto, as this will automatically give getter / setter methods for all relevant attributes, of which I can override those which trigger some business logic.
Using hibernate however, my DAO implementation will deliver a OrderDto, not an OrderLogic. I find some patterns where OrderLogic contains an OrderDto as delegate, but I find this solution inferior, as adding a new DB field will require changing both OrderDto and OrderLogic.
What is the "Spring-way" to do this?