I think the uber jar is the wrong route. Instead to accomplish your goal of hiding methods from the DatabaseLibrary but make them accessible to your Logic I would declare your methods as "protected" which limits its visibility to the package level. Given that you would make sure that any classes that needed to talk between jars were within the same package (though in seperate jars). This will force a 3rd party vendor only to use the public methods that are available to them.
- DatabaseLibrary
|- com.mycompany
|- DatabaseClass
-LogicLibrary
|- com.mycompany
|- LogicClass
public class DatabaseClass{
protected void doSomething(){
}
}
public class LogicClass{
public void doSomething(){
DatabaseClass dbClass = new DatabaseClass();
dbClass.doSomething();
}
}
Now you're 3rd party vendor will only see LogicClass.doSomething()
See also: http://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html