These are very technical questions that we have been asked, they will only make sense if you're quite familiar with Java, JPA and Hibernate.
Why not use standard JPA callback methods instead of ABL's @Action methods?
JPA defines three callback mechanisms: internal callbacks, external callbacks, and listeners.
Internal callback methods cannot call
Query methods and should not access any other entity objects. This is obviously a very serious restriction, which makes internal callbacks much less powerful than ABL's
That leaves external callbacks and listeners. In both cases, you need to define a separate class to implement them, which seems to defeat the argument that it would be simpler.
ABL defines a @Constraint annotation. Is this related to JSR-303 constraints?
No, this is different than JSR-303, which is mostly concerned with single-attribute validation. ABL's
@Constraint deals with multi-attribute and even multi-table validations. JSR-303 does allow for class-level constraints, but they require you to create your own validation class, which is clunky and more difficult to manage.
Are Hibernate Formulas appropriate for Business Logic?
Hibernate formulas enable you to declare SQL expressions to derive attribute values. While these may suffice for specific situations, they fall short of a general solution:
They only deal with transient data (so no pruning and adjustment possibilities)
- They do not handle chained aggregates
- They are only materialized on initial retrieval, so are not responsive to subsequent transaction activity
- They can only refer to stored data (e.g, not a formula)
Hibernate formulas are limited to SQL. By contrast, Business Logic is specified in via Java or Groovy, which provides a smooth migration into extending the set of rule types. Automated Business Logic Extensibility support provides several key services for copying and allocation, enabling you to solve complex problems without code. These are delivered with source, you can use them as illustrations of how to provide your own re-usable services.