> Date: Wed, 13 May 2009 08:07:42 +0200
> From: [email protected]
> To: [email protected]
> Subject: Re: [qi4j-dev] Pattern for modeling Roles, State, Entities
> 
> On Wed, May 13, 2009 at 4:33 AM, Rickard Öberg <[email protected]> wrote:
> 
> > I'm guessing that it would have to be an explicit operation, rather than
> > just "oh so you want to cast an Entity to X, sure I'll add it on the fly"
> > kind of thing. So, one way to do that would be to extend the EntityBuilder
> > in UoW to work similarly to how ValueBuilder can take an existing value and
> > modify it:
> 
> > ArticleEntity article = ...;
> > EntityBuilder<CommentsEntity> commentsBuilder =
> > uow.addEntityType(CommentsEntity.class, article);
> > CommentsEntity ce = commentsBuilder.prototype();
> > ... initialize CommentsEntity state ...
> > CommentsEntity ce = commentsBuilder.newInstance();
> 
> Looks straight forward enough...
> 

Agree on you on explicity. And the sample code looks simple and easy to use.

_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. 
It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to