Results 1 to 2 of 2

Thread: ApplicationContext in Business Objects

  1. #1
    Join Date
    May 2005
    Posts
    3

    Default ApplicationContext in Business Objects

    Can someone give me some best practices for obtaining an ApplicationContext from within a Business Object. I have a struts web application which leverages the ContextListener stuff, but that is for "Action" classes. What do I do in my Business Object which needs access to another business object defined in Spring? I have an "order" business object which needs access to a "shipping calculator" business object, both defined in spring, but not a part of the action. Is it best to use ThreadLocal variables integrated with ContextListener, is it best to stor the ApplicationContext in JNDI? What is the best approach? How do I hook Business objects with Spring?
    Thanks

  2. #2

    Default

    The best way is to have a setter for "shipping calculator" in your "order" object, then set that from your application context definition file.

Similar Threads

  1. Spring-based architectural approach
    By diegum in forum Architecture
    Replies: 9
    Last Post: May 10th, 2007, 04:09 PM
  2. Replies: 2
    Last Post: Oct 10th, 2005, 05:12 PM
  3. Testing Business Objects
    By jopaki in forum Container
    Replies: 2
    Last Post: Aug 16th, 2005, 04:11 AM
  4. Binding to business domain objects
    By klr8 in forum Architecture
    Replies: 2
    Last Post: Mar 15th, 2005, 01:21 AM
  5. Should Business Objects have References to DAOs?
    By sethladd in forum Architecture
    Replies: 9
    Last Post: Aug 25th, 2004, 01:18 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
  •