[Engine-devel] StorageHelperDirector "factory" and StorageType

Yair Zaslavsky yzaslavs at redhat.com
Thu Apr 19 16:34:34 UTC 2012


Hi all,
StorageHelperDirector.java implements a mechanism that creates instances
of classes implementing IStorageHelper based on String value of
StorageType enum.
Although the InitializeHelpers method has an "automated" mechanism for
creating the helpers, I think it causes some bad practice -
It creates a tight coupling between the StorageType values and the class
names of storage helpers, and a result of that, Java naming convention
is broken (we use upper case enum literals at StorageType which yield
class names such as LOCALFSStorageHelper.

I think that this mechanism is an overkill, and during addition of new
storage type, its easily to detect during development if one has
forgotten to add the helper to the factory (if done manually).

Thoughts about this issue are more than welcome

Yair



More information about the Engine-devel mailing list