Jon Stevens wrote: > > on 1/17/01 4:46 PM, "John McNally" <[EMAIL PROTECTED]> wrote: > > > We need to talk about this. > > I figured as much. :-) I just want to keep you on your toes. :-) > > > I am working on the Criteria class. I have > > moved the CriteriaObject to a public class as I think it might be easier > > to work with it directly, we'll see. > > I don't think that I agree with this as I think that the Criteria class > should be the view for the CriteriaObject class. The only purpose for making > CriteriaObject available that I can see is that it would provide you an easy > way to get the tableName. I want to chain CriteriaObjects as a way of providing OR functionality without resorting to a Custom Criteria. Take a look at Leonard's Criterion class in Joist. I think it might be easier to build up a complex where clause using the pieces directly. At least it seems easier to me at the outset, I do not want to provide another complete set of addOr methods. > > > What did does the final do on the > > inner class? > > My thinking is that it could be an optimization for the compiler/runtime. > Marking things as final generally causes the compiler/runtime to inline the > method/class which produces faster code. > > > Also I think the put method is public and is used when moving a > > CriteriaObject from one Criteria to another. If you do this now, you > > will end up putting a CriteriaObject as the value of a CriteriaObject. > > Now this is a good argument, but I don't think that this is a good way to > move/copy a CriteriaObject from one Criteria object to another. I think that > that should be done with a specific mechanism for that as there is no way to > currently getCObject() in a public fashion other than by remove()'ing it as > well as the fact that you are overloading the put() method functionality > (ie: I think it should simply duplicate add()) by doing so. > I needed to override the put behavior to account for the CriteriaObject. It was already being used (IIRC) to move part of the criteria in an update from the set values to the where clause, I just modified it so that this was still possible. And it is still being used this way, so I am recommending that you not go to the effort of changing all the dependencies, as I am making some changes myself. For example, Criteria no longer needs to extend Hashtable, so there is no need for a put method, so what you say is correct, this behavior should be moved to a different better named method, I just want us to not step all over each other. > thanks, > > -jon > > -- > Honk if you love peace and quiet. > > ------------------------------------------------------------ > To subscribe: [EMAIL PROTECTED] > To unsubscribe: [EMAIL PROTECTED] > Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/> > Problems?: [EMAIL PROTECTED] ------------------------------------------------------------ To subscribe: [EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/> Problems?: [EMAIL PROTECTED]
