I have one blog CFC that returns blog results based on the params of the init(). I need to read that into two variables.
// Old Way…
application.BlogMain = createObject(‘component’,‘object.Blog’).init(“http://news.mySite.com/feed/?cat=2”);
application.BlogEvents = createObject(‘component’,‘object.Blog’).init(“http://news.mySite.com/feed/?cat=4”);
We moved the methods over to a new CFC to bring them into Wirebox.
// Attempt in Wirebox…
application.BlogService = application.wirebox.getInstance(‘BlogService’).init(“http://news.mySite.com/feed/?cat=2”);
application.BlogServiceEvents = application.wirebox.getInstance(‘BlogService’).init(“http://news.mySite.com/feed/?cat=4”);
The problem with this is that the second call runs the init and it changes the object at a deep enough level so that the “blogService” object (the first one) is changed as well.
After some research, I created an alias in a Binder, and got it to work. But it seemed like it was overly complicated. Is there a better/simpler way… like one that doesn’t have to use a binder config file? I would think this would be a pretty common task.
thanks for any help!
(based on a doc I found, I think my WB version is 1.6. I don’t know how to find out programmatically.)