Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Separate Web Tier and Business Logic tier.

  1. #1
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    4

    Default Separate Web Tier and Business Logic tier.

    Hi all,

    I'm trying to understand how I might put together an application where I have a number of web applications which all need to reuse common business logic. Rather than place the logic in each web application, I would like to create a separate tier (which could run on a separate machine).

    Using spring in my web tier (inside Tomcat) is quite well documented and straightforward. My concern is how to run Spring in the middle tier, where ideally there won't be any Tomcat? How can one instantiate a Spring container in a standalone mode (and I'm not talking rich client here, I'm talking about on the server side). How could I, for example, construct a Spring container, which handled all my business objects and their persistence and ran as an NT (windows) service?

    Has anyone constructed an architecture such as this? Which remoting protocol would be the most efficient for communications between the web tier (tomcat + spring) and the middle tier (spring standalone)? RMI?

    Thanks for any assistance,
    Dominic.

  2. #2
    Join Date
    Feb 2005
    Posts
    17

    Default

    I can't give you an advice about which remoting-communication protocol
    to chose - i'm only doing 'small-systems',
    but to create an application in 'standalone-mode' simply
    use a FileSystemXmlApplicationContext.

    To use your java application as daemon(*nix) or service(windows),
    take a look at this project http://wrapper.sourceforge.net/

    chris

  3. #3
    Join Date
    Oct 2004
    Location
    Antwerp, Belgium
    Posts
    96

    Default

    You can put your business logic in a seperate WAR and deploy that in your servlet container. In this WAR you can expose your services with HTTP invoker.

    Your client applications (web application, rich clients, ...) can access the business logic using HTTP invoker.

  4. #4
    Join Date
    Feb 2005
    Location
    Boston, MA
    Posts
    1,142

    Default

    Why do you want to run the business tier on a seperate machine? Initially you can design your business objects so they run locally, and when you later want to scale the system you can move the business objects to another machine without having to redesign your web tier.

  5. #5
    Join Date
    Oct 2004
    Location
    Antwerp, Belgium
    Posts
    96

    Default

    Quote Originally Posted by wpoitras
    Why do you want to run the business tier on a seperate machine? Initially you can design your business objects so they run locally, and when you later want to scale the system you can move the business objects to another machine without having to redesign your web tier.
    I'm not agrueing to run business logic on a separate machine although this is entirely feasible. Running your business logic centrally through remoting instead of in each deployed client locally offers a guarantee that there is only one version of your business logic deployed.

  6. #6
    Join Date
    Oct 2004
    Location
    Herndon, VA, US
    Posts
    648

    Default

    There is difference between "sharing the same codebase", and "sharing the same physical deployment". I'd like to understand why it is worth all the remoting cost and extra architectural complexity to share one single physical deployment of the business tier, vs. sharing the same code base by including th same jar in every web app - how often do we redeploy a production web app in real world, like, three times a year?
    --Jing Xue

  7. #7
    Join Date
    Oct 2004
    Location
    Antwerp, Belgium
    Posts
    96

    Default

    Quote Originally Posted by manifoldronin
    There is difference between "sharing the same codebase", and "sharing the same physical deployment". I'd like to understand why it is worth all the remoting cost and extra architectural complexity to share one single physical deployment of the business tier, vs. sharing the same code base by including th same jar in every web app - how often do we redeploy a production web app in real world, like, three times a year?
    I'm not saying this is always a requirement. If you have N client deployments depending on a single business logic tier accessing this business logic through remoting instead of local executions allows you to re-deploy the central BL deployment once instead of updating N clients as long as the client side API does not change. This can be an important feature, for example to fix bugs in a short timeframe.

  8. #8
    Join Date
    Aug 2004
    Location
    Germany, Magdeburg
    Posts
    279

    Default

    This can be an important feature, for example to fix bugs in a short timeframe.
    Arn't there solutions available for distributed updates? Just wondering... .

  9. #9
    Join Date
    Oct 2004
    Location
    Herndon, VA, US
    Posts
    648

    Default

    Quote Originally Posted by tentacle
    I'm not saying this is always a requirement. If you have N client deployments depending on a single business logic tier accessing this business logic through remoting instead of local executions allows you to re-deploy the central BL deployment once instead of updating N clients as long as the client side API does not change. This can be an important feature, for example to fix bugs in a short timeframe.
    Mmm, I still don't buy it. :wink:
    I admit it's more convenient, but my question is whether it's worth the performance and architectural complexity penalties. Especially when you consider that whenever you deploy a new version of this central BL, chances are you will need to run all the client apps through regression tests anyway (and lots of other release preparation work), so is the time spent on repackaging client apps with a new version of the BL jar really that significant?
    --Jing Xue

  10. #10
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    4

    Default

    Quote Originally Posted by tentacle
    You can put your business logic in a seperate WAR and deploy that in your servlet container. In this WAR you can expose your services with HTTP invoker.

    Your client applications (web application, rich clients, ...) can access the business logic using HTTP invoker.
    Effectively, this is the other scenario that I was thinking about. In this case, though, if the business logic tier was running in the same tomcat instance (asame JVM) as the web applications, it would seem to be a pity to use a remoting protocol for the communications.

    My question in this case would be:

    Is there any way to use Spring with Tomcat at a lower level than at a web application level? Can you get Tomcat to load Spring using a lower level classloader so that any services, beans, etc. could be made available to all the web applications running within the specific Tomcat instance?

Similar Threads

  1. Replies: 4
    Last Post: Feb 19th, 2006, 07:56 PM
  2. Replies: 2
    Last Post: Oct 10th, 2005, 05:12 PM
  3. Presentation and Business Tier Communication
    By vaibhavkhattri in forum Architecture
    Replies: 4
    Last Post: Sep 15th, 2005, 08:31 AM
  4. Spring in a multi tier (portal) enviroment
    By jherbst in forum Architecture
    Replies: 1
    Last Post: Jul 20th, 2005, 01:35 AM
  5. Replies: 3
    Last Post: Jun 21st, 2005, 04:20 PM

Posting Permissions

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