Advanced Plugin Usage
From bemoko developer wiki
Dependent Classes
One class can depend on another within a given site in exactly the way you expect in normal Java and Groovy usage. The import statement can be used to import classes from another package, for example the following plugin class has a dependency on com.x.y.MyClass which will be found at plugins/com/x/y/MyClass.groovy in the site directory.
import com.x.y.MyClass public class MyPlugin { def execute(parameters) { def o=new MyClass() } }
Overriding Classes
You can override existing classes in the classpath with the one provided by a plugin. For example creating a groovy script plugins/com/x/y/MyClass.groovy in the site directory will be loaded in preference to the one in the classpath allowing you to override the behaviour of a class for a particular site. The overriding class must have the correct package set e.g.
package com.x.y; public class MyClass { ... }
This technique is useful for troubleshooting purposes, but is not recommended for production usage since it can be confusing if a class is not behaving as one might be expecting. It's much better, if the change you verified using overriding classes is reflected back into the original class so to ease maintenance and make the change readily available for others.
