Announcement Announcement Module
Collapse
No announcement yet.
designing a web app with spring Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • designing a web app with spring

    Hi all,

    I'm having trouble deciding what goes in a spring controller. I know any persistence details go in the dao layer to seperate it from the service layer. But what general guideline can I use to seperate the web layer from the service layer? seems like most of my service methods are just passing thru calls from the web layer to the dao and nothing much else.

    also are domain objects supposed to be used in all 3 layers?

    thanks.

  • #2
    I'm having trouble deciding what goes in a spring controller.
    Have you had a good look at the samples?

    seems like most of my service methods are just passing thru calls from the web layer to the dao and nothing much else
    The DAO should contain re-usable low-level persistence calls. The service layer is for adding transaction boundaries and possibly application of security logic (and business logic).

    also are domain objects supposed to be used in all 3 layers?
    Certainly they can be. Generally you would unless there is a reason not to.

    Comment


    • #3
      But what general guideline can I use to seperate the web layer from the service layer?
      One question you can ask is, if I was using different presentation technology (eg swing) would I still need this bit of logic or code? If so, it might want to go in the service layer.

      Comment


      • #4
        But what general guideline can I use to seperate the web layer from the service layer?
        The service layer is where you usually define transaction boundaries and include business logic. Try to keep the controller focussed on navigation and presentation.

        Comment

        Working...
        X