Dependency injection and model view controller
This presentation is the property of its rightful owner.
Sponsored Links
1 / 10

Dependency Injection and Model-View-Controller PowerPoint PPT Presentation


  • 137 Views
  • Uploaded on
  • Presentation posted in: General

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

Download Presentation

Dependency Injection and Model-View-Controller

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


Dependency injection and model view controller

Dependency Injection and Model-View-Controller


Overview

Overview

Inversion of Control

Model-View-Controller


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


Summary

Summary

Inversion of Control

minimizes coupling

dependency injection for runtime control

Model View Controller

decouples UI from business logic

flexible testing and evolution


  • Login