how to name c# interface that indicates that class will be instantiated instandly when…
- User
how to name c# interface that indicates that class will be instantiated instandly when service provider built
- Assistant
In C#, it's common practice to name interfaces with a leading "I" to indicate that they are interfaces. However, if you want to specifically convey that any class implementing this interface will be instantiated when the service provider is built, you can choose a name that reflects this behavior.
One approach is to include terms that describe immediate instantiation. Here are a few suggestions:
- IImmediateInstance: Suggests that classes implementing this interface are instantiated immediately.
- IEagerLoad: Suggests that the implementing classes are eagerly loaded by the service provider.
- IInstantService: Indicates that the service is provided instantly upon service provider creation.
- IAutoInstantiate: Conveys automatic instantiation as part of service provider setup.
- IBootstrapService: This suggests that the service plays a role in the initialization or bootstrapping process.
Ensure that your naming convention aligns with the conventions already present in your codebase or project for consistency. Additionally, this approach may require documentation to make sure that the specific mechanism by which the service provider triggers instantiation is clear to other developers.