pivot-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sandro Martini (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (PIVOT-799) extending Pivot collections
Date Fri, 20 Jul 2012 14:59:36 GMT

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

Sandro Martini edited comment on PIVOT-799 at 7/20/12 2:59 PM:
---------------------------------------------------------------

Other things that could be a good addition:
- add a maximum number of elements (by default -1 or no limit)
  -- use case: for example, put a limit in how many objects can be put in the resourceCache
(inside ApplicationContext), for example look here: http://stackoverflow.com/questions/5601333/limiting-the-max-size-of-a-hashmap-in-java

- add some utility class (see in what package, inside core) to implement the concept of null-safe
data container (or monad, in Scala terms), and related concepts of Option, Some, None, etc
as found in Scala. Some reference:  http://www.codecommit.com/blog/scala/the-option-pattern/print/
 ,  http://blog.tmorris.net/scalaoption-cheat-sheet/
  -- verify if could be good to start retrofit existing behavior to use them, but probably
not before release 3.0 ...

- add fallback methods like getOrElse in some Scala collections, some reference: http://blog.danielwellman.com/2010/08/more-thoughts-on-scalas-option-class.html

- add method to apply to any collection element a transformation (or maybe a Command), like
apply(), some reference: http://stackoverflow.com/questions/9350528/how-to-work-with-javap-for-scala-java-interop


Of course before all this I'll verify if/how we can do this (in Java), both as coding strategies
(if there are some pitfalls, etc), and by licensing (should not exist problems here, but I'll
do some check to be sure).


                
      was (Author: smartini):
    Other things that could be a good addition:
- add a maximum number of elements (by default -1 or no limit)
  -- use case: for example, put a limit in how many objects can be put in the resourceCache
(inside ApplicationContext)
- add some utility class (see in what package, inside core) to implement the concept of null-safe
data container (or monad, in Scala terms), and related concepts of Option, Some, None, etc
as found in Scala. Some reference:
http://blog.tmorris.net/scalaoption-cheat-sheet/
http://www.codecommit.com/blog/scala/the-option-pattern/print/
  -- verify if could be good to start retrofit existing behavior to use them, but probably
not before release 3.0 ...

- add fallback methods like getOrElse in some Scala collections
- add method to apply to any collection element a transformation (or maybe a Command), like
apply()

Of course before all this I'll verify if/how we can do this (in Java), both as coding strategies
(if there are some pitfalls, etc), and by licensing (should not exist problems here, but I'll
do some check to be sure).


                  
> extending Pivot collections
> ---------------------------
>
>                 Key: PIVOT-799
>                 URL: https://issues.apache.org/jira/browse/PIVOT-799
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-collections
>            Reporter: Sandro Martini
>            Assignee: Sandro Martini
>            Priority: Minor
>             Fix For: 2.1
>
>
> Add some usuful methods to Pivot Collections like those needed to process all elements,
going more "function style", like addAll, contains, etc ...
> To simplify usage from people coming from other languages, try to align to other languages
names/conventions (for what is possible) , like Scala, C# .
> Verify even if add a interface (defining a single method) that could be passed to some
methods to contain logic for processing all elements (like the apply() in Scala), and chose
a right name for it (maybe function or other similar).
> Some info here:
> http://apache-pivot-developers.417237.n3.nabble.com/Some-idea-on-extending-Pivot-collections-td3321472.html
> But for more changes in Collections (still to be discussed), wait the 3.0 ...

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

        

Mime
View raw message