You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Josh Canfield (JIRA)" <ji...@apache.org> on 2011/06/30 19:34:28 UTC

[jira] [Commented] (TAP5-1565) OrderedConfiguration should have methods to make it easy to add elements in sequential order

    [ https://issues.apache.org/jira/browse/TAP5-1565?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13057943#comment-13057943 ] 

Josh Canfield commented on TAP5-1565:
-------------------------------------

Instead of adding a new method, can we just consider add(String, Object) to be sequential? 

I can't see that breaking any existing code.

  configuration.add("item1", new Item1()); 
  configuration.add("item2", new Item2()); 
  configuration.add("item3", new Item3());
  configuration.add("before2", new Item4(), "before:item2");

Results in:

[
  Item1(),
  Item4(),
  Item2(),
  Item3()
]
 


> OrderedConfiguration should have methods to make it easy to add elements in sequential order
> --------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1565
>                 URL: https://issues.apache.org/jira/browse/TAP5-1565
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>    Affects Versions: 5.3
>            Reporter: Howard M. Lewis Ship
>            Priority: Minor
>
> It is not uncommon to have a series of elements to add to an OrderedConfiguration in a specific order; it would be nice if there was a way to add sequential items without manually tracking each nodes name and adding "after:" clauses.
> Example:
>   configuration.add("item1", new Item1());
>   configuration.addSequential("item2", new Item2());
>   configuration.addInstanceSequential("item3", Item3.class);
> This would simply add an "after:item1" ordering constraint for item2, and an "after:item3" constraint for item3.
> It should be legal to add an item sequentially, even if there is no previously added item (added in this contribution method, or elsewhere), in which case, no ordering constraint it added.
> Would "next" and "nextInstance" be better than "addSequential" and "addInstanceSequential"?  I'm open to other suggestions on the naming.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira