[ 
https://issues.apache.org/jira/browse/OFBIZ-1485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12548170
 ] 

Jonathon Wong commented on OFBIZ-1485:
--------------------------------------

> Now that the code was reduced down to two caches of FlexibleProperties
> objects, I started to look at the FlexibleProperties class to see if there
> was a way to convert it to a Javalution FastMap. So, I traced through the
> UtilProperties-to-FlexibleProperties code and I determined that the
> FlexibleProperties class contributes nothing to the UtilProperties class. So,
> I converted all references to FlexibleProperties to plain Maps, and used the
> Javalution FastMap for new instances.

A few points here.

FlexibleProperties does contribute something. Look at the methods in there.

A Map is different from a Properties object, less restrictive. In this case, 
less restrictive is not good. In fact, Properties wraps around Hashtable mainly 
to prevent non-strings from being inserted into the underlying Map.

You called for suggestions to use the new powerful FastMap while avoiding 
breaking legacy codes that may expect methods getProperties(...) to return 
Properties. I suggested that FlexibleProperties class internally deals with a 
FastMap object, while also overriding all the methods in the Properties class. 
That way, you get absolutely zero need for change propagation. All legacy codes 
continue to work; FastMap is now used. If so inclined, you may want to create a 
new Properties subclass called "FastProperties".

I don't think we should make methods getProperties(...) return anything other 
than Properties. As mentioned above, a Map is less restrictive and does not 
confine entered values to "just properties" (which are usually "just strings").


> UtilProperties - The Next Generation
> ------------------------------------
>
>                 Key: OFBIZ-1485
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1485
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Adrian Crum
>            Priority: Minor
>         Attachments: props_tng.patch
>
>
> Improve the UtilProperties class. Details in comments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to