|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 | Next > |
|
|
Re: Re: Test-friendly, but not caller-friendly?Michael Feathers wrote:
> Not exactly user-centered design, is it? It exactly is user-centered design. The users get what they need. That the users don't always know what they need, or want things that are actively harmful to their interests, is an education issue; and one that is addressed by refusing to give them what they want, and then explaining why they don't really want that when the questions come in. -- Elliotte Rusty Harold elharo@... Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ ------------------------ Yahoo! Groups Sponsor --------------------~--> Yahoo! Groups gets a make over. See the new email design. http://us.click.yahoo.com/WktRrD/lOaOAA/yQLSAA/5cFolB/TM --------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/junit/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/junit/join (Yahoo! ID required) <*> To change settings via email: mailto:junit-digest@... mailto:junit-fullfeatured@... <*> To unsubscribe from this group, send an email to: junit-unsubscribe@... <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/ |
|
|
|
|
|
|
|
|
Re: Re: Test-friendly, but not caller-friendly?Elliotte Harold wrote:
> J. B. Rainsberger wrote: > > Elliotte Harold wrote: > > > >> http://www.cafeconleche.org/XOM/designprinciples.xhtml#d0e161 > <http://www.cafeconleche.org/XOM/designprinciples.xhtml#d0e161> > >> <http://www.cafeconleche.org/XOM/designprinciples.xhtml#d0e161 > <http://www.cafeconleche.org/XOM/designprinciples.xhtml#d0e161>> > > > > I tried, but there is plain text at the top of the file (before the > > preamble), so neither of my browsers will render it. > > Damn, I see what happened. Ant's putting warnings in the same file it > where it places the output. I'll fix it. Try > > http://www.xom.nu/designprinciples.xhtml#d0e161 > <http://www.xom.nu/designprinciples.xhtml#d0e161> That worked. Thank you. -- J. B. (Joe) Rainsberger :: http://www.jbrains.ca Your guide to software craftsmanship JUnit Recipes: Practical Methods for Programmer Testing 2005 Gordon Pask Award for contribution Agile Software Practice Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/junit/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/junit/join (Yahoo! ID required) <*> To change settings via email: mailto:junit-digest@... mailto:junit-fullfeatured@... <*> To unsubscribe from this group, send an email to: junit-unsubscribe@... <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/ |
|
|
RE: Test-friendly, but not caller-friendly?All,
I just wrote the section on interfaces vs. superclasses in Implementation Patterns, so I have some opinions. My analysis boils down to: interfaces hide more details (potentially) but you can't add a method to an interface without breaking client code the way you can with a superclass. In general I prefer disciplined use of superclasses (no non-private members, judicious use of protected methods) but interfaces are more common. Cheers, Kent Beck Three Rivers Institute Author of Implementation Patterns, due out in the fourth quarter of 2006 _____ From: junit@... [mailto:junit@...] On Behalf Of Cédric Beust ? Sent: Friday, September 01, 2006 9:06 AM To: junit@... Subject: Re: [junit] Test-friendly, but not caller-friendly? Hi Elliotte, On 9/1/06, Elliotte Harold <elharo@metalab. <mailto:elharo%40metalab.unc.edu> unc.edu> wrote: > > Michael Feathers wrote: > > > Elliotte, what are the downsides of interfaces, in your opinion? I know > > you don't like to use them as much as many other people do, but I don't > > know why. > > 1. Excess complexity > > 2. No precondition, postcondition, or class invariant validation > > 3. Cannot add new methods to an existing interface in a later version > without breaking all existing code Fair points. Interfaces do add some complexity, but they also buy you flexibility and extensibility, so I'd be sure to always weigh these different aspects before choosing (or not) to introduce an interface. I would argue that concrete classes suffer from 2) as well, and the only way you can guarantee that the orchestration of your classes/interfaces is respected is... with tests. Indeed, interfaces should become immutable once they are published, but there are ways to support interfaces with added methods without breaking backward compatibility. Here is how. Suppose you publish an interface: public interface IAccount { public void processCash(); } In v2, you decide your account needs to support credit cards as well, so you create the following interface: public interface IAccount2 extends IAccount { public void processCreditCard(); } Now, your business code needs to use the following trick: IAccount a = ...; if (a instanceof IAccount2) { IAccount2 a2 = (IAccount2) a; a2.processCreditCard(); } This code is guaranteed to be fully backward compatible and yet allow for your interfaces to grow with your needs. This trick is used extensively in COM and Eclipse, so while the instanceof is still a bit annoying, it's still important to be aware of such a possibility. -- Cédric http://testng. <http://testng.org> org [Non-text portions of this message have been removed] [Non-text portions of this message have been removed] Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/junit/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/junit/join (Yahoo! ID required) <*> To change settings via email: mailto:junit-digest@... mailto:junit-fullfeatured@... <*> To unsubscribe from this group, send an email to: junit-unsubscribe@... <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/ |
|
|
|
|
|
Re: Re: Test-friendly, but not caller-friendly?I might be coming late to this particular thread, but whatever happened
to the rule of "use unchecked exceptions for developer error, use checked exceptions for exceptional conditions"? -- Stephen Smith, MEng (Wales). http://www.stephen-smith.co.uk/ J. B. Rainsberger wrote: > Elliotte Harold wrote: >> Checked exceptions get >> programmers to write a lot more error handling code than documentation >> ever did. (Not quite as much as they should, of course, but a lot more >> than they used to.) > > ...a lot more, by percentage? I doubt it. For every person that handles > checked exceptions, there are, I'm guessing, several (dozens?) that > either simply wrap them in unchecked ones (fine with me) or do catch {} > (oy). This pattern repeats, over and over. > > The programmers that /do/ write error handling code are the ones that > would have done it before, if it had required less of an investment. > Those are the same programmers who will write equals() and hashCode() > correctly if they know that EqualsTester exists and how to use it. They > don't need code enforcement; they can get by with useful tools. > > Take care. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/junit/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/junit/join (Yahoo! ID required) <*> To change settings via email: mailto:junit-digest@... mailto:junit-fullfeatured@... <*> To unsubscribe from this group, send an email to: junit-unsubscribe@... <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/ |
| < Prev | 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 | Next > |
| Free embeddable forum powered by Nabble | Forum Help |