Hi, Dan.

We are really curious in practice, about how have you manage relationships in 
Estatio.

- Have you declare for each one-to-many or many-to-many relationship, the 
addToXXX, removeFromXXX, modifyXXX, clearXXX methods than can be generated with 
the Eclipse templates?

If we don't declare the previous methods nor refresh an Entity, the contents on 
the collection of dependent entities can be incorrect, for example.

If Apache Isis would have an annotation similar to JDO's 
@Element(mappedBy="xxx") nearly all one-to-many or many-to-many relationships 
could be automatically managed in both sides, eliminating A LOT of boiler-plate 
needed just for that. At least we have now automated tests for testing them, 
with the bidir contract tests.

I understand (but can't imagine a concrete example) that automatically managing 
relationships in some scenaries could not be desirable, so it could be an Isis 
config option.

But implementing the current "templated contracts" on the enhanced Isis classes 
would be a perfect solution. The code on Entities would be just "business 
code". In our classes, currently we are starting to have 75% code for managing 
bidir relationships, and 25% business rules, in some case, making it really 
hard to read. 

We could "simplify" all Domain Models telling that they are expressed through 
Entities and Relationships between them, with business logic (identical to the 
scientific concept of "Ontology" [1]. So why not better support for 
Relationships, and not only for developing Entities ?

Please, what do you think? If you are not in favor of implementing managed 
relationships, what are the reasons in order to properly understand it?

Thanks in advance,

Oscar



[1] http://en.wikipedia.org/wiki/Ontology_(information_science)

Reply via email to