What problem does it solve?
This Skill unit solves the challenge of tight coupling between plugins by providing a thread-safe service registry pattern, enabling services to be registered and retrieved at runtime.
Core Features & Use Cases
- Service Registration: Register services created by plugins for discovery by other plugins.
- Service Retrieval: Retrieve services from the registry for plugin initialization.
- Loose Coupling: Promote a decoupled architecture by allowing plugins to access services they need at runtime.
- Core Services Access: Access to core services like User, Account, and Session within plugins.
- Use Case: In a plugin architecture, this Skill unit ensures that different plugins can interact without direct dependencies, simplifying development and maintenance.
Quick Start
To register a service, use the following command within your plugin's Init() method: ctx.ServiceRegistry.Register(models.ServicePlugin.String(), myService).