Results 1 to 3 of 3

Thread: Passing context information between different layer

  1. #1

    Default Passing context information between different layer

    Hi,

    I am just wondering what would be the best aproach to create and pass information i.e context (request, session, user profile etc) between layors (Persentation/ Business / Persistence) using Struts, Spring and (Either EJB's or Hibernate). Is their already something built in Spring which is similar to WorkArea concept in WAS 6.0

    Thanks in advance

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,104

    Default

    You usually won't want to pass something like request or session, as you want layers beneath the web to be independent of the web layer.

    If you want to avoid passing objects via method arguments, attaching objects to the current thread using ThreadLocal is a useful approach.

  3. #3
    Join Date
    Aug 2004
    Location
    Hawaii, US
    Posts
    225

    Default

    Quote Originally Posted by katentim
    If you want to avoid passing objects via method arguments, attaching objects to the current thread using ThreadLocal is a useful approach.
    For an example of this, consider checking out Acegi Security Framework. It stores its security information inside a ThreadLocal, making it available anywhere in the Thread.

Similar Threads

  1. design question: passing context
    By Alarmnummer in forum Management
    Replies: 0
    Last Post: Oct 3rd, 2005, 01:20 PM
  2. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  3. One ApplicationContext per Layer problem...
    By Alwin in forum Container
    Replies: 2
    Last Post: Jul 7th, 2005, 10:49 PM
  4. Replies: 2
    Last Post: Mar 27th, 2005, 10:50 PM
  5. User information in the service layer
    By luxaeterna in forum Architecture
    Replies: 5
    Last Post: Feb 24th, 2005, 11:14 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
  •