You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Mark Thomas (Commented) (JIRA)" <ji...@apache.org> on 2011/12/17 21:17:31 UTC

[jira] [Commented] (POOL-203) GenericKeyedObjectPool.ObjectDeque could be better encapsulated

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

Mark Thomas commented on POOL-203:
----------------------------------

This is an awful lot of work that adds quite a lot of code for what appears to be relatively little benefit. I'd rather keep the code clean.
                
> GenericKeyedObjectPool.ObjectDeque could be better encapsulated
> ---------------------------------------------------------------
>
>                 Key: POOL-203
>                 URL: https://issues.apache.org/jira/browse/POOL-203
>             Project: Commons Pool
>          Issue Type: Improvement
>            Reporter: Sebb
>            Priority: Minor
>
> GenericKeyedObjectPool.ObjectDeque is currently basically just a collection of Objects with getters.
> This necessarily exposes the implementation, and makes adding invariant checks a lot harder - e.g. ensuring createCount >=0.
> The suggestion is to replace the getters with functional methods, for example:
> objectDeque.getCreateCount().incrementAndGet() => objectDeque.createdEntry();
> objectDeque.getAllObjects().put(t, p); => objectDeque.addNew(t, p);
> objectDeque.getIdleObjects().addFirst(p)/addLast(p) => objectDeque.idle(p,getLifo())
> The new methods could include assertions for invariants, and adding debug would be a doddle.

--
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