Hi Thorsten,

thanks for this function!
Some little comments:

[EMAIL PROTECTED] wrote:
Author: thorsten
Date: Thu Aug  3 08:13:09 2006
New Revision: 428420

URL: http://svn.apache.org/viewvc?rev=428420&view=rev
Log:
Extending the module API with a method to return a list of modules and their 
location. Adding a default implementation as well.

Modified:
    lenya/trunk/src/impl/java/org/apache/lenya/cms/module/ModuleManagerImpl.java
    lenya/trunk/src/java/org/apache/lenya/cms/module/ModuleManager.java

[...]

+    public Map getModuleList(){
+        return module2src;


* We should never return a collection field, because it can be
  modified by client code. To make this method safe, an (unmodifiable)
  copy of the map has to be created:

  return Collections.unmodifiableMap(this.module2src);

* IMO a method called "get...List" shouldn't return a map.

* If a map is returned, the javadocs should explain what the
  map contains (key=..., value=...)

* IMO the most obvious signature would be to return an array, e.g.

String[] getModuleIds();
String getModuleSourceUri(String moduleId);

In this case, you don't need the javadocs to understand the methods.

WDYT?

-- Andreas



--
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
[EMAIL PROTECTED]                     [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to