The FileSystemFactory is declared as:

  public interface FileSystemFactory {
      /**
       * Create user specific file system view.
       */
      FileSystemView createFileSystemView(User user) throws FtpException;
  }

Its name is FileSystemFactory but it creates FileSystemViews instead of FileSystems?
Should be renamed FileSystemViewFactory ? I think for no.
What represents a FileSystemFactory? I think a single FileSystem that can be viewed (differently) from different users.

The fact that the designer choose the Factory Class pattern for this piece of the system it's important but, I think, it's more important names the classes for what they represents. We can always document the fact that we choose the Factory Class pattern in the class javadocs.

I think the right name for FileSystemFactory is FileSystem.

In the FtpServerFactory there is a similar names inconsistence that would be automatically resolved if we rename FileSystemFactory :

  public class FtpServerFactory {
      public FileSystemFactory getFileSystem() { ... }
      public void setFileSystem(FileSystemFactory fileSystem) { ... }
  }

A getter/setter pair that get/set the fileSystem property.

I propose the following the folling renaming:

FileSystemFactory --> FileSystem


In addition I think that the createFileSystemView() method name could be simplified: FileSystemFactory#createFileSystemView() --> FileSystem#createView()

--
Andrea Francia
http://andreafrancia.blogspot.com/2008/07/colinux-linux-dentro-windows.html

Reply via email to