Set() Syntax

2 views
Skip to first unread message

Erich Eichinger

unread,
Nov 21, 2009, 2:15:14 PM11/21/09
to spring-recoil-main
Hi Tom,

just played around w/ Recoil and have to admit, that I really like
it ;-)

Just a question: Is there a particular reason, why the syntax has to
read

Define<DbProviderFactoryObject>()
.Set(p => p.ConnectionString).To(() => "CS
{InvoicingManager.connectionstring}")
.Set(p => p.Provider).To(() => "SqlServer-2.0");

instead of the less "noisy"

Define<DbProviderFactoryObject>()
.Set(p => p.ConnectionString, "CS
{InvoicingManager.connectionstring}")
.Set(p => p.Provider, "SqlServer-2.0");

?

Also it'd be great to autowire by type or name with a syntax similar
to Wire(). This comes in handy, when one wants to mix autowiring and
explicit injection in a constructor:

Define( ()=>new MyRepository( WireByType<IMyDao>(),
"SomeOtherArgument" ) );


cheers,
Erich

Reply all
Reply to author
Forward
0 new messages