Manager Classes - WeTeam/WeBlog GitHub Wiki
Overriding Manager Classes
WeBlog uses a layered architecture, containing the logic for many of the data and content operations in a variety of manager classes. WeBlog Release 2.1 extracted the manager classes behind interfaces and uses a factory class to control creation of an appropriate concrete implementation of the interface. This allows developers to override any of the manager classes with their own implementation.
Using the Manager Classes
Firstly, to use the manager classes do not instantiate the class directly. Instead, use the Sitecore.Modules.WeBlog.Managers.ManagerFactory
class to obtain an instance of the manager class required.
For example, to obtain an instance of the EntryManager
class, use ManagerFactory.EntryManagerInstance
.
Overriding a Manager Class
The concrete types to use for each of the manager classes are defined in the App_Config\Include\WeBlog.config
file in the Sitecore settings WeBlog.Implementation.
. To override a specific manager class:
- Create a new class which implements the appropriate interface for the manager class being overridden.
- Update the
App_Config\Include\WeBlog.config
file (or other configuration patch file) and update the Sitecore setting referring to the manager class being overridden and update it to the class name created above. If the new class is in different assembly, you need to use the fully qualified assembly name.