UvodDoKomponent: IoC

from Wiki KIVu

The main goal of Inversion of control and Dependency Injection is to remove "Hard coded dependencies" of an application. This makes the system more decoupled and maintainable. You can delegate the control flow by callback delegates, observer pattern, events, DI (Dependency injection) and lot of other ways.

Inversion of control :- It’s a generic term and implemented in several ways (events, delegates etc). The classic text on IoC by Martin Fowler is well worth reading.

Dependency injection :- DI is a subtype of IoC and is implemented by constructor injection, setter injection or method injection.

Dependency injection je proces, kdy si objekty definují své závislosti (dependency – odkaz na jiný objekt, s kterým pracují) pouze přes:

Dependency objekt, který je vytvořen frameworkem, je po vytvoření přímo předán (injected) objektu, který ho použije. Ve skutečnosti je tedy proces definování závislosti v základě opačný běžnému postupu, protože běžně si objekt/komponenta hledá sama objekt, na kterém závisí. Odtud název Inversion of Control (IoC)

In practice, both terms represent the same.

Retrieved from http://wiki.kiv.zcu.cz/UvodDoKomponent/IoC
Content last modified on 24 April 2015, 16:42