Hi fago,

Reading the project page of Faces (not looking at the code), I get the impression that it does very similar things like CTools/plugin API - specifically the extension handling and lazy loading seems to be overlapping. I am not sure of the Facade functionality.

What are the differences/similarities between Faces and CTools/plugin API?

Comments

fago’s picture

Well first, faces doesn't deal with the plugin part of getting all defined plugins of modules.

@lazy-loading: Plugins are lazy loaded in the way that ctools loads the code only when the plugins are actually needed. The lazy-loading of faces is different as it allows you to lazy-load parts of an objects implementation on demand. E.g. for rules(2) I use it to build $rule objects, but it only loads all the ui related code when actual ui methods are invoked. Also one can allow modules to plug in and add their methods. So the object serves as facade - it's an easy to use interface and you don't have to worry about who actually implements the method or what needs to be included.

So with ctools plugin API you can let modules define their plugins + lazy load their implementation. In contrast to that faces cares about how to build an object out of multiple components. How you use that it's up to you, it sounds even to make sense to combine faces + ctools plugins. So you could use the plugin API for defining and loading the initial plugins, while faces could lazy-load parts of the plugin or build it modulary.