Web / Apache OFBiz Interview questions
When should you use a stored/Java service instead of a Mini-language service?
Reach for Java (or Groovy, for less ceremony) when the logic needs things Mini-language handles awkwardly: complex branching and loops, calls to external Java libraries or APIs, precise numeric or date manipulation, or performance-sensitive code executed very frequently.
Mini-language stays a fine choice for straightforward CRUD wrapping, simple conditional logic, and cases where a non-Java developer on the team needs to read or tweak the service.
A practical middle ground many OFBiz codebases use: keep the service definition and orchestration in Mini-language or Groovy, but delegate any genuinely complex computation to a plain Java utility class the script calls into - getting the Service Engine's uniform validation and transaction behavior without forcing every line of business logic into XML tags.
More Related questions...