• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: referencing Application classes from non-component classes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: referencing Application classes from non-component classes


  • Subject: Re: referencing Application classes from non-component classes
  • From: Paul Lynch <email@hidden>
  • Date: Sat, 26 Aug 2006 11:24:13 +0100


On 26 Aug 2006, at 06:48, Mike Schrag wrote:

Any examples of the dirty way? I'll check the backlog of emails as well.
Assuming your EO's are in the same project as your Application, there really isn't anything you need to do except import your Application class and call the method. There's nothing particularly special about Application compared to any other Java class.

Ahem.

Application application = (Application)WOApplication.application();

I take in a lot of settings via both the Properties file, and settings files that I load (from plists or xml; the latter sucks harder). But so far I have avoided doing this from the model layer, as it goes against MVC principles. One technique to use is to create class (sorry, static) methods in your model class for these properties, and call them from your application constructor. That way you don't have to feel guilty.

Paul
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: referencing Application classes from non-component classes
      • From: Art Isbell <email@hidden>
References: 
 >referencing Application classes from non-component classes (From: "Joe Little" <email@hidden>)
 >Re: referencing Application classes from non-component classes (From: "Joe Little" <email@hidden>)
 >Re: referencing Application classes from non-component classes (From: Mike Schrag <email@hidden>)
 >Re: Re: referencing Application classes from non-component classes (From: "Joe Little" <email@hidden>)
 >Re: referencing Application classes from non-component classes (From: Mike Schrag <email@hidden>)

  • Prev by Date: Re: Looks like ThinkSecret got some of the scoop on WO from WWDC'06
  • Next by Date: Re: Looks like ThinkSecret got some of the scoop on WO from WWDC'06
  • Previous by thread: Re: Re: referencing Application classes from non-component classes
  • Next by thread: Re: referencing Application classes from non-component classes
  • Index(es):
    • Date
    • Thread