You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ted Husted <hu...@apache.org> on 2007/04/06 15:00:32 UTC
[S2 Tip] Within a namespace, reuse names for common concepts
In practice, most applications are composed of a small number of
workflows that repeat within the application. When configuration
elements in different namespaces serve the same role, use the same
identifier for each element. If each namespace includes a "Menu" or a
"Help" action, use those same names with each namespace.
<package name="receivables" namespace="/receivables">
<action name="Menu" class="receivables.Menu" >
<result>/receivables/Menu.jsp</result>
</action>
<!-- ... -->
</package>
<package name="payables" namespace="/payables">
<action name="Menu" class="payables.Menu" >
<result>/payables/Menu.jsp</result>
</action>
<!-- ... -->
</package>
Since the namespace feature avoids collisions between element names,
we can increase cohesion within the application by using a consistent
naming pattern.
HTH, Ted.
<http://husted.com/ted/blog/>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org