On Tue, 30 Apr 2002, Phase Web and Multimedia wrote:

> Date: Tue, 30 Apr 2002 11:50:30 -0600
> From: Phase Web and Multimedia <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts User List <[EMAIL PROTECTED]>
> Subject: Best Practice Question.
>
> I have a bean that is created when my app starts and it contains some
> database table conifguration info (I'll call it my config bean). Later on in
> an Action class another bean, that I'll call my logic bean, needs to access
> the values of the config bean. Would it be proper to use the Action class to
> pass the config bean to the logic bean and let the logic bean extract the
> values or should I extract all the values from the config bean within the
> Action class and pass the config info in a different manner.
>

You'll need to pass a reference to the config bean as a parameter to a
logic bean method.  You could instead pass a reference to the servlet
context (so that it could pull out the config bean attribute), but that
ties you more tightly to running only in a web application -- presumably,
your config bean doesn't have any "javax.servlet.*" imports in it, so it
could be reused elsewhere.

> Thanks,
> Brandon Goodin
> Phase Web and Multimedia
> P (406) 862-2245
> F (406) 862-0354
> [EMAIL PROTECTED]
> http://www.phase.ws
>

Craig


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to