On Tue, Mar 6, 2012 at 10:05 AM, Rickard Öberg <[email protected]> wrote:

> So, if I create a Person (which may have several stateful mixins), and
> assuming that that usecase does not know about Employee types or data, and
> then proceed to try and load it as an Employee, the mixins specific for
> Employee will be empty. And how will it know that I can indeed load it as an
> Employee? It seems to me that the developer would have to explicitly "add"
> the Employee type before being able to load it as an Employee.

Yes, I don't have the answers... What happens if you instead do;

1) Create instance 123 with Person type.
2) Use 123 as Person type
3) Create instance 123 with Employee type.
4) Any shared properties between P and E will be present in E's
builder on E's creation.

> 4) Use instance with Employee type (this requires that Person type is not
> visible from the application codes point of view, or else SPI cannot know
> which type to use)

I didn't understand this. Why would the SPI not to be able to tell
that we requesting Employee even if Employee is a subtype of Person
and Person is visible. Or did I miss something? We always explicitly
specify types in CRUD and query operations.

> 5) Delete instance

 5. Delete 123 as Employee type, will not remove 123 as Person, and
vice versa. This could be a bit tricky (not sure), since the SPI
implementation would need to know which roles are using which
properties/assocs, as any shared ones are not deleted.


> Argh... brain hurts..

Isn't it fun??


Cheers
-- 
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java

I live here; http://tinyurl.com/3xugrbk
I work here; http://tinyurl.com/6a2pl4j
I relax here; http://tinyurl.com/2cgsug

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

Reply via email to