From: Tim M. <tim...@po...> - 2003-07-05 22:56:15
|
The way I see it - you are (or want to) construct a MethodMatcher based on a name or name constraint and parameters or parameter contraints (in dot net I believe you additional get a return type as well). I would expect this object to compare itself to a java Method object (at invoke time) and if it matches, do something (e.g. throw an exception or answer a value etc.) - the doing could involve a series of decorations as we have now (although my hunch is that we can simplify these down a bit). So the code that I see now - doesn't really work in this manner? I also feel - given some of the questions/features that other people have asked for, that matching is sometimes something people want different policies for on a method by method basis (e.g. match once only, match one or more) - (which combined with your excellent auto-return type stub, can give useful behavior especially in a name match constraint scenario like StartsWith("get")) So I think I would take the pieces that we have and combine them in a much different way. Tim > -----Original Message----- > From: moc...@li... > [mailto:moc...@li...]On Behalf Of > Nat Pryce > Sent: 05 July 2003 22:55 > To: Tim Mackinnon; Steve Freeman; 'Mockobjects-Java-Dev' > Subject: Re: [MO-java-dev] ActiveCall class > > > The name was meant to indicate that it represents the call currently > "active" in the mock. I agree that there is a better name. Personally I > would like to name it "Call" because all the other uses of the word "call" > don't actually refer to calls but to things that can be called. > > Perhaps Invocation would be a better name. > > There is actually very little behaviour required, as far as I > have used it. > It doesn't need to be compared to a method: it is constructed *from* a > method. Other objects (matchers, stubs, etc.) examine the state that it > carries. I guess some of that behaviour could be moved into the > ActiveCall > class but that feels wrong to me. Why should an invocation have knowledge > of the behaviour caused by that invocation? > > Cheers, > Nat. > _______________________ > Dr. Nathaniel Pryce > B13media Ltd. > http://www.b13media.com > +44 (0)7712 526 661 > > ----- Original Message ----- > From: "Tim Mackinnon" <tim...@po...> > To: "Steve Freeman" <st...@m3...>; "'Mockobjects-Java-Dev'" > <moc...@li...> > Sent: Saturday, July 05, 2003 8:28 PM > Subject: RE: [MO-java-dev] ActiveCall class > > > > The idea of ActiveCall is a good one (I'm not too keen on the name > myself - > > why is it active?) - Actually more to the point I'm kind of suprised its > got > > no behavior at all (making it even less active?). > > > > I would expect it to do work in deciding whether it was equal > to a Method > > (e.g. what invoke() gets) ...??? > > > > Tim --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.495 / Virus Database: 294 - Release Date: 30/06/2003 |