Did not look into details yet, but at 1st glance (browsing the article) it 
sounds good to me

Jacques

Le 06/01/2015 22:55, Adrian Crum a écrit :
I just spent some time debugging FlexibleLocation.java. That, plus the recent work I did on EntityClassLoader has made me come to the conclusion that FlexibleLocation.java and the entire org.ofbiz.base.location package are not needed.

All of the org.ofbiz.base.location package functionality already exists in Java's java.net.URL functionality. That functionality is extensible so that applications can add custom protocol handlers easily. Here is one tutorial I found:

http://accu.org/index.php/journals/1434

In addition to the org.ofbiz.base.location package being unnecessary, the code it contains is very inefficient. I have done some code optimizations in the past, but it would be best to just eliminate it entirely.

From a developers perspective, the API would change from:

URL someFileUrl = 
FlexibleLocation.resolveLocation("component://foo/bar/someFile.xml");

to:

URL someFileUrl = new URL("component://foo/bar/someFile.xml");

We could deprecate the methods for now and log warnings, then eventually remove 
the package.

What do you think?

Reply via email to