Hey,

Another thing that feels really awkward as I do the persistence refactoring is qualified associations. I.e.
ManyAssociation<Qualifier<Actor, Role>> cast();

There's a lot of special-casing going on for these kinds of references. It is also very murky what happens if you do this:

interface Movie
  extends EntityComposite
{
  @Aggregated
  ManyAssociation<Qualifier<Actor, Role>> cast();
}

If I now remove the Movie, should both the Actor and Role be deleted? Both are entities by the way. I would probably prefer to do it this way:

interface Movie
  extends EntityComposite
{
  @Aggregated
  ManyAssociation<Casting> cast();
}

and then separately
interface Casting
  extends EntityComposite
{
  Association<Actor> actor();
  Association<Role>  role();
}

Now when I delete the Movie the Casting is removed, but not the Actor and not the Role. Theoretically the same Role could be referred to by some other Movie that uses the same script, so making it aggregated doesn't make sense. This way it also becomes possible to add properties to the Casting, which is not possible with the Qualifier.

What say ye?

/Rickard

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

Reply via email to