Results 1 to 3 of 3

Thread: Layerd Architecture

  1. #1

    Default Layerd Architecture

    Hi Guys,

    I am new to Spring and just started a project. In there i have decided to use 3 layes web, Service and DAO. So method callings should be from web to Service
    and then service to DAO. In here i need to use business logic from another service. So can we call one service from another service. Or do we have to write that service class as another utility class. what is the best practise for above scenario. your help will be appriciated

    Thanks
    Keth

  2. #2
    Join Date
    May 2005
    Posts
    288

    Default

    Per se, there is nothing wrong with calling one service from another. Yet there are a few things to look out for:
    - Invoking a service method often starts (and ends) a transaction. Make sure you don't start a new transaction, when you invoke a service method from within a service method. This could lead to inconsistencies
    - A utility class might be easier for maintenance in the long run. There is simply less code to look at in case of changes.
    - Needing the same functionality in two places is a strong hint to put that functionality into the domain model if possible or into an aspect or a proxy.

    HTH

  3. #3
    Join Date
    Jul 2010
    Posts
    1

    Default

    Hi,

    great post, it really helped me alot…gives me alot of information… thanks…. nice job…
    _______________________
    Credit Repair | Bad Credit Repair Report

Posting Permissions

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