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>

[EMAIL PROTECTED] logic]$ pwd
/home/tkz/workspace/jakarta-struts/src/share/org/apache/struts/taglib/nested/logic
[EMAIL PROTECTED] 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to