On Sat, Oct 2, 2010 at 11:36 AM, Rickard Öberg <[email protected]> wrote: > On 2010-10-02 11.27, Niclas Hedhman wrote: >> >> In UnitOfWork, we have >> >> void remove( Object entity ) >> throws LifecycleException; >> >> The only current implementation of this method cast the argument to >> EntityComposite. So, why not make the type of the parameter to >> EntityComposite as well? Better than a ClassCastException in runtime. > > Usually this will be called in the domain layer, and at least I don't > reference things by EntityComposite there, only the role names. So if I have > to cast a role interface to EntityComposite that'd be sucky. > > -1.
Ok, so the implementation passed will be an EntityComposite type, although the type used in the code is not... Didn't think of that. Cheers -- Niclas Hedhman, Software Developer http://www.qi4j.org - New Energy for Java I live here; http://tinyurl.com/2qq9er I work here; http://tinyurl.com/2ymelc I relax here; http://tinyurl.com/2cgsug _______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

