Introduction To Ioc

  • Uploaded by: Himanshu Srivastava
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Introduction To Ioc as PDF for free.

More details

  • Words: 294
  • Pages: 7
Introduction to IoC

1

Module Objectives • At the end of this module, participants will be able to:

– Understand what IoC is? – Various ways of Injecting dependencies – Benefits of IoC

2

2

What is IoC • Inversion of Control, also known as IOC, is an important objectoriented programming principle that can be used to reduce coupling inherent in computer programs. • IOC is also known as the Dependency Injection. - The Dependency injection technique is used in almost every framework and it is a simple example of the IoC principle applied.

3

3

Types of IoC • Types of dependency injection

– Setter Injection In Setter injection, the injection is done via a setter method. IoC uses setter methods to get the dependent classes it needs. – Constructor Injection. In Constructor injection, IOC implementing class defines a constructor to get all its dependants. The dependent classes are defined in the constructor arguments. 6

6

Benefits of IoC • Managing Dependencies

– It helps in externalizing dependencies to have a centralized control over them. Dependencies can be managed at a single place. • Improve testability

– Another reason for preferring dependency injection is that it makes testing easier. To do testing, you need to easily replace real service implementations with stubs or mocks. – The testing problem is intensified by component environments that are very intrusive, such as Java's EJB framework. 7

7

Key Points • Inversion of Control, is the core of Spring Framework which can be used to reduce coupling inherent in computer programs. • There 2 ways of injecting dependencies

– Setter – Constructor • Benefits of IoC include the following:-

– Managing Dependencies becomes easier – It helps in improving testability

9

9

Questions and Comments

10

10

Related Documents

Introduction To Ioc
May 2020 10
Uci Letter To Ioc
April 2020 8
Ioc Advice
June 2020 4
Ioc Structure.docx
December 2019 11
Ioc Form.xls
November 2019 26
Introduction To
November 2019 56

More Documents from ""