Re: Use of reflection in DirectoryScanner to remove duplicated code

2006-09-05 Thread Dominique Devienne
I'm interested in this mainly as an academic exercise, because I see using reflection as the only dynamic behaviour that Java offers and it allows for some 'tricks' (for want of a better phrase) to write less code. I'm also interested in the sort of reception that this kind of code gets - most pe

Re: Use of reflection in DirectoryScanner to remove duplicated code

2006-08-25 Thread Kev Jackson
I am not historically a champion of readability for its own sake ;) , but in this case I am of the general impression (without having thoroughly perused the proposed change) that it should be possible to eliminate the duplication without resorting to reflection. To rephrase, if reflection were (i

Re: Use of reflection in DirectoryScanner to remove duplicated code

2006-08-24 Thread Kev Jackson
> OK. Actually I had written the pieces of code which you are > refactoring. :( It's ok, I have the advantage of hindsight, coming into a stable codebase is always easier than writing stuff from scratch - also I tend to specialise in refactoring at work - I rarely sit down and write teh origina

Re: Use of reflection in DirectoryScanner to remove duplicated code

2006-08-24 Thread Matt Benson
--- Antoine Levy-Lambert <[EMAIL PROTECTED]> wrote: > > On Aug 23, 2006, at 7:26 AM, Kev Jackson wrote: > > > Hi, > > > > I want to run this by people here to see what > people think of > > this. Basically DirectoryScanner has some > duplicated code > > [ accountForIncludedFile, accountForI

Re: Use of reflection in DirectoryScanner to remove duplicated code

2006-08-24 Thread Antoine Levy-Lambert
On Aug 24, 2006, at 7:13 AM, Kev Jackson wrote: Antoine has mentioned that he would prefer not to use reflection for the simple reason that some tools cannot show the method graph - in this particular case I can't see that being a problem as no methods are called using reflection, I'm only us

Re: Use of reflection in DirectoryScanner to remove duplicated code

2006-08-23 Thread Kev Jackson
> > > > For additional testing I've created a directory/file structure like > > > > 1/ > >1 2/ > > 2 3/ > > 3 4/ > > so much effort ... > nah, 5 lines of script - I wasn't going to do it manually :) > I assume you tried some combinations of include/excludes. Dominique > used to

Re: Use of reflection in DirectoryScanner to remove duplicated code

2006-08-23 Thread Stefan Bodewig
On Wed, 23 Aug 2006, Kev Jackson <[EMAIL PROTECTED]> wrote: > Hi Stefan, (and other interested devs) > > For additional testing I've created a directory/file structure like > > 1/ >1 2/ > 2 3/ > 3 4/ so much effort ... > ie a single file under a directory, the tree is 1038+ layers

Re: Use of reflection in DirectoryScanner to remove duplicated code

2006-08-23 Thread Antoine Levy-Lambert
On Aug 23, 2006, at 7:26 AM, Kev Jackson wrote: Hi, I want to run this by people here to see what people think of this. Basically DirectoryScanner has some duplicated code [ accountForIncludedFile, accountForIncludedDir ], I think I have a refactored processIncluded method that can repl

Re: Use of reflection in DirectoryScanner to remove duplicated code

2006-08-23 Thread Kev Jackson
Hi Stefan, (and other interested devs) For additional testing I've created a directory/file structure like 1/ 1 2/ 2 3/ 3 4/ ie a single file under a directory, the tree is 1038+ layers deep and there is no difference between the original time taken by the DirectoryScanner code and

Re: Use of reflection in DirectoryScanner to remove duplicated code

2006-08-23 Thread Kev Jackson
On 23 Aug 2006, at 11:38, Stefan Bodewig wrote: On Wed, 23 Aug 2006, Kev Jackson <[EMAIL PROTECTED]> wrote: I want to run this by people here to see what people think of this. Basically DirectoryScanner has some duplicated code [ accountForIncludedFile, accountForIncludedDir ], I think I have

Re: Use of reflection in DirectoryScanner to remove duplicated code

2006-08-22 Thread Stefan Bodewig
On Wed, 23 Aug 2006, Kev Jackson <[EMAIL PROTECTED]> wrote: > I want to run this by people here to see what people think of this. > Basically DirectoryScanner has some duplicated code [ > accountForIncludedFile, accountForIncludedDir ], I think I have a > refactored processIncluded method that can