SlideShare a Scribd company logo
Object-Relational Mapping and Dependency Injection
Object-Relational Mapping
ORM Concepts
What is ORM?
•   Object Relational Mapping is a technique for converting between
    incompatible type systems in Object Oriented (OO) programming.
•   Primary use is to map between business objects in the application layer and
    a relational database.
•   Also can be used to map from business object models to data transfer
    objects (DTO) or a view model.
ORM Advantages and Disadvantages
• Compared to traditional techniques of exchange between an object-oriented
  language and a relational database, ORM often reduces the amount of code
  that needs to be written.
• Compared to traditional techniques, ORM greatly improves the speed of
  application development.
• ORM tools add complexity in areas where proprietary, or database-specific
  techniques have been highly optimized.
• Most ORM tools do not perform well during bulk deletions of data or joins.
• Stored procedures may have better performance, but are not portable.
• Object-relational impedance mismatch can result if the business object
  model does not closely match the relational data structure.
.NET ORM Tools
•   Entity Framework: http://msdn.microsoft.com/data/ef
•   Telerik OpenAccess: http://www.telerik.com/products/orm.aspx
•   Castle Project: http://www.castleproject.org/
•   AutoMapper: https://github.com/AutoMapper/AutoMapper
Microsoft Entity Framework
Why EF?
What is the Entity Framework (EF)?
• EF is Microsoft’s recommended data access technology for new
  applications.
• EF is an object-relational mapper that enables .NET developers to work with
  relational data using domain-specific objects.
• Supported Databases
   • SQL Server
   • MySQL
   • Oracle
   • Sybase
   • Any other database that provides an ADO.NET data provider
EF Use Patterns
• Database First
• Model First
• Code First
   • Code First Migrations
Inversion of Control and Dependency Injection
What is Inversion of Control (IoC)?
• IoC is an object-oriented programming practice where the object coupling is
  bound at run time by an assembler object and is typically not known at
  compile time using static analysis.
• Inversion of control as a design guideline serves the following purposes:
   • There is a decoupling of the execution of a certain task from
     implementation.
   • Every module can focus on what it is designed for.
   • Modules make no assumptions about what other systems do but rely on
     their contracts.
   • Replacing modules has no side effect on other modules.
What is Dependency Injection (DI)?
• DI is a software design pattern that allows a choice of component to be
  made at run-time rather than compile time.
• The binding of objects in the IoC pattern is accomplished through DI.
• Dependency injection involves at least three elements:
   • A dependent consumer,
   • A declaration of a component's dependencies, defined as interface
      contracts,
   • An injector (usually referred to as a container) that creates instances of
      classes that implement a given dependency interface on request.
Why use IoC and DI?
• Encourages Separation of Concerns
• Facilitates unit testing by allowing mock object with known behaviors to be
  injected
• Promotes loose coupling between application layers, allowing
  implementations to be changed as necessary (i.e. mocks to SQL Server to
  Oracle)
.NET Dependency Injection Frameworks
•   Unity DI Container: http://unity.codeplex.com/
•   Ninject: http://www.ninject.org/
•   StructureMap: http://docs.structuremap.net/
•   Spring.NET: http://www.springframework.net/
Microsoft Unity DI Container
Why Unity?
What is Unity and Why Use It?
• The Unity Application Block (Unity) is a lightweight extensible dependency
  injection container
• Unity is developed and maintained by the Microsoft Patterns and Practices
  team
• Unity is fully configurable using standard .NET config file patterns or through
  code initialization
Recommended Tool Links
• Entity Framework: http://msdn.microsoft.com/data/ef
• Unity DI Container: http://unity.codeplex.com/
Questions and Discussion

More Related Content

What's hot

Introduction to mongodb
Introduction to mongodbIntroduction to mongodb
Introduction to mongodb
neela madheswari
 
Resource Bundle
Resource BundleResource Bundle
Resource Bundle
Sunil OS
 
Celery with python
Celery with pythonCelery with python
Celery with python
Alexandre González Rodríguez
 
4.3 MySQL + PHP
4.3 MySQL + PHP4.3 MySQL + PHP
4.3 MySQL + PHP
Jalpesh Vasa
 
JSON and the Oracle Database
JSON and the Oracle DatabaseJSON and the Oracle Database
JSON and the Oracle Database
Maria Colgan
 
Комп’ютерні мережі та інтернет
Комп’ютерні мережі та інтернетКомп’ютерні мережі та інтернет
Комп’ютерні мережі та інтернет
Наталья Коба
 
презентація на тему "Антивірусні програми"
презентація на тему "Антивірусні програми"презентація на тему "Антивірусні програми"
презентація на тему "Антивірусні програми"
B0d6ka
 
Хмарні сервіси
Хмарні сервісиХмарні сервіси
Хмарні сервіси
Oleh
 
interface with mysql.pptx
interface with mysql.pptxinterface with mysql.pptx
interface with mysql.pptx
KRITIKAOJHA11
 
Mongo DB 102
Mongo DB 102Mongo DB 102
Mongo DB 102
Abhijeet Vaikar
 
Design your application using Persistent Graphs and OrientDB
Design your application using Persistent Graphs and OrientDBDesign your application using Persistent Graphs and OrientDB
Design your application using Persistent Graphs and OrientDB
Luca Garulli
 
MongoDB - Aggregation Pipeline
MongoDB - Aggregation PipelineMongoDB - Aggregation Pipeline
MongoDB - Aggregation Pipeline
Jason Terpko
 
우리가 몰랐던 크롬 개발자 도구
우리가 몰랐던 크롬 개발자 도구우리가 몰랐던 크롬 개발자 도구
우리가 몰랐던 크롬 개발자 도구
Jae Sung Park
 
Data processing with celery and rabbit mq
Data processing with celery and rabbit mqData processing with celery and rabbit mq
Data processing with celery and rabbit mq
Jeff Peck
 
Python - Lecture 11
Python - Lecture 11Python - Lecture 11
Python - Lecture 11
Ravi Kiran Khareedi
 
MongoDB (Advanced)
MongoDB (Advanced)MongoDB (Advanced)
MongoDB (Advanced)
TO THE NEW | Technology
 
Introduction Node.js
Introduction Node.jsIntroduction Node.js
Introduction Node.js
Erik van Appeldoorn
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture Introduction
Haiqi Chen
 
Oracle database hot backup and recovery
Oracle database hot backup and recoveryOracle database hot backup and recovery
Oracle database hot backup and recovery
Arun Sharma
 

What's hot (20)

Introduction to mongodb
Introduction to mongodbIntroduction to mongodb
Introduction to mongodb
 
Resource Bundle
Resource BundleResource Bundle
Resource Bundle
 
Celery with python
Celery with pythonCelery with python
Celery with python
 
4.3 MySQL + PHP
4.3 MySQL + PHP4.3 MySQL + PHP
4.3 MySQL + PHP
 
JSON and the Oracle Database
JSON and the Oracle DatabaseJSON and the Oracle Database
JSON and the Oracle Database
 
Комп’ютерні мережі та інтернет
Комп’ютерні мережі та інтернетКомп’ютерні мережі та інтернет
Комп’ютерні мережі та інтернет
 
Pascal (динамічні структури даних)
Pascal (динамічні структури даних)Pascal (динамічні структури даних)
Pascal (динамічні структури даних)
 
презентація на тему "Антивірусні програми"
презентація на тему "Антивірусні програми"презентація на тему "Антивірусні програми"
презентація на тему "Антивірусні програми"
 
Хмарні сервіси
Хмарні сервісиХмарні сервіси
Хмарні сервіси
 
interface with mysql.pptx
interface with mysql.pptxinterface with mysql.pptx
interface with mysql.pptx
 
Mongo DB 102
Mongo DB 102Mongo DB 102
Mongo DB 102
 
Design your application using Persistent Graphs and OrientDB
Design your application using Persistent Graphs and OrientDBDesign your application using Persistent Graphs and OrientDB
Design your application using Persistent Graphs and OrientDB
 
MongoDB - Aggregation Pipeline
MongoDB - Aggregation PipelineMongoDB - Aggregation Pipeline
MongoDB - Aggregation Pipeline
 
우리가 몰랐던 크롬 개발자 도구
우리가 몰랐던 크롬 개발자 도구우리가 몰랐던 크롬 개발자 도구
우리가 몰랐던 크롬 개발자 도구
 
Data processing with celery and rabbit mq
Data processing with celery and rabbit mqData processing with celery and rabbit mq
Data processing with celery and rabbit mq
 
Python - Lecture 11
Python - Lecture 11Python - Lecture 11
Python - Lecture 11
 
MongoDB (Advanced)
MongoDB (Advanced)MongoDB (Advanced)
MongoDB (Advanced)
 
Introduction Node.js
Introduction Node.jsIntroduction Node.js
Introduction Node.js
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture Introduction
 
Oracle database hot backup and recovery
Oracle database hot backup and recoveryOracle database hot backup and recovery
Oracle database hot backup and recovery
 

Viewers also liked

좌충우돌 ORM 개발기 2012 DAUM DEVON
좌충우돌 ORM 개발기 2012 DAUM DEVON좌충우돌 ORM 개발기 2012 DAUM DEVON
좌충우돌 ORM 개발기 2012 DAUM DEVON
Younghan Kim
 
03 Object Relational Mapping
03 Object Relational Mapping03 Object Relational Mapping
03 Object Relational Mapping
Ranjan Kumar
 
L18 Object Relational Mapping
L18 Object Relational MappingL18 Object Relational Mapping
L18 Object Relational Mapping
Ólafur Andri Ragnarsson
 
About Orm.fm
About Orm.fmAbout Orm.fm
About Orm.fm
Orm Moon
 
JDXA, The KISS ORM for Android
JDXA, The KISS ORM for AndroidJDXA, The KISS ORM for Android
JDXA, The KISS ORM for Android
Damodar Periwal
 
QnA blog using Django - ORM, 회원가입, 로그인/로그아웃
QnA blog using Django - ORM, 회원가입, 로그인/로그아웃QnA blog using Django - ORM, 회원가입, 로그인/로그아웃
QnA blog using Django - ORM, 회원가입, 로그인/로그아웃
Kwangyoun Jung
 
What's new, what's hot in PHP 5.3
What's new, what's hot in PHP 5.3What's new, what's hot in PHP 5.3
What's new, what's hot in PHP 5.3
Jeremy Coates
 
ORM을 활용할 경우의 설계, 개발 과정
ORM을 활용할 경우의 설계, 개발 과정ORM을 활용할 경우의 설계, 개발 과정
ORM을 활용할 경우의 설계, 개발 과정
Javajigi Jaesung
 
좌충우돌 ORM 개발기 | Devon 2012
좌충우돌 ORM 개발기 | Devon 2012좌충우돌 ORM 개발기 | Devon 2012
좌충우돌 ORM 개발기 | Devon 2012Daum DNA
 
L16 Object Relational Mapping and NoSQL
L16 Object Relational Mapping and NoSQLL16 Object Relational Mapping and NoSQL
L16 Object Relational Mapping and NoSQL
Ólafur Andri Ragnarsson
 
Object Relational Mapping in PHP
Object Relational Mapping in PHPObject Relational Mapping in PHP
Object Relational Mapping in PHP
Rob Knight
 
Ling to SQL and Entity Framework performance analysis
Ling to SQL and Entity Framework performance analysisLing to SQL and Entity Framework performance analysis
Ling to SQL and Entity Framework performance analysis
Alexander Konduforov
 
Automated functional size measurement for three tier object relational mappin...
Automated functional size measurement for three tier object relational mappin...Automated functional size measurement for three tier object relational mappin...
Automated functional size measurement for three tier object relational mappin...
IWSM Mensura
 
기술적 변화를 이끌어가기
기술적 변화를 이끌어가기기술적 변화를 이끌어가기
기술적 변화를 이끌어가기
Jaewoo Ahn
 
SK플래닛_README_마이크로서비스 아키텍처로 개발하기
SK플래닛_README_마이크로서비스 아키텍처로 개발하기SK플래닛_README_마이크로서비스 아키텍처로 개발하기
SK플래닛_README_마이크로서비스 아키텍처로 개발하기
Lee Ji Eun
 

Viewers also liked (15)

좌충우돌 ORM 개발기 2012 DAUM DEVON
좌충우돌 ORM 개발기 2012 DAUM DEVON좌충우돌 ORM 개발기 2012 DAUM DEVON
좌충우돌 ORM 개발기 2012 DAUM DEVON
 
03 Object Relational Mapping
03 Object Relational Mapping03 Object Relational Mapping
03 Object Relational Mapping
 
L18 Object Relational Mapping
L18 Object Relational MappingL18 Object Relational Mapping
L18 Object Relational Mapping
 
About Orm.fm
About Orm.fmAbout Orm.fm
About Orm.fm
 
JDXA, The KISS ORM for Android
JDXA, The KISS ORM for AndroidJDXA, The KISS ORM for Android
JDXA, The KISS ORM for Android
 
QnA blog using Django - ORM, 회원가입, 로그인/로그아웃
QnA blog using Django - ORM, 회원가입, 로그인/로그아웃QnA blog using Django - ORM, 회원가입, 로그인/로그아웃
QnA blog using Django - ORM, 회원가입, 로그인/로그아웃
 
What's new, what's hot in PHP 5.3
What's new, what's hot in PHP 5.3What's new, what's hot in PHP 5.3
What's new, what's hot in PHP 5.3
 
ORM을 활용할 경우의 설계, 개발 과정
ORM을 활용할 경우의 설계, 개발 과정ORM을 활용할 경우의 설계, 개발 과정
ORM을 활용할 경우의 설계, 개발 과정
 
좌충우돌 ORM 개발기 | Devon 2012
좌충우돌 ORM 개발기 | Devon 2012좌충우돌 ORM 개발기 | Devon 2012
좌충우돌 ORM 개발기 | Devon 2012
 
L16 Object Relational Mapping and NoSQL
L16 Object Relational Mapping and NoSQLL16 Object Relational Mapping and NoSQL
L16 Object Relational Mapping and NoSQL
 
Object Relational Mapping in PHP
Object Relational Mapping in PHPObject Relational Mapping in PHP
Object Relational Mapping in PHP
 
Ling to SQL and Entity Framework performance analysis
Ling to SQL and Entity Framework performance analysisLing to SQL and Entity Framework performance analysis
Ling to SQL and Entity Framework performance analysis
 
Automated functional size measurement for three tier object relational mappin...
Automated functional size measurement for three tier object relational mappin...Automated functional size measurement for three tier object relational mappin...
Automated functional size measurement for three tier object relational mappin...
 
기술적 변화를 이끌어가기
기술적 변화를 이끌어가기기술적 변화를 이끌어가기
기술적 변화를 이끌어가기
 
SK플래닛_README_마이크로서비스 아키텍처로 개발하기
SK플래닛_README_마이크로서비스 아키텍처로 개발하기SK플래닛_README_마이크로서비스 아키텍처로 개발하기
SK플래닛_README_마이크로서비스 아키텍처로 개발하기
 

Similar to Object-Relational Mapping and Dependency Injection

.net Based Component Technologies
.net Based Component Technologies.net Based Component Technologies
.net Based Component Technologies
prakashk453625
 
Ef overview
Ef overviewEf overview
Ef overview
Uday Shankar
 
Viper
ViperViper
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
Srinivasan Nanduri
 
Spring
SpringSpring
Spring
Suman Behara
 
itft-Fundamentals of object–oriented programming in java
itft-Fundamentals of object–oriented programming in javaitft-Fundamentals of object–oriented programming in java
itft-Fundamentals of object–oriented programming in java
Atul Sehdev
 
Learn Entity Framework in a day with Code First, Model First and Database First
Learn Entity Framework in a day with Code First, Model First and Database FirstLearn Entity Framework in a day with Code First, Model First and Database First
Learn Entity Framework in a day with Code First, Model First and Database First
Jibran Rasheed Khan
 
Architectural peripherals of react by Vadym Zhiltsov
Architectural peripherals of react by Vadym ZhiltsovArchitectural peripherals of react by Vadym Zhiltsov
Architectural peripherals of react by Vadym Zhiltsov
Lohika_Odessa_TechTalks
 
Entity framework introduction sesion-1
Entity framework introduction   sesion-1Entity framework introduction   sesion-1
Entity framework introduction sesion-1
Usama Nada
 
An Introduction To Model  View  Controller In XPages
An Introduction To Model  View  Controller In XPagesAn Introduction To Model  View  Controller In XPages
An Introduction To Model  View  Controller In XPages
Ulrich Krause
 
Introduction To Corba
Introduction To CorbaIntroduction To Corba
Introduction To Corba
rajianju
 
Java Spring
Java SpringJava Spring
Java Spring
AathikaJava
 
MWLUG 2015 - An Introduction to MVC
MWLUG 2015 - An Introduction to MVCMWLUG 2015 - An Introduction to MVC
MWLUG 2015 - An Introduction to MVC
Ulrich Krause
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
Up2 Technology
 
Stephen Pope - Sitecore on the bleeding edge
Stephen Pope - Sitecore on the bleeding edgeStephen Pope - Sitecore on the bleeding edge
Stephen Pope - Sitecore on the bleeding edge
NordicSitecoreConference
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
Karmanjay Verma
 
Transforming to Microservices
Transforming to MicroservicesTransforming to Microservices
Transforming to Microservices
Kyle Brown
 
IoT-A ARM
IoT-A ARMIoT-A ARM
IoT-A ARM
Yu-Ting Chen
 
Mobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesMobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelines
Qamar Abbas
 
Andrii Sliusar "Module Architecture of React-Redux Applications"
Andrii Sliusar "Module Architecture of React-Redux Applications"Andrii Sliusar "Module Architecture of React-Redux Applications"
Andrii Sliusar "Module Architecture of React-Redux Applications"
LogeekNightUkraine
 

Similar to Object-Relational Mapping and Dependency Injection (20)

.net Based Component Technologies
.net Based Component Technologies.net Based Component Technologies
.net Based Component Technologies
 
Ef overview
Ef overviewEf overview
Ef overview
 
Viper
ViperViper
Viper
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
Spring
SpringSpring
Spring
 
itft-Fundamentals of object–oriented programming in java
itft-Fundamentals of object–oriented programming in javaitft-Fundamentals of object–oriented programming in java
itft-Fundamentals of object–oriented programming in java
 
Learn Entity Framework in a day with Code First, Model First and Database First
Learn Entity Framework in a day with Code First, Model First and Database FirstLearn Entity Framework in a day with Code First, Model First and Database First
Learn Entity Framework in a day with Code First, Model First and Database First
 
Architectural peripherals of react by Vadym Zhiltsov
Architectural peripherals of react by Vadym ZhiltsovArchitectural peripherals of react by Vadym Zhiltsov
Architectural peripherals of react by Vadym Zhiltsov
 
Entity framework introduction sesion-1
Entity framework introduction   sesion-1Entity framework introduction   sesion-1
Entity framework introduction sesion-1
 
An Introduction To Model  View  Controller In XPages
An Introduction To Model  View  Controller In XPagesAn Introduction To Model  View  Controller In XPages
An Introduction To Model  View  Controller In XPages
 
Introduction To Corba
Introduction To CorbaIntroduction To Corba
Introduction To Corba
 
Java Spring
Java SpringJava Spring
Java Spring
 
MWLUG 2015 - An Introduction to MVC
MWLUG 2015 - An Introduction to MVCMWLUG 2015 - An Introduction to MVC
MWLUG 2015 - An Introduction to MVC
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Stephen Pope - Sitecore on the bleeding edge
Stephen Pope - Sitecore on the bleeding edgeStephen Pope - Sitecore on the bleeding edge
Stephen Pope - Sitecore on the bleeding edge
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Transforming to Microservices
Transforming to MicroservicesTransforming to Microservices
Transforming to Microservices
 
IoT-A ARM
IoT-A ARMIoT-A ARM
IoT-A ARM
 
Mobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesMobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelines
 
Andrii Sliusar "Module Architecture of React-Redux Applications"
Andrii Sliusar "Module Architecture of React-Redux Applications"Andrii Sliusar "Module Architecture of React-Redux Applications"
Andrii Sliusar "Module Architecture of React-Redux Applications"
 

Recently uploaded

GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
TIPNGVN2
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
Pixlogix Infotech
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 

Recently uploaded (20)

GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 

Object-Relational Mapping and Dependency Injection

  • 1. Object-Relational Mapping and Dependency Injection
  • 3. What is ORM? • Object Relational Mapping is a technique for converting between incompatible type systems in Object Oriented (OO) programming. • Primary use is to map between business objects in the application layer and a relational database. • Also can be used to map from business object models to data transfer objects (DTO) or a view model.
  • 4. ORM Advantages and Disadvantages • Compared to traditional techniques of exchange between an object-oriented language and a relational database, ORM often reduces the amount of code that needs to be written. • Compared to traditional techniques, ORM greatly improves the speed of application development. • ORM tools add complexity in areas where proprietary, or database-specific techniques have been highly optimized. • Most ORM tools do not perform well during bulk deletions of data or joins. • Stored procedures may have better performance, but are not portable. • Object-relational impedance mismatch can result if the business object model does not closely match the relational data structure.
  • 5. .NET ORM Tools • Entity Framework: http://msdn.microsoft.com/data/ef • Telerik OpenAccess: http://www.telerik.com/products/orm.aspx • Castle Project: http://www.castleproject.org/ • AutoMapper: https://github.com/AutoMapper/AutoMapper
  • 7. What is the Entity Framework (EF)? • EF is Microsoft’s recommended data access technology for new applications. • EF is an object-relational mapper that enables .NET developers to work with relational data using domain-specific objects. • Supported Databases • SQL Server • MySQL • Oracle • Sybase • Any other database that provides an ADO.NET data provider
  • 8. EF Use Patterns • Database First • Model First • Code First • Code First Migrations
  • 9. Inversion of Control and Dependency Injection
  • 10. What is Inversion of Control (IoC)? • IoC is an object-oriented programming practice where the object coupling is bound at run time by an assembler object and is typically not known at compile time using static analysis. • Inversion of control as a design guideline serves the following purposes: • There is a decoupling of the execution of a certain task from implementation. • Every module can focus on what it is designed for. • Modules make no assumptions about what other systems do but rely on their contracts. • Replacing modules has no side effect on other modules.
  • 11. What is Dependency Injection (DI)? • DI is a software design pattern that allows a choice of component to be made at run-time rather than compile time. • The binding of objects in the IoC pattern is accomplished through DI. • Dependency injection involves at least three elements: • A dependent consumer, • A declaration of a component's dependencies, defined as interface contracts, • An injector (usually referred to as a container) that creates instances of classes that implement a given dependency interface on request.
  • 12. Why use IoC and DI? • Encourages Separation of Concerns • Facilitates unit testing by allowing mock object with known behaviors to be injected • Promotes loose coupling between application layers, allowing implementations to be changed as necessary (i.e. mocks to SQL Server to Oracle)
  • 13. .NET Dependency Injection Frameworks • Unity DI Container: http://unity.codeplex.com/ • Ninject: http://www.ninject.org/ • StructureMap: http://docs.structuremap.net/ • Spring.NET: http://www.springframework.net/
  • 14. Microsoft Unity DI Container Why Unity?
  • 15. What is Unity and Why Use It? • The Unity Application Block (Unity) is a lightweight extensible dependency injection container • Unity is developed and maintained by the Microsoft Patterns and Practices team • Unity is fully configurable using standard .NET config file patterns or through code initialization
  • 16. Recommended Tool Links • Entity Framework: http://msdn.microsoft.com/data/ef • Unity DI Container: http://unity.codeplex.com/

Editor's Notes

  1. .NET ORM tools for databases include EF, NHibernate, TelerikOpenAccess, Castle ActiveRecord.NET Object to Object Mappers include tools like AutoMapper
  2. .NET Implementations: Microsoft Unity, Castle Windsor, StructureMap, Ninject