Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Alf's NO framework uses String constants in the domain classes for each domain class member (property, collection, action).  His UI model builder (which is a fluent programmatic builder to create an in-memory structure analogous to the BS3Grid uses these string constants. They choose String constants because it's very light weight with no external deps and referenceable  in Annotations. It is often used to quickly jump from the ui definition to the property.

Pojo example:

@Anno(prop_ref=Bar.PROP_foo)
class Bar {
public static final String PROP_foo = "foo";
Foo getFoo()
}

The Apache Isis model doesn't have any mandated mechanism to reference domain class members in a type-safe way.  (If we were using C# then there would be a way to do this, but, well, we aren't).

...

Note that this mechanism would also work for mixins, though there would be nothing to prevent the developer from accidentally referencing a mixin's domain event for a "foreign" mixin that doesn't contribute to the domain class under consideration.  Again, a metamodel validator would be able to take care of this.

The question is for what to we need the compile type safety. For example UI definitions are mostly simple tree structures, they form often a tree, which can only have one generic node type.