Re: [Clirr-devel] about to commit changes to support a SPI
Status: Alpha
Brought to you by:
lkuehne
From: <lak...@t-...> - 2005-08-26 06:00:17
|
Simon Kitching wrote: >On Mon, 2005-08-22 at 21:05 +0200, Lars Kühne wrote: > > >>Hi, >> >>if nobody objects within the next few days, I will commit changes to >>clirr-core that introduce an SPI for providing the Java code structure. >>[...] >> >Sounds fine > OK, done. > - though I would also be happy with just swapping to use ASM >directly. > > > You mean implementing our checks directly against ASM? I considered that, but I think an IDE plugin would provide real value. I'm not sure that the interface design is ideal, though - this is only a first shot. >I've been wondering whether we should look at restructuring the code to >work more like an asm "visitor" or how checkstyle works than the current >layout, because last I looked the method tests were getting rather >complex. > Yes, they are too complex. > But of course last time I looked was quite a while ago! I >presume your new code will still essentially encapsulate an in-memory >"model" of classes that the checks then inspect rather that try to be >more ASM-ish?? > > > Currently yes, but now that we have our own interfaces we are no longer limited by BCEL and can easily add an accept() method to them. Not sure that the visitor pattern is ideal, though. The checks are dependent on each other in the sense that some checks are not executed if other checks detect a "higher level" problem. Visitor doesn't cover this well, to me this sounds like we should organize our checks as a chain of responsibility. Haven't thought this through completely however... Thanks for your feedback, Lars |