I would agree. Rickard stated earlier on the list that the builder ist the way to construct tempoary invalid objects and that the constraints must be fullfilled when creating/handing back the real instance.
Michael Niclas Hedhman schrieb: > I am chasing the bug that is rearing its ugly face in VisitTest of PetClinic. > > It is a matter of the HasDisplayName interface is declaring a > constraint on the displayName() property. The Mixin implementation > though is a ComputedProperty, which means that the client don't need > to set it. > > Now, here is the catch; In CompositeBuilder/EntityBuilder it is not > the actual Mixin implementations used, but internal proxies. And > during the newInstance() there will be a Constraints check, and the > ComputedProperty will fail. > > Now, > > Should the Constraints really be checked on the builder prototype or > should we somehow first instantiate the composite instance to the real > thing, and then check the Constraints prior to handing it back to the > caller?? > > The latter to me sounds like the right thing, but before attempting > such maneuver, I want to check if anyone can see problems with either > or both approaches. > > > Cheers > Niclas > > _______________________________________________ > qi4j-dev mailing list > [email protected] > http://lists.ops4j.org/mailman/listinfo/qi4j-dev _______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

