Allowing properties to represent required dependencies

1 view
Skip to first unread message

cneu...@gmail.com

unread,
Jul 12, 2007, 2:21:14 PM7/12/07
to Castle Project Development List
Will anyone find it useful if I add a RequiredAttribute the
Castle.Core which
when applied to a property will make it a required dependency. This
reason
I would like this is to reduce the effect of adding a required
dependency to
a base class via the constructor and then having to visit all the
derived classes
constructors as well. This can occur with often with Controllers.

Hamilton Verissimo

unread,
Jul 12, 2007, 3:02:03 PM7/12/07
to castle-pro...@googlegroups.com
Will you built this support directly on the MicroKernel?


--
Cheers,
hamilton verissimo
ham...@castlestronghold.com
http://www.castlestronghold.com/

Craig Neuwirt

unread,
Jul 12, 2007, 3:03:37 PM7/12/07
to castle-pro...@googlegroups.com
Yes, I plan to do that

Hamilton Verissimo

unread,
Jul 12, 2007, 3:09:51 PM7/12/07
to castle-pro...@googlegroups.com
Are you going to change the property-something-contributor to inspect
for the attribute and set the dependency model to Optional=false?

My only concern is that it will be a GetCustomAttribute or IsDefined
call -- which is one of the most lengthy operations -- per public
instance property that will affect everyone. Therefore I'm fine with
the attribute, I'm not fine with this on the MicroKernel.

Craig Neuwirt

unread,
Jul 12, 2007, 3:14:13 PM7/12/07
to castle-pro...@googlegroups.com
On 7/12/07, Hamilton Verissimo <ham...@castlestronghold.com> wrote:

Are you going to change the property-something-contributor to inspect
for the attribute and set the dependency model to Optional=false?
 

My only concern is that it will be a GetCustomAttribute or IsDefined
call  -- which is one of the most lengthy operations -- per public
instance property that will affect everyone. Therefore I'm fine with
the attribute, I'm not fine with this on the MicroKernel.
 
Ok, so how about another contributer that will examine the property
dependencies and adjust the Optional flag after reading the attribute.
It will not be a default contributor though

Hamilton Verissimo

unread,
Jul 12, 2007, 3:16:35 PM7/12/07
to castle-pro...@googlegroups.com
On 7/12/07, Craig Neuwirt <cneu...@gmail.com> wrote:
> Ok, so how about another contributer that will examine the property
> dependencies and adjust the Optional flag after reading the attribute.
> It will not be a default contributor though

Cool ! :-)

Reply all
Reply to author
Forward
0 new messages