dependency injection and model view controller n.
Skip this Video
Loading SlideShow in 5 Seconds..
Dependency Injection and Model-View-Controller PowerPoint Presentation
Download Presentation
Dependency Injection and Model-View-Controller

Loading in 2 Seconds...

play fullscreen
1 / 10

Dependency Injection and Model-View-Controller - PowerPoint PPT Presentation

  • Uploaded on

Dependency Injection and Model-View-Controller. Overview. Inversion of Control Model-View-Controller. Why Inversion of Control?. Procedural logic leads to tight coupling to particular implementations Inversion of control pushes logic to the lower application layers

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Dependency Injection and Model-View-Controller' - ally

Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

Inversion of Control


why inversion of control
Why Inversion of Control?

Procedural logic leads to tight coupling to particular implementations

Inversion of control pushes logic to the lower application layers

Essential coupling remains

binding to concrete instances
Binding to Concrete Instances

Factory instantiation

Constructor instantiation

Configuration based instantiation

dependency injection
Dependency Injection

Container Injection

Runtime binding

Facilitates testing

Simpler than factory construction?

Looser coupling

simple container example
Simple Container Example

Plug-in Manager

Type is requested

Lookup for type to be loaded

Reflection used to find the type

Instantiates an instance and returns it

Test and Code use different Data Mapper

dependency injection problems
Dependency Injection Problems

Complex level of indirection

Code can be difficult to read and understand

Use at component boundaries

Level of testing is an economic judgment

model view controller
Model View Controller

Separate user interface from business logic

Model has no User Interface interaction

Controller handles input events from user interface

View represents the appropriate display of the model

advantages of mvc
Advantages of MVC

User interfaces are hard to test

Keeps UI level small

Makes business logic easier to test

UI can be modified without affecting business logic


Inversion of Control

minimizes coupling

dependency injection for runtime control

Model View Controller

decouples UI from business logic

flexible testing and evolution