Home > Net >  Consult the IOC's application scenario
Consult the IOC's application scenario

Time:09-20

First make it clear that I experience less large, complex projects
With more has always been a three-tier architecture, and then the three layer architecture + MVC
Now in the study of the IOC, see the online under some examples of autofac

Feel this with factory pattern about
If use interface + reflection

Is there a big, can you help me combing combed

It's different from the factory pattern, advanced in where?

CodePudding user response:

Scenario
(1) the application framework
(2) support plug-in extension program
(3) heat program upgrades/part
(4) a set of procedures to match different underlying implementation
(5) the AOP programming

CodePudding user response:

reference 1/f, guiyang horse Ma Shanfu plugging waterproof engineering professional maintenance of swimming pool response:

the scene(1) the application framework
(2) support plug-in extension program
(3) heat program upgrades/part
(4) a set of procedures to match different underlying implementation
(5) the AOP programming

These use the factory pattern can be achieved?

CodePudding user response:

refer to the second floor ayun00 response:
Quote: reference 1/f, guiyang horse Ma Shanfu plugging waterproof engineering professional maintenance of swimming pool response:

Scenario
(1) the application framework
(2) support plug-in extension program
(3) heat program upgrades/part
(4) a set of procedures to match different underlying implementation
(5) the AOP programming

These use the factory pattern can be achieved?


Yeah,

What can you say that c # development program, I said the desktop, web, and so on, then you say the Java can also,
I didn't say can not ah, do you mean with Java, c # is not the meaning of existence? Can exceed the Java or c # has to be what it to calculate the c #? Still want to say?

CodePudding user response:

Is active before the new framework, now,

CodePudding user response:

You first look at yesterday, I share the concept of the IOC and how to decouple the advantage of this app I use # CSDN# discovered have technical content of the blog, friends to seek common to ASP.NET CORE built-in IOC interpretation and the use of ", gathered together at https://blog.csdn.net/a312586670/article/details/104596918 you will have a certain understanding

CodePudding user response:

Guiyang
reference 3 floor old Ma Shanfu plugging waterproof engineering professional maintenance of swimming pool response:
Quote: refer to the second floor ayun00 response:

Quote: refer to 1st floor of guiyang horse Ma Shanfu plugging waterproof engineering professional maintenance of swimming pool response:

Scenario
(1) the application framework
(2) support plug-in extension program
(3) heat program upgrades/part
(4) a set of procedures to match different underlying implementation
(5) the AOP programming

These use the factory pattern can be achieved?


Yeah,

What can you say that c # development program, I said the desktop, web, and so on, then you say the Java can also,
I didn't say can not ah, do you mean with Java, c # is not the meaning of existence? Can exceed the Java or c # has to be what it to calculate the c #? Still want to say?


I'm not saying that there can be a variety of ways,
I want to say is that I can't distinguish the difference between them, in concept I was confused

CodePudding user response:

In another article, answer, I will touch,

I think you are understanding of dependency injection there were problems,
My personal feeling, dependency injection and several class didn't have much relationship, the coupling between the

I talk about their own understanding,
1 inversion of control (ioc) and dependency injection (di),
Personally, I think inversion of control is the concept of dependency injection is its implementation,
Actually this is nothing special of tangled,

2 the commonly used three kinds of dependency injection approach
Attribute injection, constructor injection, annotations inject,
The three, is the concrete implementation plan dependency injection,

3 who will help you to complete,
Actually there is a container, to help you complete the injection process,
Through the above three kinds of injection way,
You will from the previous IMilk m=new AMilk, became: IMilk m;
Then, the container will help you to manage the instances, and generate a

4 benefits
To be honest, I feel good, is some,
But to see whether the project,
In general, small and medium-sized projects, there is no obvious benefits in particular,
We assume that you now have an interface IMilk, implementation class AMilk,
This is to provide A milk factory the underlying implementation,
Will now give B dairy also implements the bottom, then you will realize BMilk,

If do not apply the concept of the ioc, so you want to go to the bottom, or each service and so on, modify IMilk m=new BMilk ();
But after using, you just need to don't even need to modify a configuration file, is ok, because your code, are IMilk m;

CodePudding user response:

As for, you said the factory pattern and compared to the ioc
I think is not a level,

I can think of the Ioc by factory pattern,
But I also can think that the ioc by other patterns,
Because of his many belongs to a dynamic proxy,
  •  Tags:  
  • C #
  • Related