[rules-dev] file per asset type

Mark Proctor mproctor at codehaus.org
Mon Sep 29 19:59:10 EDT 2008


What do people think of insisting on a file per type. So functions go in 
one file, rules in another and declare models in another. They all end 
up in the same package object, but we enforce a separation at both the 
file and api level.
kbuilder.addRulesFromURL( url );
kbuilder.addModelFromURL( url );
kbuilder.addFunctionsFromURL( url );
kbuilder.addProcessFromURL( url );

Really more thinking about orthogonality of api and design here. We have 
the following situation
kbuilder.addPackageFromXML()
kbuilder.addProcessFromXML()
Processes live in a package, so to a package there is no difference from 
a process to a rule - yet we are losing that orthogonality in the api to 
handle the special case.

What do people think, I'm just trying to find a better way to get some 
language orthogonality. I don't think we are likely to do this, but just 
throwing it out for discussion.

I think ideally we would like kbuilder.addResource( url/reader ), but 
not sure if we can easily determine each file type, we can't do it by 
file extensions as readers have none.

Mark



More information about the rules-dev mailing list