DEV Community

hdemiray
hdemiray

Posted on

IoC (Inversion of Control) Container

Nedir ? Dependency inversion uygularken kullandığımız dependency injection tasarım dilinde bir interface örneği istenirse ona somut olan sınıftan verir arkada örneğini tutar(new) ve yaşam döngüsünü tutar tek seferlikmi çalışacak (singelton) her seferinde yeniden mi oluşturulacak gibi.

Bu kontrol araçlarına örnek olarak

Ninject, Unity(Microsoft), Castle Windsow, Structure Map.
Dry IoC , LightInject

Nasıl Kullanılır projeye eklenir.(Ninject)

Bunlar farklı dosyalardaki farklı configurasyonlar olarak düşünelim.

Katmanlar arası geçişte singleton kullanıyoruz

 

kernel.Bind<IMevzuat>().To<IkinciMevzuat>().SingletonScope(); 

CustomerManager CustomerManager=new CustomerManager(kernel.Get<IMevzuat>());
CustomerManager.Add();
Enter fullscreen mode Exit fullscreen mode

Kernel bir kutu gibidir ona koyduğumuzu isteyen heryere dağıtır tek
Noktadan kontrol imkanı sunar. 

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay