Hi,

Since we're going all 2.0 anyway, here's a very central design question that we could/should revisit: is it required for a composite type to extend *Composite, like TransientComposite?

As the model stands today, with the introduction of the "roles" concept, where additional interfaces can be added that have not been explicitly declared by the composite interface, I think the answer is no. The model can add TransientComposite/ValueComposite/EntityComposite to the proxy class, and implement those methods as any other role. Any instance would be cast-able to the *Composite interfaces anyway, at runtime.

A composite declaration could then be:
interface MyValue
{
  Property<String> foo();
}

and this could be used either as an Entity, Value or Transient, as it is. It would even be possible to use interface that do not use Qi4j classes at all:
interface MyValue
{
  void setFoo(String newValue);
  String getFoo();
}
---
If this was declared as a Value you'd have to register a mixin that can handle it, which could either be generic or typed.

So, is there any compelling reason to *require* that declared interface must extend our *Composite interfaces, knowing that we can always add them to the runtime instance on the fly?

/Rickard

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

Reply via email to