From: Dmitri C. <moc...@co...> - 2004-02-26 19:39:38
|
Steve, Thanks for the information. Easy questions first - is jmock a different project? Or a different branch on cvs? what stage of development is it at? on the philosophical side of things. perhaps your right, well you must be, because I don't see the point (other than a currently unnceessary layer of indirection) in providing an my own interface to effectively mirror the functionality that SAP JCO provides only to have it to defer to JCO. We do already use a factory to object connections and so forth, but the actual client returned is the JCO client. Would you expand on "the real point is to use them to drive your design"? In our current situation, all calls to SAP go through a standard interface, one that (a) isn't provided by us, and (b) is defined by concrete classes rather than abstract interfaces. I don't see why I would want to change that design to something where the only difference is that the interface _is_ provided by us, and conveniently provided as an interface. thanks again for your reply. cheers dim > -----Original Message----- > From: moc...@li... > [mailto:moc...@li...] On > Behalf Of Steve Freeman > Sent: Thursday, 26 February 2004 9:23 PM > To: Dmitri Colebatch > Cc: moc...@li... > Subject: Re: [MO-java-dev] mocks of classes > > > we've been adding support for classes in the new jmock > implementation, > and I believe that easymock has a similar patch. But I think you're > kinda missing the point. Using mocks for stubbing external > libraries is > a useful technique, but the real point is to use them to drive your > design, hence: OnlyMockYourOwnInterfaces. > > If you're doing TDD, you might want to get some practice with > your own > code and then let us know how that works out. > > S. > > > Dmitri Colebatch wrote: > > I've _almost_ used mock objects several times over the last year or > > so, but never quite taken the final step. I'm currently at > that point > > again, this time to improve our test coverage in relation > to SAP. We > > use JCO to connect to SAP, and my current need is to come > up with some > > way to run our tests without involving SAP. Obvious solution: mock > > objects. > > > > Couple of problems. Firstly is this wiki page: > > http://www.mockobjects.com/wiki/OnlyMockYourOwnInterfaces > I disagree > > with the idea of reimplementing an interface to an external party, > > especially in a scenario like this where changing the way > we talk to > > SAP is going to change code regardless of how many layers > we put in. > > However, I'm not terribly worried about this. > > > > The real problem is the reliance on java.lang.reflect.Proxy. This > > only allows for interfaces. I'm wondering if anyone has > ever looked > > at making mocks of classes? Using user-provided instances, with > > interceptors, I dont imagine it would be too hard to do, but would > > like to hear from you guys who know the code a lot better than I do. > > > > thoughts? > > > > cheers > > dim > > > > > > > > ------------------------------------------------------- > > SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and > > deploy apps & Web services for Linux with a free DVD > software kit from > > IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438> &op=click > > > _______________________________________________ > > > Mockobjects-java-dev mailing list > > Moc...@li... > > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev > > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438> &op=click > > _______________________________________________ > > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev > |