Mmh, I understand that, so if I have an Interface Issue and a composite IssueEntity I would try to get an instance via
Issue issue = uow.newEntity(Issue.class); and qi4j wil figure our that there is an IssueEntity that extends Issue? But if there isn't such a construction and I just do Double latittude = uow.newEntity(Double.class); what happens? Could we give back a reasonable Exception that explains that you have to have an Entity extended somewhere in order to use this? /peter On Mon, May 5, 2008 at 6:03 PM, Rickard Öberg <[EMAIL PROTECTED]> wrote: > 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 > > -- GTalk: neubauer.peter Skype peter.neubauer ICQ 18762544 GTalk neubauer.peter Phone +46704 106975 LinkedIn http://www.linkedin.com/in/neubauer http://www.neo4j.org - New Energy for Data - the Graph Database. http://www.ops4j.org - New Energy for OSS Communities - Open Participation Software. http://www.qi4j.org - New Energy for Java - Domain Driven Development. _______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

