Instead of changing the type to 'any' for your argument for
setNewsDAO, why don't you make a mock abstract class for your newDAO,
and then have both your newsDAO and newsDAO_XML extend the same
class. Then you can have that base abstract class be the type for
your argument. A good thing to do with interfaces by the way, which
of course ARE coming!
-Chris
Chris Scott
[EMAIL PROTECTED]
http://cdscott.blogspot.com/
http://www.coldspringframework.org/

On Mar 24, 2006, at 7:34 PM, Patrick Lebon wrote:
Well I was about to create a simple factory but instead I just changed
the type to "any" for the newsDAO argument in my newsService. Now I
can switch my dao's in my CS config as I please without needing an
additional factory.
Im not quite sure if this is good practice but it saves extra work and
I guess coldfusion has loose typing for a reason!
On 3/24/06, Kurt Wiersma <[EMAIL PROTECTED]> wrote:
You can do that by editing the CS config file. My guess is you
want to
decide which one to inject at run time based on another config
parameter,
correct? If that is the case then you might want to create your
own factory
which get configured first and call that factory through CS to get
the right
DAO to inject into your service.
--Kurt
On 3/23/06, Patrick Lebon <[EMAIL PROTECTED]> wrote:
I have a service (newsService) that accepts "model.new.newsDAO"
as an
argument, however I want to be able to inject it with either
"model.new.newsDAO_XML" or "model.new.newsDAO_MSSQL" via coldspring.
Im not exactly sure I understand factory support in coldspring so I
wanted to know if this was possible at the moment or do I need to
create my own DAO factory comonent?