[ 
http://jira.codehaus.org/browse/JBEHAVE-329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=230594#action_230594
 ] 

Brian Repko commented on JBEHAVE-329:
-------------------------------------

The situation is based on a superclass having an annotation property that 
returns an array (@UsingSteps/instances) and a subclass having the same 
annotation property.  Should the instances from both classes be combined or not 
for the subclass.

The options that I see on this are

1) don't ever combine multi-valued annotation properties (current code with 
JBEHAVE-327 patches 1 and 2)
2) always combine multi-valued annotation properties (original code from 
Christiano)
3) optionally combine multi-valued annotation properties (what Spring does for 
@ContextConfiguration)

I still think that its fair to have 1 or 2 be the way JBehave works (I would 
opt for 1 as that is how standard annotations work) and users then have to 
adjust their class hierarchy or annotation properties.
But if we go with 3, then there are 2 options put forward.

3a) use boolean inherit<Property> properties to control array combination with 
default of true

this is the Spring solution and is the code in JBEHAVE-327 patch 3

3b) use of an @Inherited annotation - hence the title of this issue

I would argue strongly against 3b. Here are my reasons why:

1. @Inherited is already a meta-annotation name - I would use a different name
2. Use of a annotation already has its @Inherited behavior so this would 
require annotation rather than having a default value
3. I don't see how this design deals with the potential of multiple 
multi-valued properties or multiple annotations.

In order to illustrate 3.

Annotation A has properties aOne which returns a String[] and aTwo which 
returns a String[]
Annotation B has properties bOne which returns a String[] and bTwo which 
returns a String[]
Superclass S has @A with aOne and aTwo specified and @B with bOne and bTwo 
specified
Subclass C has @A and @B fully specified as well

How do I enable or disable array combination for only bTwo on C?

@Inherited(enabledProperties={"bTwo"})

Can I put that on S or C and they will both work?

If you are going to chose option 3 above (optionally doing array combination) 
then I fail to see why boolean properties are undesirable - they are exactly 
what you are looking for - boolean values defined right there with the property 
with a default value.  What is the downside of it?

However, I can see in light of what it takes to do this properly, that one 
might want to go back to option 1 (never) or 2 (always).


> Add @Inherited annotation to control inheritance behaviour of annotated 
> configuration
> -------------------------------------------------------------------------------------
>
>                 Key: JBEHAVE-329
>                 URL: http://jira.codehaus.org/browse/JBEHAVE-329
>             Project: JBehave
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Mauro Talevi
>             Fix For: 3.0
>
>
> As explained in JBEHAVE-327, it's useful to control inheritance behaviour.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to