Peter Neubauer wrote:
> Hi there,
> now that I got a bit further, it seems the UoW API is a bit blury on
>     <T> T newEntity( Class<T> compositeType );
> 
>     <T> T newEntity( String identity, Class<T> compositeType );
> 
>     <T> CompositeBuilder<T> newEntityBuilder( Class<T> compositeType );
> 
>     <T> CompositeBuilder<T> newEntityBuilder( String identity,
> Class<T> compositeType );
> 
> Shouldn't the newEntity methods only take instances of org.qi4j.entity.Entity?

As Niclas indicated these methods map the given types to actual 
Composite types. It is actually a BIG BIG feature that they do NOT 
mandate Entity or even Composite, since that avoids application code 
having to rely on the explicit Composite types. Preferably application 
code will NEVER reference Composite types, at least not unless it is 
really really necessary. This makes it easy to reuse application code 
which understands a particular domain, where those domain interfaces 
have been merged with domain interfaces from a completely different 
domain. This is vital to be able to write domain libraries.

/Rickard


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

Reply via email to