Wednesday, June 09, 2004

Resolver Testing
I believe that I've made all necessary changes, but building has been a separate issue. The tests have a number of dependencies that the resolver packages themselves don't have. Since the packages are to be kept as independent as possible, some of the packages needed for building the tests are not available. Hence the trouble building.

Without introducing some real hacks, the answer is reflection. I'll be doing that tomorrow.

Joining on Transitive Constraints
I forgot to mention yesterday that BW had trouble doing a join against a transitive constraint. This turned out to be because the row count had not been set. After reviewing LocalQuery for where this should have been done I made two discoveries. First, the row count on constraints is being set redundantly in several different places. There's no performance penalty to this, but if anyone tries to change it in future they may find that things don't change as they expect.

The second surprise was that the row count on transitive constraints was being set. I put some debugging log statements in and discovered that the transitive constraint's row count was not set, but the constraint that it wraps was being set. This would be because it is this interior constraint that does the work and actually resolves its size. The solution was to just pass the question of the row count down to the wrapped constraint object when the transitive constraint's row size is not known. Unfortunately the parent Constraint class keeps the rows variable private, so I had to promote this to being protected.

After discussing all of this with AN this morning he made a comment about how transitive constraints should only meet an interface, and not extend the Constraint class. I agree wholeheartedly, but many methods expect a Constraint, without any consideration for the ConstraintOperation interface that it implements.

Masters
No coding tonight. I'm doing my application to UQ.

No comments: