C#/Prism

[Prism] Ioc, Container, DI

딸기우유중독 2023. 2. 23. 14:53

Container.RegisterType<Interface, Class>();   

 

// Looks like Dictionary

Dictionary<key, value>();

 

 

Interface을 키값으로 Class 를 컨테이너에 등록

 

Container.Resolve<Interface>(); // 해당 인터페이스로 Register되어있는 Class 인스턴스를 가져옴.

 

 


 

https://mizzlena.tistory.com/63

 

[C#] Prism 용어 정리

C# WPF C# WPF(Windows Presentation Foundation)는 마이크로소프트에서 개발한 GUI 응용 프로그램 개발을 위한 플랫폼입니다. WPF는 XAML(Extensible Application Markup Language)을 사용하여 사용자 인터페이스를 설계하

mizzlena.tistory.com



https://www.c-sharpcorner.com/article/dependency-injection-pattern-in-c-sharp-short-tutorial/

 

Dependency Injection Pattern In C# - Short Tutorial

In this article, we explain DI Pattern, DIP, IoC, and DI Container.

www.c-sharpcorner.com

 

 


[1] Dependency Container란 무엇인가?! 

 

의존성 주입을 해줄때는 밖에서 인스턴스를 만들어서 주입해줍니다. (참고:  의존성 주입(Dependency Injection) 을 해주는 세가지 방법 )

밖에서 인스턴스를 만들어서 주입해주는 곳은 앱에서 여러군데 입니다. 즉 인스턴스를 만드는 위치가 분산되어있습니다. 

 

근데 Container라는 것이 있고 이 친구가 모든 인스턴스를 다 가지고 있고 다 관리를 한다고 생각해봅시다.

 

Container에 앞으로 내가 사용할 모든 인스턴스를 다 만들어서 등록해두고 => register 라는 용어를 씀

필요한 시점에 Container에게 특정타입의 인스턴스를 달라고 하면  Container가 꺼내주는 => resolve 라는 용어를 씀 

것입니다. 


https://eunjin3786.tistory.com/233

 

[DI] DI Container, IOC Container 개념과 예제

곰튀김님의 Inversion 세션 (let us go summer 2020 => 2:18:19 쯤 나와요! 👍) 을 보다가 Dependency Container를 공부해보고자합니다. Dependency Injection의 개념 & SOLID의 D인 의존관계 역전 원칙(DIP)을 어떻게 따르게

eunjin3786.tistory.com

 

https://learn.microsoft.com/en-us/dotnet/communitytoolkit/mvvm/ioc

 

Ioc - Community Toolkits for .NET

An introduction to the use of the IServiceProvider type through the Microsoft.Extensions.DependencyInjection APIs

learn.microsoft.com


 

DI (Dependency Injection) 의존성 주입

 

-클래스 내부 객체를 외부에서 new때리는거

 


 

https://eunjin3786.tistory.com/115

 

[DI] 의존성 주입(Dependency Injection) 을 해주는 세가지 방법

Dependency Injection의 개념과 장점 뿐만아니라 SOLID의 D인 의존관계 역전 원칙(DIP)을 어떻게 따르게 해줄 수 있을지 설명해주는 아주 좋은 글 입니다 :-) https://medium.com/@jang.wangsu/di-dependency-injection-이

eunjin3786.tistory.com

 

https://dalgona.dev/posts/2019-03-27-ioc-and-di.html

 

제어의 역전을 통한 의존성 주입

이번 포스트는 어쩌다 보니 바로 앞 글의 후속편이 되었습니다. 이번에는 의존성 주입(dependency injection)과 밀접한 관련이 있는 제어의 역전에 대해 정리해 봅니다. 그리고 매우 단순화된 버전의 I

dalgona.dev

 

 


Prism Container


 

https://prismlibrary.com/docs/wpf/legacy/Managing-Dependencies.html

 

Managing Dependencies Between Components Using the Prism Library for WPF | Prism

Managing Dependencies Between Components Using the Prism Library for WPF Applications based on the Prism Library are composite applications that potentially consist of many loosely coupled types and services. They need to interact to contribute content and

prismlibrary.com

 


 

728x90