You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Justin Pitts (JIRA)" <ji...@apache.org> on 2006/11/08 16:56:51 UTC
[jira] Created: (LANG-296) Add method chaining pattern to StopWatch
Add method chaining pattern to StopWatch
----------------------------------------
Key: LANG-296
URL: http://issues.apache.org/jira/browse/LANG-296
Project: Commons Lang
Issue Type: Improvement
Affects Versions: 2.2
Environment: any
Reporter: Justin Pitts
Priority: Trivial
Attachments: MethodChainingPattern
Implement the method chaining pattern (similiar to StringBuffer) to mutator methods. This enables the following code:
StopWatch s = new StopWatch().start();
System.out.println(s.stop().getTime());
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[jira] Commented: (LANG-296) Add method chaining pattern to
StopWatch
Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/LANG-296?page=comments#action_12448305 ]
Henri Yandell commented on LANG-296:
------------------------------------
On binary compatibility - it dictates which version of Lang it would go in (2.2.1, 2.3 and 3.0 being the potentials).
Your reply on the LOC helps me summarize my thoughts on it - the chaining pattern usually saves N-1 lines, do we want to add it to only save 1 line?
Or N-2 and 0 lines if the coder doesn't like accessor and mutator on the same line.
> Add method chaining pattern to StopWatch
> ----------------------------------------
>
> Key: LANG-296
> URL: http://issues.apache.org/jira/browse/LANG-296
> Project: Commons Lang
> Issue Type: Improvement
> Affects Versions: 2.2
> Environment: any
> Reporter: Justin Pitts
> Priority: Trivial
> Attachments: MethodChainingPattern
>
>
> Implement the method chaining pattern (similiar to StringBuffer) to mutator methods. This enables the following code:
> StopWatch s = new StopWatch().start();
> System.out.println(s.stop().getTime());
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[jira] Closed: (LANG-296) Add method chaining pattern to StopWatch
Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/LANG-296?page=all ]
Henri Yandell closed LANG-296.
------------------------------
Resolution: Won't Fix
Waited a while to see if there were any other opinions, but there don't seem to be. I'm resolving this as wontfix because I don't think the chaining pattern would have enough value.
Apologies for -1'ing the suggestion Justin.
> Add method chaining pattern to StopWatch
> ----------------------------------------
>
> Key: LANG-296
> URL: http://issues.apache.org/jira/browse/LANG-296
> Project: Commons Lang
> Issue Type: Improvement
> Affects Versions: 2.2
> Environment: any
> Reporter: Justin Pitts
> Priority: Trivial
> Attachments: MethodChainingPattern
>
>
> Implement the method chaining pattern (similiar to StringBuffer) to mutator methods. This enables the following code:
> StopWatch s = new StopWatch().start();
> System.out.println(s.stop().getTime());
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[jira] Commented: (LANG-296) Add method chaining pattern to
StopWatch
Posted by "Justin Pitts (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/LANG-296?page=comments#action_12448218 ]
Justin Pitts commented on LANG-296:
-----------------------------------
Henri: the usefulness lies in that it cuts the common use cases in half in LOC. Thats all.
> Add method chaining pattern to StopWatch
> ----------------------------------------
>
> Key: LANG-296
> URL: http://issues.apache.org/jira/browse/LANG-296
> Project: Commons Lang
> Issue Type: Improvement
> Affects Versions: 2.2
> Environment: any
> Reporter: Justin Pitts
> Priority: Trivial
> Attachments: MethodChainingPattern
>
>
> Implement the method chaining pattern (similiar to StringBuffer) to mutator methods. This enables the following code:
> StopWatch s = new StopWatch().start();
> System.out.println(s.stop().getTime());
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[jira] Commented: (LANG-296) Add method chaining pattern to
StopWatch
Posted by "Justin Pitts (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/LANG-296?page=comments#action_12448356 ]
Justin Pitts commented on LANG-296:
-----------------------------------
Well, in the case of this class, I would guess that typical usage patterns
are:
create -> start
stop->read
split -> read
It makes sense to me, this is how I find my team using the class.
However, if one of the underlying constraints of the framework is to
preserve binary compatability, then it makes no difference. My frustration
is that constraint ought to be made clear on the page describing
contributions.
> Add method chaining pattern to StopWatch
> ----------------------------------------
>
> Key: LANG-296
> URL: http://issues.apache.org/jira/browse/LANG-296
> Project: Commons Lang
> Issue Type: Improvement
> Affects Versions: 2.2
> Environment: any
> Reporter: Justin Pitts
> Priority: Trivial
> Attachments: MethodChainingPattern
>
>
> Implement the method chaining pattern (similiar to StringBuffer) to mutator methods. This enables the following code:
> StopWatch s = new StopWatch().start();
> System.out.println(s.stop().getTime());
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[jira] Commented: (LANG-296) Add method chaining pattern to
StopWatch
Posted by "Stephen Colebourne (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/LANG-296?page=comments#action_12448211 ]
Stephen Colebourne commented on LANG-296:
-----------------------------------------
Changing the return type of methods is binary incompatible.
> Add method chaining pattern to StopWatch
> ----------------------------------------
>
> Key: LANG-296
> URL: http://issues.apache.org/jira/browse/LANG-296
> Project: Commons Lang
> Issue Type: Improvement
> Affects Versions: 2.2
> Environment: any
> Reporter: Justin Pitts
> Priority: Trivial
> Attachments: MethodChainingPattern
>
>
> Implement the method chaining pattern (similiar to StringBuffer) to mutator methods. This enables the following code:
> StopWatch s = new StopWatch().start();
> System.out.println(s.stop().getTime());
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[jira] Updated: (LANG-296) Add method chaining pattern to StopWatch
Posted by "Justin Pitts (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/LANG-296?page=all ]
Justin Pitts updated LANG-296:
------------------------------
Attachment: MethodChainingPattern
Implementation diff.
> Add method chaining pattern to StopWatch
> ----------------------------------------
>
> Key: LANG-296
> URL: http://issues.apache.org/jira/browse/LANG-296
> Project: Commons Lang
> Issue Type: Improvement
> Affects Versions: 2.2
> Environment: any
> Reporter: Justin Pitts
> Priority: Trivial
> Attachments: MethodChainingPattern
>
>
> Implement the method chaining pattern (similiar to StringBuffer) to mutator methods. This enables the following code:
> StopWatch s = new StopWatch().start();
> System.out.println(s.stop().getTime());
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[jira] Commented: (LANG-296) Add method chaining pattern to
StopWatch
Posted by "Justin Pitts (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/LANG-296?page=comments#action_12448216 ]
Justin Pitts commented on LANG-296:
-----------------------------------
If binary compatibility is a concern, please make note of that on the contribution page. I wouldn't have spent the time to submit this if that were the case.
> Add method chaining pattern to StopWatch
> ----------------------------------------
>
> Key: LANG-296
> URL: http://issues.apache.org/jira/browse/LANG-296
> Project: Commons Lang
> Issue Type: Improvement
> Affects Versions: 2.2
> Environment: any
> Reporter: Justin Pitts
> Priority: Trivial
> Attachments: MethodChainingPattern
>
>
> Implement the method chaining pattern (similiar to StringBuffer) to mutator methods. This enables the following code:
> StopWatch s = new StopWatch().start();
> System.out.println(s.stop().getTime());
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[jira] Commented: (LANG-296) Add method chaining pattern to
StopWatch
Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/LANG-296?page=comments#action_12448186 ]
Henri Yandell commented on LANG-296:
------------------------------------
My general usage has been to use chaining when things are similar, so:
foo.setOne(...).setTwo(...).setThree(....)
Having a getFour() on the end seems confusing, so in this case I would just use: s.stop().start().split() etc. There seems no value to that, so all we're really allowing here is chaining of mutator->accessor and not mutator->mutator->mutator. That doesn't seem that useful.
Anyone have any thoughts?
> Add method chaining pattern to StopWatch
> ----------------------------------------
>
> Key: LANG-296
> URL: http://issues.apache.org/jira/browse/LANG-296
> Project: Commons Lang
> Issue Type: Improvement
> Affects Versions: 2.2
> Environment: any
> Reporter: Justin Pitts
> Priority: Trivial
> Attachments: MethodChainingPattern
>
>
> Implement the method chaining pattern (similiar to StringBuffer) to mutator methods. This enables the following code:
> StopWatch s = new StopWatch().start();
> System.out.println(s.stop().getTime());
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org