How Abp Core implements dependency injection of classes

How does Abp depend on injecting its own classes?

It's actually very simple, but Baidu didn't reach Baidu for a long time, and finally found it when I went abroad. I will record it here, and I hope it can help my classmates who are as novice as me.

ABP can inherit ISingletonDependency and ITransientDependency in the class to inject the class into Castle Windsor.

ISingletonDependency is to inject classes as singleton mode
Singleton mode:
only instantiated once during program operation.
ITransientDependency is to inject classes as instance mode
Instance mode:
each call will be instantiated once

//单例模式
 public class AliyunSmsSender : ISingletonDependency
    {}
//实例模式
 public class AliyunSmsSender : ITransientDependency
    {}

Of course, there are many ways to implement dependency injection, but simple dependency injection has almost met my needs, so there is no more research.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325771976&siteId=291194637