Niclas Hedhman wrote:
> I am looking at PersonServiceTest, and see for instance the following code;
> 
>     PersonEntity p = personService.newInstance( unitOfWork );
>     p.name().set( "test" );
>     p.item().set( item );
>     personService.save( p );
> 
> This is a very good example of anti-pattern.
> 
> It should simply be;
> 
>     PersonEntity p = unitOfWork.newEntity( PersonEntity.class );
>     p.name().set( "test" );
>     p.item().set( item );
> 
> 
> My guess this is old code, but can we please start killing off all
> XyzService that tries to be some DAO layer??

Yeah, there's a whole bunch of code in there that doesn't seem to really 
contribute anything other than noise. As a general rule, when adding 
things, really really really think about why you are adding it, and if 
it is "just because" or from old habits, ask here first.

/Rickard


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

Reply via email to