Hi,

As I'm converting over to my own custom class generation instead of CGLIB I stumbled upon a case that didn't work, and as far as I can tell, *shouldn't work*!

It's in AssociationDecoratorTest. A ManyAssociation<Employee> is being defined as its own type like so:
    @Mixins( DecoratorMixin.class )
    @Concerns( EmployeesAuditConcern.class )
    public interface Employees
        extends ManyAssociation<Person>, TransientComposite
    {
    }
---
Which is then used like this:
    public interface CompanyEntity
        extends EntityComposite
    {
        Employees employees();

        @Optional
        Boss boss();
    }
---
The idea is to be able to customize the methods on the Employees association. The reason this shouldn't work is because ManyAssociation extends from AssociationInfo which has type/metaInfo methods, that are *the same* as in TransientComposite! When you have the same method coming from two interfaces the result of calling them is unknown. When I generated the methods myself this became obvious, since the code generation failed on duplicate method implementation (=GOOD!).

So the question is really: should we allow association types to be customized like this? (same goes for properties I guess)

In my own code I would probably see ManyAssociation and Property as implementation details, rather than something I expose, and so any code that provides rules for how to modify them would be in the mixin using them.

What do you think? Are there valid reasons for wanting to customize ManyAssociation/Property, instead of putting that code into a Mixin that uses it?

/Rickard

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to