Results 1 to 2 of 2

Thread: Where to put business logic with DAO pattern

  1. #1
    Join Date
    May 2006
    Location
    Zug, Switzerland
    Posts
    89

    Default Where to put business logic with DAO pattern

    Hi

    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?

    Thanks
    Simon

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    See the architecture forum. If you want some in-depth discussion I strongly recommend to read at least of the books on Spring (you can find some of them here: http://www.springframework.org/bookreview).
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •