InterviewSolution
| 1. |
What is IOC (Inversion of Control)? |
|
Answer» Inversion of control is a software engineering principle that transfers control of objects or parts of a program to a container or framework. In object-oriented programming, it is most often USED. In contrast to TRADITIONAL programming, where our custom code calls to a library, IoC allows a framework to control a program's flow and make calls to our custom code. Frameworks use abstractions with other built-in BEHAVIOURS to enable this. If we WANT to add our own behaviour, we must extend the framework classes or add our own classes. The benefits of this architecture are:
Various mechanisms such as Strategy design, service locator pattern, factory pattern and dependency injection (DI) can be used to implement IOC. |
|