AnsweredAssumed Answered

Why is FileFolderService#makeFolders deprecated?

Question asked by gyro.gearless on May 5, 2010
Latest reply on May 13, 2010 by mrogers
Hi folks,

just wondered why method makeFolders() in interface org.alfresco.repo.model.filefolder.FileFolderService is marked as deprecated?  :?
Instead, a static method makeFolders() is provided in FileFolderServiceImpl, which is also used by the deprectated method:

public class FileFolderServiceImpl implements FileFolderService
    public static FileInfo makeFolders(FileFolderService service, NodeRef parentNodeRef, List<String> pathElements, QName folderTypeQName)

    public FileInfo makeFolders(NodeRef parentNodeRef, List<String> pathElements, QName folderTypeQName)
        return FileFolderServiceImpl.makeFolders(this, parentNodeRef, pathElements, folderTypeQName);

This doesnt seem to make sense for me for several reasons:

- The static method makeFolders() should be rather called "pseudo-static", as it gets an artificial this reference passed! There is no reason why it shouldn't be a method of FileFolderServiceImpl as it was before!

- By forcing users to call a method in the implementation class, the usual separation between interfaces and implementation classes is broken for no reason.

Maybe  there is some reason why this method exists as static, but at least the @deprecated annotation should be removed, IMHO