Michael Feathers | 1 Dec 2003 01:14
Picon

Re[2]: Circle/Ellipse dilemma


WR> Anne & Larry Brunelle wrote:
>> "Behaves-as" sounds like it could include
>> private inheritance - which is usually not
>> really a proper inheritance relationship,
>> but rather only (in hope) a convenient
>> implementation.  Or worse.

WR> Inheritance is overrated... and, in any case, is only a convenient
WR> implementation for propagating behaviour.

It seems like the industry did swing back hard against inheritance.
In the middle 90s, the swing went away from inheritance.  Microsoft
had their own internal inheritance debacles which ended up with an
object model that didn't have implementation inheritance (COM), and
the GOF Design Patterns book pretty much recommended against it,
showing that delegation was more flexible.  I suspect the move
towards "components" had something to do with it also.

But frankly, I use inheritance now more than I ever have.  There are a
couple of reasons:

1) It is easy to subclass and add behavior to make a test pass.  When
you've done that, you can use the tests to safely move to another
mechanism whenever you decide to.  No need to start that way.

2) Inheritance is a great mechanism for replacing code.  If you have a
legacy class that depends on something weird that it shouldn't depend
on in a test, you can subclass and replace that code to get the class
under test.
(Continue reading)

WATKINS, Robert | 1 Dec 2003 01:35
Picon
Favicon

RE: Re[2]: Circle/Ellipse dilemma

Michael Feathers wrote:
> But frankly, I use inheritance now more than I ever have.  There are a
> couple of reasons:

I use inheritance a lot myself; it's very useful, for all of the reasons you
describe. However, I just remind myself that the type inheritance is more
important than the behaviour inheritance, and if subclassing becomes a pain,
then I don't use it. In many ways, I view superclasses as a way of removing
duplication more so than as a way of inheriting behaviour.

(Type inheritance (interfaces, in Java) also provide an excellent mechanism
for replacing code...)

Robert.

--

-- 
              "Software is too expensive to build cheaply"
Robert Watkins                        J2EE Application System Specialist
http://robertdw.blogspot.com         Web & Integration Services, Suncorp
robertdw <at> internode.on.net                  robert.watkins <at> suncorp.com.au

-----------------------------------------------------------------------------------

The contents of this message are the views of the Author and do not necessarily reflect the views of SUNCORP
METWAY LTD  ABN 66 010 831 722. 

The content of this e-mail, including attachments is a confidential communication between the Suncorp
Metway Group and the intended addressee. Any unauthorised use of the contents is expressly prohibited.
If you have received this e-mail in error please contact the sender immediately and then delete the
message and any attachment(s).
(Continue reading)

J. B. Rainsberger | 1 Dec 2003 03:43
Favicon

Re: Circle/Ellipse dilemma

Michael Feathers wrote:

> KR> This really has nothing to do with XP.
> 
> Here's food for thought.. if you have a class hierarchy where you
> have only one definition for each method (no overrides) you
> dramatically reduce your chances of an LSP violation.  See why?
> 
> I guess having more than one definition for a method is a kind of
> duplication, eh?

Yes, but it blows the Decorator pattern out of the water.
--

-- 
J. B. Rainsberger,
Diaspar Software Services
http://www.diasparsoftware.com :: +1 416 791-8603
Let's write software that people understand

To Post a message, send it to:   extremeprogramming <at> eGroups.com

To Unsubscribe, send a blank message to: extremeprogramming-unsubscribe <at> eGroups.com

ad-free courtesy of objectmentor.com 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

isotraining | 1 Dec 2003 09:04
Picon
Favicon

open downloads: new download site

a new free download site is open now

http://www.opendrivers.com

To Post a message, send it to:   extremeprogramming <at> eGroups.com

To Unsubscribe, send a blank message to: extremeprogramming-unsubscribe <at> eGroups.com

ad-free courtesy of objectmentor.com 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

Picon

RE: Re: Only refactor methods out to remove duplication?

>  
> Just because your code pass all the current tests, doesn't mean that 
> there isn't a bug in there still. 
>  
> Robert. 

Is the same statement not true even if my methods are extracted to oblivion?

If I found a bug in a method, would it not be possible to use extract method to isolate the bug then? Do I need to
preempt it? If I preempt it, is it not possible that I'm wasting my time? As long as you respond to it in a
timely fashion, is pain not a guiding light in development.

Cheers,

Tim

To Post a message, send it to:   extremeprogramming <at> eGroups.com

To Unsubscribe, send a blank message to: extremeprogramming-unsubscribe <at> eGroups.com

ad-free courtesy of objectmentor.com 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

Picon

RE: Another reason to Extract Method: Cohesion

> 
Hi Jeff,

> Modules (subroutines / functions / procedures / methods) should have 
> High Cohesion and Low Coupling.
>

A truly noble cause. :)

> High Cohesion:
> All the lines of a method should "work together" to achieve one goal 
> or result.  If you look at a method and find that it's doing two or 
> three different things, then it's time to Extract Method.  It 
> doesn't matter if the extracted methods are called from multiple 
> locations.  If a method has poor Cohesion, then it's time to break 
> it up.

In another post, I talked about using pain and smell to drive development. If a method's cohesion is low
enough to cause me pain, or the method is difficult to test then I'll happily extract a method to make my life
easier. What I won't do is preempt the pain and smell.

I've seen people spend obscene amounts of time chasing high cohesion and low coupling. I've seen people who
won't write a concrete class until it has an abstract class to derive from. If you are doing TDD, and are
responsive to pain, high cohesion and low coupling are very difficult to avoid.

Cheers,

Tim

To Post a message, send it to:   extremeprogramming <at> eGroups.com
(Continue reading)

Michael Feathers | 1 Dec 2003 10:43
Picon

Re[2]: Circle/Ellipse dilemma


>> KR> This really has nothing to do with XP.
>> 
>> Here's food for thought.. if you have a class hierarchy where you
>> have only one definition for each method (no overrides) you
>> dramatically reduce your chances of an LSP violation.  See why?
>> 
>> I guess having more than one definition for a method is a kind of
>> duplication, eh?

JBR> Yes, but it blows the Decorator pattern out of the water.

I'm not advocating that but when you are driving it is nice to
know where the the pavement is slick.

BTW, don't tease me with the chance to get rid of decorator again :-)

Michael Feathers
www.objectmentor.com

To Post a message, send it to:   extremeprogramming <at> eGroups.com

To Unsubscribe, send a blank message to: extremeprogramming-unsubscribe <at> eGroups.com

ad-free courtesy of objectmentor.com 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

Bernd Schiffer | 1 Dec 2003 11:58
Picon
Favicon

Agile tools for python?

Hi everybody.

I'm interested in developing in python. Therefor I'm looking for an
IDE with refactoring support and a xUnit framework (PyUnit?). Does
anyone know from experience about agile development with python? Are
there any agile tools?

Bernd

To Post a message, send it to:   extremeprogramming <at> eGroups.com

To Unsubscribe, send a blank message to: extremeprogramming-unsubscribe <at> eGroups.com

ad-free courtesy of objectmentor.com 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

Duncan Booth | 1 Dec 2003 12:43
X-Face
Picon

Re: Agile tools for python?

"Bernd Schiffer" <schifferbernd <at> yahoo.de> wrote in 
news:bqf6t1+ss0c <at> eGroups.com:

> I'm interested in developing in python. Therefor I'm looking for an
> IDE with refactoring support and a xUnit framework (PyUnit?). Does
> anyone know from experience about agile development with python? Are
> there any agile tools?

The xUnit part is pretty easy, just import the unittest module included 
with every copy of Python since release 2.1. You only need PyUnit if you 
also want a GUI interface.

I don't know of any refactoring support in the various IDEs. Its a tricky 
area, because the dynamic nature of Python makes it impossible to get class 
hierarchies right all of the time, but this doesn't mean that someone 
couldn't produce a refactoring IDE that gets it right often enough to be 
useful.

--

-- 
Duncan Booth                                             duncan <at> rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?

To Post a message, send it to:   extremeprogramming <at> eGroups.com

To Unsubscribe, send a blank message to: extremeprogramming-unsubscribe <at> eGroups.com

ad-free courtesy of objectmentor.com 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
(Continue reading)

Max Ischenko | 1 Dec 2003 12:48
Picon

Re: Agile tools for python?


> I'm interested in developing in python. Therefor I'm looking for an
> IDE with refactoring support and a xUnit framework (PyUnit?). Does
> anyone know from experience about agile development with python? Are
> there any agile tools?

As for xUnit framework, unittest (PyUnit) is fine. there could be found 
  a mock.py, that defines generic Mock class (and it works find due to 
Python dynamic nature and introspection facilities).

Refactoring support is really poor, esp. when comparing with Java tools 
like IDEA or Eclipse. There is a BycycleRepairMan project but it is of 
no much use (IMO but YMMV). Face it, there is no even powerful IDE 
available.

Personally, I'm go along with gVim and shell tools. It is not perfect 
but I see no other powerful alternatives. I've seen version 0.01 of 
python plugin to Eclipse but it is just a proof-of-concepts, not really 
usable.

To Post a message, send it to:   extremeprogramming <at> eGroups.com

To Unsubscribe, send a blank message to: extremeprogramming-unsubscribe <at> eGroups.com

ad-free courtesy of objectmentor.com 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


Gmane