You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Paul Sundling <to...@tkz.net> on 2004/01/07 09:47:26 UTC

Maven Reports

I was looking at the maven reports and they're pretty interesting.  One 
thing I found interesting was the report that shows duplications.  There 
is a large number of classes that only differ in which class they 
extend.  One large grouping of that is in the nested taglib classes.  In 
the example below you'll see that the only differences are the import 
line and extends clause.  It seems there should be some design pattern 
to where all the duplicate code could be refactored into one location.  
Of course, I couldn't think of one right away myself.  Would the IoC 
stuff that's been mentioned help here for instance?

Paul Sundling

<EXAMPLE DIFF FOLLOWS>

[tkz@passion logic]$ pwd
/home/tkz/workspace/jakarta-struts/src/share/org/apache/struts/taglib/nested/logic
[tkz@passion logic]$ diff NestedMessagesPresentTag.java 
NestedNotEqualTag.java
2,4c2,4
<  * $Header: 
/home/cvspublic/jakarta-struts/src/share/org/apache/struts/taglib/nested/logic/NestedMessagesPresentTag.java,v 
1.5 2004/01/01 20:00:33 husted Exp $
<  * $Revision: 1.5 $
<  * $Date: 2004/01/01 20:00:33 $
---
 >  * $Header: 
/home/cvspublic/jakarta-struts/src/share/org/apache/struts/taglib/nested/logic/NestedNotEqualTag.java,v 
1.4 2003/02/28 05:14:39 arron Exp $
 >  * $Revision: 1.4 $
 >  * $Date: 2003/02/28 05:14:39 $
65,66c65,66
< import org.apache.struts.taglib.logic.MessagesPresentTag;
< import org.apache.struts.taglib.nested.NestedPropertySupport;
---
 > import org.apache.struts.taglib.logic.NotEqualTag;
 > import org.apache.struts.taglib.nested.NestedNameSupport;
70c70
<  * NestedMessagesPresentTag.
---
 >  * NestedNotEqualTag.
73d72
<  * @author David Winterfeldt
75c74
<  * @version $Revision: 1.5 $ $Date: 2004/01/01 20:00:33 $
---
 >  * @version $Revision: 1.4 $ $Date: 2003/02/28 05:14:39 $
77,78c76
< public class NestedMessagesPresentTag extends MessagesPresentTag
<                                                   implements 
NestedPropertySupport  {
---
 > public class NestedNotEqualTag extends NotEqualTag implements 
NestedNameSupport {



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Re: Maven Reports

Posted by Robert Leland <rl...@apache.org>.
Paul Sundling wrote:

> I was looking at the maven reports and they're pretty interesting.  
> One thing I found interesting was the report that shows duplications.  
> There is a large number of classes that only differ in which class 
> they extend.  One large grouping of that is in the nested taglib 
> classes.  In the example below you'll see that the only differences 
> are the import line and extends clause.  It seems there should be some 
> design pattern to where all the duplicate code could be refactored 
> into one location.  Of course, I couldn't think of one right away 
> myself.  Would the IoC stuff that's been mentioned help here for 
> instance?

Yes, I noticed the same thing. I believe AOP might address this. I 
believe Struts could benefit from using AspectJ.
and collecting solid use cases would be a good starting point.




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org