You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Denis Stepanov (Created) (JIRA)" <ji...@apache.org> on 2012/02/08 12:12:57 UTC

[jira] [Created] (TAP5-1842) @Startup should support name and constraints

@Startup should support name and constraints
--------------------------------------------

                 Key: TAP5-1842
                 URL: https://issues.apache.org/jira/browse/TAP5-1842
             Project: Tapestry 5
          Issue Type: Improvement
          Components: tapestry-ioc
            Reporter: Denis Stepanov


It would be nice to have something like:

@Startup(name = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Denis Stepanov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13225246#comment-13225246 ] 

Denis Stepanov commented on TAP5-1842:
--------------------------------------

If you don't want "two ways" there is no need for the @Startup in the first place, your argument doesn't make much sense to me, I'm sorry. I thought that Tapestry motto is "code less", so if there is a second way with less code, why it's a bad thing?

Steve suggested on the mailing list the same improvement, why it doesn't count?

Denis




                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (TAP5-1842) @Startup should support id and constraints

Posted by "Denis Stepanov (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Denis Stepanov updated TAP5-1842:
---------------------------------

    Attachment: 0001-TAP5-1842.patch

Patch generated using git format-patch, should be svn compatible.

patch -p1 -i 0001-TAP5-1842.patch
                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>         Attachments: 0001-TAP5-1842.patch
>
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Denis Stepanov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13232539#comment-13232539 ] 

Denis Stepanov commented on TAP5-1842:
--------------------------------------

I have changed it to use the Order annotation and ModuleName.method as the default startup contribution name, see the test https://github.com/dstepanov/tapestry5/blob/1994446c56c87a1a03b2ca790fcfb207f1558d80/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/StartupModule3.java

                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Thiago H. de Paula Figueiredo (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13223259#comment-13223259 ] 

Thiago H. de Paula Figueiredo commented on TAP5-1842:
-----------------------------------------------------

On Tue, 06 Mar 2012 10:32:58 -0300, Dragan Sahpaski (Commented) (JIRA)  


Doesn't contributing to the RegistryStartup service, which has an ordered  
configuration, does exactly what's been asked here? I don't see the need  
for two different ways to do the same thing. As far as I can see, @Startup  
was meant to be used in simpler cases (without ordering).

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Steve Eynon (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13224965#comment-13224965 ] 

Steve Eynon commented on TAP5-1842:
-----------------------------------

I asked about this last year - 
http://tapestry.1045711.n5.nabble.com/Ordering-Constraints-for-Startup-td4853362.html

My idea was to re-use the @Order annotation which is currently used with decorators.

Steve.
                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: [jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by Denis Stepanov <de...@gmail.com>.
> Doesn't contributing to the RegistryStartup service, which has an ordered configuration, does exactly what's been asked here?

Yes it does, but it is a lot messier, you need an inner class, and so on. Specialy when you are using @Startup and then you need an order.

Whole purpose of the @Startup is that you don't need to add an contribution, as it says in JavaDoc:  

"Instead of making contributions to the RegistryStartup service configuration you can provide startup methods inside your modules."

> I don't see the need for two different ways to do the same thing. 


There are many cases in Tapestry when you can do one thing in two different ways, it doesn't mean it's a bad thing.

> If I remember correctly, we had this discussion already. IMO, @Startup shouldn't have any order. 

It doesn't have an order when you don't need it, if you want an order you can have it. I don't see why anyone should be against it.

If there is already @Startup annotation why not to make it more useful?

Denis

Mar 6, 2012 v 2:54 PM, Igor Drobiazko:

> If I remember correctly, we had this discussion already. IMO, @Startup
> shouldn't have any order. If you need some kind of order, do it as Thiago
> suggested or build your own service with ordered configuration which you
> inject into a startup method.
> 
> On Tue, Mar 6, 2012 at 2:48 PM, Thiago H. de Paula Figueiredo <
> thiagohp@gmail.com> wrote:
> 
>> On Tue, 06 Mar 2012 10:32:58 -0300, Dragan Sahpaski (Commented) (JIRA) <
>> jira@apache.org> wrote:
>> 
>> 
>>>   [ https://issues.apache.org/**jira/browse/TAP5-1842?page=**
>>> com.atlassian.jira.plugin.**system.issuetabpanels:comment-**
>>> tabpanel&focusedCommentId=**13223254#comment-13223254<https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13223254#comment-13223254>]
>>> 
>>> Dragan Sahpaski commented on TAP5-1842:
>>> ------------------------------**---------
>>> 
>>> I like it. I think it would be useful.
>>> 
>> 
>> Doesn't contributing to the RegistryStartup service, which has an ordered
>> configuration, does exactly what's been asked here? I don't see the need
>> for two different ways to do the same thing. As far as I can see, @Startup
>> was meant to be used in simpler cases (without ordering).
>> 
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
>> and instructor
>> Owner, Ars Machina Tecnologia da Informação Ltda.
>> http://www.arsmachina.com.br
>> 
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.**apache.org<de...@tapestry.apache.org>
>> For additional commands, e-mail: dev-help@tapestry.apache.org
>> 
>> 
> 
> 
> -- 
> Best regards,
> 
> Igor Drobiazko
> http://tapestry5.de
> http://twitter.com/drobiazko


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: [jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by Igor Drobiazko <ig...@gmail.com>.
If I remember correctly, we had this discussion already. IMO, @Startup
shouldn't have any order. If you need some kind of order, do it as Thiago
suggested or build your own service with ordered configuration which you
inject into a startup method.

On Tue, Mar 6, 2012 at 2:48 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Tue, 06 Mar 2012 10:32:58 -0300, Dragan Sahpaski (Commented) (JIRA) <
> jira@apache.org> wrote:
>
>
>>    [ https://issues.apache.org/**jira/browse/TAP5-1842?page=**
>> com.atlassian.jira.plugin.**system.issuetabpanels:comment-**
>> tabpanel&focusedCommentId=**13223254#comment-13223254<https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13223254#comment-13223254>]
>>
>> Dragan Sahpaski commented on TAP5-1842:
>> ------------------------------**---------
>>
>> I like it. I think it would be useful.
>>
>
> Doesn't contributing to the RegistryStartup service, which has an ordered
> configuration, does exactly what's been asked here? I don't see the need
> for two different ways to do the same thing. As far as I can see, @Startup
> was meant to be used in simpler cases (without ordering).
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.**apache.org<de...@tapestry.apache.org>
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko
http://tapestry5.de
http://twitter.com/drobiazko

Re: [jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 06 Mar 2012 10:32:58 -0300, Dragan Sahpaski (Commented) (JIRA)  
<ji...@apache.org> wrote:

>
>     [  
> https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13223254#comment-13223254  
> ]
>
> Dragan Sahpaski commented on TAP5-1842:
> ---------------------------------------
>
> I like it. I think it would be useful.

Doesn't contributing to the RegistryStartup service, which has an ordered  
configuration, does exactly what's been asked here? I don't see the need  
for two different ways to do the same thing. As far as I can see, @Startup  
was meant to be used in simpler cases (without ordering).

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Dragan Sahpaski (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13223254#comment-13223254 ] 

Dragan Sahpaski commented on TAP5-1842:
---------------------------------------

I like it. I think it would be useful.

Cheers
                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Dragan Sahpaski (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13223254#comment-13223254 ] 

Dragan Sahpaski commented on TAP5-1842:
---------------------------------------

I like it. I think it would be useful.

Cheers
                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (TAP5-1842) @Startup should support id and constraints

Posted by "Denis Stepanov (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Denis Stepanov updated TAP5-1842:
---------------------------------

    Description: 
It would be nice to have something like:

@Startup(id = "DBInit", constraints = "before:*")

  was:
It would be nice to have something like:

@Startup(name = "DBInit", constraints = "before:*")

        Summary: @Startup should support id and constraints  (was: @Startup should support name and constraints)
    
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Denis Stepanov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13225184#comment-13225184 ] 

Denis Stepanov commented on TAP5-1842:
--------------------------------------

I can change it to use the @Order, but I'm not sure Tapestry devs are interested or even care to have it.

Denis




                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Thiago H. de Paula Figueiredo (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13223259#comment-13223259 ] 

Thiago H. de Paula Figueiredo commented on TAP5-1842:
-----------------------------------------------------

On Tue, 06 Mar 2012 10:32:58 -0300, Dragan Sahpaski (Commented) (JIRA)  


Doesn't contributing to the RegistryStartup service, which has an ordered  
configuration, does exactly what's been asked here? I don't see the need  
for two different ways to do the same thing. As far as I can see, @Startup  
was meant to be used in simpler cases (without ordering).

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (TAP5-1842) @Startup should support id and constraints

Posted by "Denis Stepanov (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Denis Stepanov updated TAP5-1842:
---------------------------------

    Description: 
It would be nice to have something like:

@Startup(id = "DBInit", constraints = "before:*")

  was:
It would be nice to have something like:

@Startup(name = "DBInit", constraints = "before:*")

        Summary: @Startup should support id and constraints  (was: @Startup should support name and constraints)
    
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Denis Stepanov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13225973#comment-13225973 ] 

Denis Stepanov commented on TAP5-1842:
--------------------------------------

It should work across multiple modules, see my implementation:

https://github.com/dstepanov/tapestry5/commit/21f90340d98e3aa778f65ca6a46767ad7662c8ff

Default id is ModuleName#method, I would prefer to have an ability to specify the startup id:

@Startup(id = "third", constraints = "after:second")
methodThird

or change it to use the @Order annotation:

@Order("after:second")
@Startup("third")
methodThird

The @Order is only used for decoration, I hope it would't be a problem to use it elsewhere.
                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Thiago H. de Paula Figueiredo (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13225197#comment-13225197 ] 

Thiago H. de Paula Figueiredo commented on TAP5-1842:
-----------------------------------------------------

On Thu, 08 Mar 2012 09:44:50 -0300, Denis Stepanov  


Your wording makes it seem the Tapestry committers are ignoring user  
suggestions or patches. That isn't the case. Can't they disagree with user  
suggestions and patches? Actually, two of them already said they don't  
agree with your suggestion to avoid having two ways of doing the same  
thing, as the current one is good enough.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Denis Stepanov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13223286#comment-13223286 ] 

Denis Stepanov commented on TAP5-1842:
--------------------------------------


Yes it does, but it is a lot messier, you need an inner class, and so on. Specialy when you are using @Startup and then you need an order.

Whole purpose of the @Startup is that you don't need to add an contribution, as it says in JavaDoc:  

"Instead of making contributions to the RegistryStartup service configuration you can provide startup methods inside your modules."



There are many cases in Tapestry when you can do one thing in two different ways, it doesn't mean it's a bad thing.


It doesn't have an order when you don't need it, if you want an order you can have it. I don't see why anyone should be against it.

If there is already @Startup annotation why not to make it more useful?

Denis

Mar 6, 2012 v 2:54 PM, Igor Drobiazko:



                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Igor Drobiazko (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13223260#comment-13223260 ] 

Igor Drobiazko commented on TAP5-1842:
--------------------------------------

If I remember correctly, we had this discussion already. IMO, @Startup
shouldn't have any order. If you need some kind of order, do it as Thiago
suggested or build your own service with ordered configuration which you
inject into a startup method.

On Tue, Mar 6, 2012 at 2:48 PM, Thiago H. de Paula Figueiredo <



-- 
Best regards,

Igor Drobiazko
http://tapestry5.de
http://twitter.com/drobiazko

                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Denis Stepanov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13225246#comment-13225246 ] 

Denis Stepanov commented on TAP5-1842:
--------------------------------------

If you don't want "two ways" there is no need for the @Startup in the first place, your argument doesn't make much sense to me, I'm sorry. I thought that Tapestry motto is "code less", so if there is a second way with less code, why it's a bad thing?

Steve suggested on the mailing list the same improvement, why it doesn't count?

Denis




                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Denis Stepanov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13223286#comment-13223286 ] 

Denis Stepanov commented on TAP5-1842:
--------------------------------------


Yes it does, but it is a lot messier, you need an inner class, and so on. Specialy when you are using @Startup and then you need an order.

Whole purpose of the @Startup is that you don't need to add an contribution, as it says in JavaDoc:  

"Instead of making contributions to the RegistryStartup service configuration you can provide startup methods inside your modules."



There are many cases in Tapestry when you can do one thing in two different ways, it doesn't mean it's a bad thing.


It doesn't have an order when you don't need it, if you want an order you can have it. I don't see why anyone should be against it.

If there is already @Startup annotation why not to make it more useful?

Denis

Mar 6, 2012 v 2:54 PM, Igor Drobiazko:



                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Josh Canfield (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13225726#comment-13225726 ] 

Josh Canfield commented on TAP5-1842:
-------------------------------------

There is a vote button in the defect. If you care about the feature vote it up. Comments are nice but number of comments doesn't bring the issue to the top of the most wanted list.

I can't say that I've ever had a need for ordered @Startup methods, but I like the idea of being able to create specific methods for specific tasks. 
Having multiple @Startup methods seems pretty natural, and being able to define their order would be nice. 

I assume you're not asking to have this work across multiple modules? I often break up a project into multiple modules and have my AppModule include them.

@Startup("before:method")
ModuleA.method1

ModuleB.method

@Startup("after:method")
ModuleA.method2

                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Denis Stepanov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13225184#comment-13225184 ] 

Denis Stepanov commented on TAP5-1842:
--------------------------------------

I can change it to use the @Order, but I'm not sure Tapestry devs are interested or even care to have it.

Denis




                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Thiago H. de Paula Figueiredo (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13225197#comment-13225197 ] 

Thiago H. de Paula Figueiredo commented on TAP5-1842:
-----------------------------------------------------

On Thu, 08 Mar 2012 09:44:50 -0300, Denis Stepanov  


Your wording makes it seem the Tapestry committers are ignoring user  
suggestions or patches. That isn't the case. Can't they disagree with user  
suggestions and patches? Actually, two of them already said they don't  
agree with your suggestion to avoid having two ways of doing the same  
thing, as the current one is good enough.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Denis Stepanov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13225973#comment-13225973 ] 

Denis Stepanov commented on TAP5-1842:
--------------------------------------

It should work across multiple modules, see my implementation:

https://github.com/dstepanov/tapestry5/commit/21f90340d98e3aa778f65ca6a46767ad7662c8ff

Default id is ModuleName#method, I would prefer to have an ability to specify the startup id:

@Startup(id = "third", constraints = "after:second")
methodThird

or change it to use the @Order annotation:

@Order("after:second")
@Startup("third")
methodThird

The @Order is only used for decoration, I hope it would't be a problem to use it elsewhere.
                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Denis Stepanov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13232539#comment-13232539 ] 

Denis Stepanov commented on TAP5-1842:
--------------------------------------

I have changed it to use the Order annotation and ModuleName.method as the default startup contribution name, see the test https://github.com/dstepanov/tapestry5/blob/1994446c56c87a1a03b2ca790fcfb207f1558d80/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/StartupModule3.java

                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Josh Canfield (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13225726#comment-13225726 ] 

Josh Canfield commented on TAP5-1842:
-------------------------------------

There is a vote button in the defect. If you care about the feature vote it up. Comments are nice but number of comments doesn't bring the issue to the top of the most wanted list.

I can't say that I've ever had a need for ordered @Startup methods, but I like the idea of being able to create specific methods for specific tasks. 
Having multiple @Startup methods seems pretty natural, and being able to define their order would be nice. 

I assume you're not asking to have this work across multiple modules? I often break up a project into multiple modules and have my AppModule include them.

@Startup("before:method")
ModuleA.method1

ModuleB.method

@Startup("after:method")
ModuleA.method2

                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Steve Eynon (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13224965#comment-13224965 ] 

Steve Eynon commented on TAP5-1842:
-----------------------------------

I asked about this last year - 
http://tapestry.1045711.n5.nabble.com/Ordering-Constraints-for-Startup-td4853362.html

My idea was to re-use the @Order annotation which is currently used with decorators.

Steve.
                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (TAP5-1842) @Startup should support id and constraints

Posted by "Denis Stepanov (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Denis Stepanov updated TAP5-1842:
---------------------------------

    Attachment: 0001-TAP5-1842.patch

Patch generated using git format-patch, should be svn compatible.

patch -p1 -i 0001-TAP5-1842.patch
                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>         Attachments: 0001-TAP5-1842.patch
>
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1842) @Startup should support id and constraints

Posted by "Igor Drobiazko (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13223260#comment-13223260 ] 

Igor Drobiazko commented on TAP5-1842:
--------------------------------------

If I remember correctly, we had this discussion already. IMO, @Startup
shouldn't have any order. If you need some kind of order, do it as Thiago
suggested or build your own service with ordered configuration which you
inject into a startup method.

On Tue, Mar 6, 2012 at 2:48 PM, Thiago H. de Paula Figueiredo <



-- 
Best regards,

Igor Drobiazko
http://tapestry5.de
http://twitter.com/drobiazko

                
> @Startup should support id and constraints
> ------------------------------------------
>
>                 Key: TAP5-1842
>                 URL: https://issues.apache.org/jira/browse/TAP5-1842
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>            Reporter: Denis Stepanov
>
> It would be nice to have something like:
> @Startup(id = "DBInit", constraints = "before:*")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira