Factory methods with Fluent configuration

7 views
Skip to first unread message

Fabio Maulo

unread,
Jan 6, 2009, 5:49:58 PM1/6/09
to Castle Project Users
Hi.
I would like to know which is the corresponding fluent-configuration
sentence for the follow xml configuration.

<component id="uNhAddIns.sessionFactory"
type="NHibernate.ISessionFactory, NHibernate"
factoryId="sessionFactoryProvider"
factoryCreate="GetFactory">
<parameters>
<factoryId>uNhAddIns</factoryId>
</parameters>
</component>

Thanks.

Tuna Toksöz

unread,
Jan 7, 2009, 12:00:57 AM1/7/09
to castle-pro...@googlegroups.com
http://mawi.org/ProgrammaticCastleMicrokernelWindsorAmpTheFactoryFacility.aspx

This one?

Tuna Toksöz
http://tunatoksoz.com

Typos included to enhance the readers attention!

Tuna Toksöz

unread,
Jan 7, 2009, 12:01:37 AM1/7/09
to castle-pro...@googlegroups.com
MM not very fluent though.


Tuna Toksöz
http://tunatoksoz.com

Typos included to enhance the readers attention!



Germán Schuager

unread,
Jan 7, 2009, 5:10:57 AM1/7/09
to castle-pro...@googlegroups.com

Fabio Maulo

unread,
Jan 7, 2009, 8:29:48 AM1/7/09
to Castle Project Users
Thanks Germán. Your solution is more closer to what I need but I think
that something more specific is needed in windsor-fluent-conf for
factories.
Hopefully, when I comeback from my vacations, I'll write something
more here.
Tnx btw.

On 7 ene, 07:10, "Germán Schuager" <gschua...@gmail.com> wrote:
> Maybe you can use something from here:http://bugsquash.blogspot.com/2008/12/castle-windsor-factory-method-s...

Fabio Maulo

unread,
Feb 18, 2009, 11:59:18 PM2/18/09
to Castle Project Users
See the first post of this thread for XML configuration.

I would like something like:
container.Register(Component.For<ISessionFactory>
().Factory<ISessionFactoryProvider>(serviceFactory =>
serviceFactory.GetFactory("uNhAddIns")));

Extensions? patch? open a new issue ? or is available something
similar ?

Thanks.

On 7 ene, 07:10, "Germán Schuager" <gschua...@gmail.com> wrote:
> Maybe you can use something from here:http://bugsquash.blogspot.com/2008/12/castle-windsor-factory-method-s...

mausch

unread,
Feb 19, 2009, 6:12:34 PM2/19/09
to Castle Project Users
With a little addition to those extension methods it can be done, see:
http://code.google.com/p/mausch/source/detail?r=144
http://code.google.com/p/mausch/source/detail?r=145

Although this is somewhat different from the xml config above, since
the xml config resolves the factory by id and this extension resolves
it by service type.

Thejuan

unread,
Mar 22, 2009, 4:19:31 PM3/22/09
to Castle Project Users
Is there anyway to get the Resolve Arguments passed through?

container.Resolve<IService>(new { parameterForFactoryConstructor =
"ARunTimeValue" }
at the moment these aren't available to the FactoryProxy from the
extension method, so it can't pass it on.


On Feb 19, 11:12 pm, mausch <mauricioschef...@gmail.com> wrote:
> With a little addition to those extension methods it can be done, see:http://code.google.com/p/mausch/source/detail?r=144http://code.google.com/p/mausch/source/detail?r=145
Reply all
Reply to author
Forward
0 new messages