I suggested a Maven-like folder structure years ago, and there was
pushback from Adam. He was concerned that test classes would reside in
the same package as the classes being tested - which would expose their
implementation.
The classpath under the script folder is not necessary. That was used
before we had FlexibleLocation and the "component://" URL feature. So,
instead of your suggestion we could do:
script/groovy/FooScript_1.groovy
script/groovy/FooScript_2.groovy
script/minilang/BarScript_1.xml
script/minilang/BarScript_2.xml
script/js/BazScript_1.js
(Yes, the Service Engine supports JavaScript.)
To use FooScript_1.groovy you can use two methods:
1. The "component://" URL feature:
component://mycomponent/script/groovy/FooScript_1.groovy
2. The classpath:
groovy/FooScript_1.groovy
Option 2 could have problems with name clash, so I have always preferred
option 1.
While we are having this discussion, we could also consider changing the
package naming from
org.ofbiz.*
to
org.apache.ofbiz.*
Adrian Crum
Sandglass Software
www.sandglass-software.com
On 1/20/2015 3:41 AM, Jacopo Cappellato wrote:
In my opinion it would be nice to review how we organize the code in our
components and switch to a directory layout that is more inline with what other
projects are doing, for example:
http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html
More specifically I would like to switch from, for example:
script/org/ofbiz/product/
src/org/ofbiz/product/
src/org/ofbiz/product/test/
to:
src/main/java/org/ofbiz/product/
src/main/minilang/org/ofbiz/product/
src/main/groovy/...
src/test/java/org/ofbiz/product/
What do you think?
Jacopo