Re: Re: referencing Application classes from non-component classes
Re: Re: referencing Application classes from non-component classes
- Subject: Re: Re: referencing Application classes from non-component classes
- From: "Joe Little" <email@hidden>
- Date: Fri, 25 Aug 2006 22:14:19 -0700
On 8/25/06, Mike Schrag <email@hidden> wrote:
This was actually discussed a couple weeks ago ... The quick summary
is that you CAN access Application, but you should feel dirty doing
it. The problem you will run into is that you may want to use your
EO's outside of the context of a full blown running Application, and
you're stuck with this odd dependency in the middle of your model layer.
Any examples of the dirty way? I'll check the backlog of emails as well.
A possible alternative would be to have a singleton
ApplicationSettings class that Application pushes values into, but
that you can talk to from your model without dragging in
WOApplication dependencies along the way.
Hm.. I thought I did this already. I currently reference an instance
of class with all my values that is instantiated by Application. The
only reference of the instance if via the Application, so I'm
obviously missing some fundamental design pattern I haven't touched
upon before.
ms
On Aug 26, 2006, at 12:52 AM, Joe Little wrote:
> The subject should be referencing Application class from non-
> component classes.
>
> On 8/25/06, Joe Little <email@hidden> wrote:
>> I'm trying to do something which I think is invalid.
>>
>> In my app I read in Properties file values in the Application
>> class in
>> an instance variable there. Throughout my components I can reference
>> them like:
>>
>> ((Application)application()).AdmitProps.evalGlobal()
>>
>> Sadly, it would appear that in my base EO classes, I cannot reference
>> Application similarly, as Xcode gives me an unresolved symbol. Is
>> there no way to reference these instance variables from classes as
>> such?
>>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> 40mdimension.com
>
> This email sent to email@hidden
_______________________________________________
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
_______________________________________________
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