You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Michael Häusler <mi...@akatose.de> on 2008/01/24 16:33:41 UTC

Iteration order on org.apache.tapestry.AbstractComponent#getComponents()

Hi there,

I think it would be beneficial to be able to iterate over the components 
of a page in a well defined order (e.g., the order in which they occur 
in the template). Therefore, I would like to suggest to change the 
Map-Implementation of _components (and _assets) in AbstractComponent 
from java.util.HashMap to java.util.LinkedHashMap (see the patch to 
4.1.3-final below).

What do you think about such a change?

Best regards,
Michael Häusler



Index: C:/Dokumente und 
Einstellungen/michael.haeusler/workspace/tapestry/tapestry-framework/src/java/org/apache/tapestry/AbstractComponent.java
===================================================================
--- C:/Dokumente und 
Einstellungen/michael.haeusler/workspace/tapestry/tapestry-framework/src/java/org/apache/tapestry/AbstractComponent.java 
(revision 614876)
+++ C:/Dokumente und 
Einstellungen/michael.haeusler/workspace/tapestry/tapestry-framework/src/java/org/apache/tapestry/AbstractComponent.java 
(working copy)
@@ -155,7 +155,7 @@
          checkActiveLock();

          if (_assets == null)
-            _assets = new HashMap(MAP_SIZE);
+            _assets = new LinkedHashMap(MAP_SIZE);

          _assets.put(name, asset);
      }
@@ -167,7 +167,7 @@
          checkActiveLock();

          if (_components == null)
-            _components = new HashMap(MAP_SIZE);
+            _components = new LinkedHashMap(MAP_SIZE);

          _components.put(component.getId(), component);
      }


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org