[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tapestry-user
Subject:    Re: Injecting Logger into non-component classes
From:       Josh Canfield <joshcanfield () gmail ! com>
Date:       2010-07-26 22:28:17
Message-ID: AANLkTinShz9DAy6_W9sTLUBxYkaYy-Gp4_nSmpDuGVto () mail ! gmail ! com
[Download RAW message or body]

> I have DB access objects as separate XYZOperation classes.
> They are just classes, not pages or components.
> 
> How to inject Logger into them?

Why can't your XYZOperation classes be services?

> The only logical solution would be to build special service, say
> ContextService,
> which has logger, inject it into page/component where I use operations,
> and pass it to operation constructor.

I don't follow why you would need a ContextService to hold the logger.
Can't you just inject the logger into the page/component? Are you
wanting a different category?

Josh

On Mon, Jul 26, 2010 at 12:45 PM, Algirdas <algirdas.k@gmail.com> wrote:
> 
> Just to confirm that there is no other way -
> 
> I have DB access objects as separate XYZOperation classes.
> They are just classes, not pages or components.
> 
> How to inject Logger into them?
> 
> The only logical solution would be to build special service, say
> ContextService,
> which has logger, inject it into page/component where I use operations,
> and pass it to operation constructor.
> 
> Or there is a smarter way?
> --
> View this message in context: \
> http://tapestry-users.832.n2.nabble.com/Injecting-Logger-into-non-component-classes-tp5339492p5339492.html
>  Sent from the Tapestry Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 



-- 
--
http://www.bodylabgym.com - a private, by appointment only, one-on-one
health and fitness facility.
--
http://www.ectransition.com - Quality Electronic Cigarettes at a
reasonable price!
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic