SlideShare una empresa de Scribd logo
1 de 22
Descargar para leer sin conexión
Applying Domain Driven Design on
          Asp.net MVC
           Mohamed Meligy
Agenda
 ASP.NET MVC, The Steps
 Model, Controller, View
 Why ASP.NET MVC

 Domain, AKA, Model
   The Domain Model
   The Ubiquitous Language
 Building Blocks
     Entities / Value Objects
     Aggregates / Factories
     Repositories
     Services / Modules

 Putting it all together
Model




           View           Controller




ASP.NET MVC – Form few thousand feet …
ASP.NET Futures Themes
 Webforms
 AJAX
 MVC
 Dynamic Data
 Feature Sharing
   Webforms with AJAX
   Dynamic Data with MVC
  …
 jQuery
M – V – C, The Steps …

                          Routing
      Request

                                      Forward




Step 0
Incoming request matched by Routing
M – V – C, The Steps …
                            Controller
       Request




Step 1
Incoming request directed to Controller
M – V – C, The Steps …
                           Controller
      Request                                  Model




Step 2
Controller processes request and forms a data Model
M – V – C, The Steps …
                          Controller
      Request




                                       View




Step 3
Model is passed to View
M – V – C, The Steps …
                           Controller
      Request




                                               View




Step 4
View transforms Model into appropriate output format
M – V – C, The Steps …
                       Controller
      Request




                                    View   Response




Step 5
Response is rendered
The ASP.NET MVC Building Blocks
Simply creating a new project
The model
 The class that needs to be presented, or processed
 Can be bound in controller
   Model Binders
 Can live anywhere in your solution
The Controller
 A set of action methods that share a common
 Controller context
   … which is different from HTTP context 
 An action:
  1. Receives the request parameters
  2. Creates any required model (user, etc..)
  3. Calls services or repositories to execute data or get
     the models to be displayed
  4. Selects the view and sends the model to it, with any
     additional info (like page title, …)
The ASP.NET MVC Building Blocks
ROUND TWO !!
The View
 Just renderer
   No logic should go there
 Page lifecycle ?
   Yes and No!
   Code Behind exists but not recommended
 No View State, No Server Controls
   Really?
   HTML Helpers
 Takes the view data from the controller
   Can be typed or Dictionary of values
 Not Just Web forms code
   View Engines
View Engines




Web forms
• The default option
• Comes with VS
• Same experience:
     • Syntax
     • VS Support
View Engines




NHAML
• Based on Ruby On Rails HAML Engine
• http://code.google.com/p/nhaml
• http://andrewpeters.net/2007/12/19/introducing-nhaml-an-aspnet-mvc-view-engine
                                                                          engine
The webforms view Engine
From ASP.NET MVC source code
Why Oh, WHY !!!
 Easier …
   Tight control over markup
   User/SEO friendly URLs
   Conventions and Guidance
   jQuery (Built-in)
 Tight control: Not just markup
   Everything is replaceable
   Interface based style
   Not full with sealed/internal stuff 
 Testability
 The guys who created it are just awesome 
   94% Code Coverage/1051 unit tests
The other side of the story
 It’s not as easy as you think!
   To go low level or not to go; this IS the question.
 IIS 6 Quirks
 Custom Controls
Where to go
       Official website http://asp.net/mvc
       Source Code http://codeplex.com/aspnet
       Blogs
           The ASP.NET MVC Team
               Scott Guthrie http://weblogs.asp.net/scottgu
               Rob Conrey http://blog.wekeroad.com
                 MVC Store Front http://blog.wekeroad.com/mvc-storefront
               Phil Haack http://haacked.com
               Scott Hanselman http://hanselman.com
       Stephen Walthler http://weblogs.asp.net/stephenwalther
       http://www.chrisvandesteeg.nl
       http://www.singingeels.com
http://weblogs.asp.net/meligy

Más contenido relacionado

La actualidad más candente

Lightweight webdev
Lightweight webdevLightweight webdev
Lightweight webdevdamianofusco
 
jQuery From the Ground Up
jQuery From the Ground UpjQuery From the Ground Up
jQuery From the Ground UpKevin Griffin
 
Djangocon 09 Presentation - Pluggable Applications
Djangocon 09 Presentation - Pluggable ApplicationsDjangocon 09 Presentation - Pluggable Applications
Djangocon 09 Presentation - Pluggable ApplicationsNowell Strite
 
ASP .NET MVC Introduction & Guidelines
ASP .NET MVC Introduction & Guidelines  ASP .NET MVC Introduction & Guidelines
ASP .NET MVC Introduction & Guidelines Dev Raj Gautam
 
Wordcamp Toronto Presentation
Wordcamp Toronto PresentationWordcamp Toronto Presentation
Wordcamp Toronto PresentationRoy Sivan
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentationBhavin Shah
 
WordPress and Client Side Web Applications WCTO
WordPress and Client Side Web Applications WCTOWordPress and Client Side Web Applications WCTO
WordPress and Client Side Web Applications WCTORoy Sivan
 
IV - CSS architecture
IV - CSS architectureIV - CSS architecture
IV - CSS architectureWebF
 
Mobile WebDriver Selendroid
Mobile WebDriver SelendroidMobile WebDriver Selendroid
Mobile WebDriver SelendroidMichael Palotas
 
MVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - IndiandotnetMVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - IndiandotnetIndiandotnet
 
I - Front-end Spectrum
I - Front-end SpectrumI - Front-end Spectrum
I - Front-end SpectrumWebF
 
learn mvc project in 7 day
learn mvc project in 7 daylearn mvc project in 7 day
learn mvc project in 7 dayQuach Long
 

La actualidad más candente (20)

Lightweight webdev
Lightweight webdevLightweight webdev
Lightweight webdev
 
ASP .Net MVC 5
ASP .Net MVC 5ASP .Net MVC 5
ASP .Net MVC 5
 
jQuery From the Ground Up
jQuery From the Ground UpjQuery From the Ground Up
jQuery From the Ground Up
 
ASP .NET MVC - best practices
ASP .NET MVC - best practicesASP .NET MVC - best practices
ASP .NET MVC - best practices
 
ASP .net MVC
ASP .net MVCASP .net MVC
ASP .net MVC
 
Djangocon 09 Presentation - Pluggable Applications
Djangocon 09 Presentation - Pluggable ApplicationsDjangocon 09 Presentation - Pluggable Applications
Djangocon 09 Presentation - Pluggable Applications
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
MSDN - ASP.NET MVC
MSDN - ASP.NET MVCMSDN - ASP.NET MVC
MSDN - ASP.NET MVC
 
About Flux
About FluxAbout Flux
About Flux
 
ASP .NET MVC Introduction & Guidelines
ASP .NET MVC Introduction & Guidelines  ASP .NET MVC Introduction & Guidelines
ASP .NET MVC Introduction & Guidelines
 
Wordcamp Toronto Presentation
Wordcamp Toronto PresentationWordcamp Toronto Presentation
Wordcamp Toronto Presentation
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
 
WordPress and Client Side Web Applications WCTO
WordPress and Client Side Web Applications WCTOWordPress and Client Side Web Applications WCTO
WordPress and Client Side Web Applications WCTO
 
IV - CSS architecture
IV - CSS architectureIV - CSS architecture
IV - CSS architecture
 
Mobile WebDriver Selendroid
Mobile WebDriver SelendroidMobile WebDriver Selendroid
Mobile WebDriver Selendroid
 
Flux architecture
Flux architectureFlux architecture
Flux architecture
 
MVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - IndiandotnetMVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - Indiandotnet
 
I - Front-end Spectrum
I - Front-end SpectrumI - Front-end Spectrum
I - Front-end Spectrum
 
learn mvc project in 7 day
learn mvc project in 7 daylearn mvc project in 7 day
learn mvc project in 7 day
 
Client and server
Client and serverClient and server
Client and server
 

Destacado

Add Some DDD to Your ASP.NET MVC, OK?
Add Some DDD to Your ASP.NET MVC, OK?Add Some DDD to Your ASP.NET MVC, OK?
Add Some DDD to Your ASP.NET MVC, OK?Steven Smith
 
ASP.NET Page life cycle and ViewState
ASP.NET Page life cycle and ViewStateASP.NET Page life cycle and ViewState
ASP.NET Page life cycle and ViewStateMindfire Solutions
 
Domain-Driven Design with ASP.NET MVC
Domain-Driven Design with ASP.NET MVCDomain-Driven Design with ASP.NET MVC
Domain-Driven Design with ASP.NET MVCSteven Smith
 
Implementing DDD with C#
Implementing DDD with C#Implementing DDD with C#
Implementing DDD with C#Pascal Laurin
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life CycleAbhishek Sur
 
Asp.net page lifecycle
Asp.net page lifecycleAsp.net page lifecycle
Asp.net page lifecycleKhademulBasher
 

Destacado (6)

Add Some DDD to Your ASP.NET MVC, OK?
Add Some DDD to Your ASP.NET MVC, OK?Add Some DDD to Your ASP.NET MVC, OK?
Add Some DDD to Your ASP.NET MVC, OK?
 
ASP.NET Page life cycle and ViewState
ASP.NET Page life cycle and ViewStateASP.NET Page life cycle and ViewState
ASP.NET Page life cycle and ViewState
 
Domain-Driven Design with ASP.NET MVC
Domain-Driven Design with ASP.NET MVCDomain-Driven Design with ASP.NET MVC
Domain-Driven Design with ASP.NET MVC
 
Implementing DDD with C#
Implementing DDD with C#Implementing DDD with C#
Implementing DDD with C#
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
 
Asp.net page lifecycle
Asp.net page lifecycleAsp.net page lifecycle
Asp.net page lifecycle
 

Similar a Applying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVC

Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...Dot Net Tricks
 
2011 NetUG HH: ASP.NET MVC & HTML 5
2011 NetUG HH: ASP.NET MVC & HTML 52011 NetUG HH: ASP.NET MVC & HTML 5
2011 NetUG HH: ASP.NET MVC & HTML 5Daniel Fisher
 
4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part I4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part IRohit Rao
 
Building a MVC eCommerce Site in Under 5 Minutes
Building a MVC eCommerce Site in Under 5 MinutesBuilding a MVC eCommerce Site in Under 5 Minutes
Building a MVC eCommerce Site in Under 5 MinutesGaines Kergosien
 
Fast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVCFast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVCAnkit Kashyap
 
Sitecore MVC: What it is and why it's important
Sitecore MVC: What it is and why it's importantSitecore MVC: What it is and why it's important
Sitecore MVC: What it is and why it's importantnonlinear creations
 
Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0Mayank Srivastava
 
Technoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesTechnoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesAaron Jacobson
 
ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)Hatem Hamad
 
Introduction to mvc architecture
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architectureravindraquicsolv
 
Asp.Net Mvc
Asp.Net MvcAsp.Net Mvc
Asp.Net Mvcmicham
 
Colin Bowern - The Not So Scary Side Of Asp.Net – Model View Controller In Th...
Colin Bowern - The Not So Scary Side Of Asp.Net – Model View Controller In Th...Colin Bowern - The Not So Scary Side Of Asp.Net – Model View Controller In Th...
Colin Bowern - The Not So Scary Side Of Asp.Net – Model View Controller In Th...Refresh Events
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVC Introduction to ASP.NET MVC
Introduction to ASP.NET MVC Joe Wilson
 
Mvc presentation
Mvc presentationMvc presentation
Mvc presentationMaslowB
 

Similar a Applying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVC (20)

Aspnet mvc
Aspnet mvcAspnet mvc
Aspnet mvc
 
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...
 
2011 NetUG HH: ASP.NET MVC & HTML 5
2011 NetUG HH: ASP.NET MVC & HTML 52011 NetUG HH: ASP.NET MVC & HTML 5
2011 NetUG HH: ASP.NET MVC & HTML 5
 
4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part I4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part I
 
Building a MVC eCommerce Site in Under 5 Minutes
Building a MVC eCommerce Site in Under 5 MinutesBuilding a MVC eCommerce Site in Under 5 Minutes
Building a MVC eCommerce Site in Under 5 Minutes
 
Fast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVCFast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVC
 
Sitecore MVC: What it is and why it's important
Sitecore MVC: What it is and why it's importantSitecore MVC: What it is and why it's important
Sitecore MVC: What it is and why it's important
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0
 
Technoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesTechnoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development services
 
L13 Presentation Layer Design
L13 Presentation Layer DesignL13 Presentation Layer Design
L13 Presentation Layer Design
 
ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)
 
MVC Framework
MVC FrameworkMVC Framework
MVC Framework
 
Introduction to mvc architecture
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architecture
 
Asp.Net Mvc
Asp.Net MvcAsp.Net Mvc
Asp.Net Mvc
 
Colin Bowern - The Not So Scary Side Of Asp.Net – Model View Controller In Th...
Colin Bowern - The Not So Scary Side Of Asp.Net – Model View Controller In Th...Colin Bowern - The Not So Scary Side Of Asp.Net – Model View Controller In Th...
Colin Bowern - The Not So Scary Side Of Asp.Net – Model View Controller In Th...
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVC Introduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
Asp 1a-aspnetmvc
Asp 1a-aspnetmvcAsp 1a-aspnetmvc
Asp 1a-aspnetmvc
 
Aspnetmvc 1
Aspnetmvc 1Aspnetmvc 1
Aspnetmvc 1
 
Mvc presentation
Mvc presentationMvc presentation
Mvc presentation
 

Más de Mohamed Meligy

DDD Sydney 20111 Razor Session
DDD Sydney 20111 Razor SessionDDD Sydney 20111 Razor Session
DDD Sydney 20111 Razor SessionMohamed Meligy
 
Twitter OAuth With C#/.NET Code
Twitter OAuth With C#/.NET CodeTwitter OAuth With C#/.NET Code
Twitter OAuth With C#/.NET CodeMohamed Meligy
 
Using jQuery To Survive In ASP.NET Webforms World
Using jQuery To Survive In ASP.NET Webforms WorldUsing jQuery To Survive In ASP.NET Webforms World
Using jQuery To Survive In ASP.NET Webforms WorldMohamed Meligy
 
Managed Extensibility Framework (MEF)
Managed Extensibility Framework (MEF)Managed Extensibility Framework (MEF)
Managed Extensibility Framework (MEF)Mohamed Meligy
 
Framework Design Guidelines
Framework Design GuidelinesFramework Design Guidelines
Framework Design GuidelinesMohamed Meligy
 
Design Patterns Via C# 3.0
Design Patterns Via C# 3.0Design Patterns Via C# 3.0
Design Patterns Via C# 3.0Mohamed Meligy
 

Más de Mohamed Meligy (8)

NDC Sydney 2018 Ngrx
NDC Sydney 2018   NgrxNDC Sydney 2018   Ngrx
NDC Sydney 2018 Ngrx
 
DDD Sydney 20111 Razor Session
DDD Sydney 20111 Razor SessionDDD Sydney 20111 Razor Session
DDD Sydney 20111 Razor Session
 
Twitter OAuth With C#/.NET Code
Twitter OAuth With C#/.NET CodeTwitter OAuth With C#/.NET Code
Twitter OAuth With C#/.NET Code
 
Using jQuery To Survive In ASP.NET Webforms World
Using jQuery To Survive In ASP.NET Webforms WorldUsing jQuery To Survive In ASP.NET Webforms World
Using jQuery To Survive In ASP.NET Webforms World
 
Managed Extensibility Framework (MEF)
Managed Extensibility Framework (MEF)Managed Extensibility Framework (MEF)
Managed Extensibility Framework (MEF)
 
Framework Design Guidelines
Framework Design GuidelinesFramework Design Guidelines
Framework Design Guidelines
 
Design Patterns Via C# 3.0
Design Patterns Via C# 3.0Design Patterns Via C# 3.0
Design Patterns Via C# 3.0
 
Scrum For Developers
Scrum For DevelopersScrum For Developers
Scrum For Developers
 

Último

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Último (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Applying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVC

  • 1. Applying Domain Driven Design on Asp.net MVC Mohamed Meligy
  • 2. Agenda  ASP.NET MVC, The Steps  Model, Controller, View  Why ASP.NET MVC  Domain, AKA, Model  The Domain Model  The Ubiquitous Language  Building Blocks  Entities / Value Objects  Aggregates / Factories  Repositories  Services / Modules  Putting it all together
  • 3. Model View Controller ASP.NET MVC – Form few thousand feet …
  • 4. ASP.NET Futures Themes  Webforms  AJAX  MVC  Dynamic Data  Feature Sharing  Webforms with AJAX  Dynamic Data with MVC …  jQuery
  • 5. M – V – C, The Steps … Routing Request Forward Step 0 Incoming request matched by Routing
  • 6. M – V – C, The Steps … Controller Request Step 1 Incoming request directed to Controller
  • 7. M – V – C, The Steps … Controller Request Model Step 2 Controller processes request and forms a data Model
  • 8. M – V – C, The Steps … Controller Request View Step 3 Model is passed to View
  • 9. M – V – C, The Steps … Controller Request View Step 4 View transforms Model into appropriate output format
  • 10. M – V – C, The Steps … Controller Request View Response Step 5 Response is rendered
  • 11. The ASP.NET MVC Building Blocks Simply creating a new project
  • 12. The model  The class that needs to be presented, or processed  Can be bound in controller  Model Binders  Can live anywhere in your solution
  • 13. The Controller  A set of action methods that share a common Controller context  … which is different from HTTP context   An action: 1. Receives the request parameters 2. Creates any required model (user, etc..) 3. Calls services or repositories to execute data or get the models to be displayed 4. Selects the view and sends the model to it, with any additional info (like page title, …)
  • 14. The ASP.NET MVC Building Blocks ROUND TWO !!
  • 15. The View  Just renderer  No logic should go there  Page lifecycle ?  Yes and No!  Code Behind exists but not recommended  No View State, No Server Controls  Really?  HTML Helpers  Takes the view data from the controller  Can be typed or Dictionary of values  Not Just Web forms code  View Engines
  • 16. View Engines Web forms • The default option • Comes with VS • Same experience: • Syntax • VS Support
  • 17. View Engines NHAML • Based on Ruby On Rails HAML Engine • http://code.google.com/p/nhaml • http://andrewpeters.net/2007/12/19/introducing-nhaml-an-aspnet-mvc-view-engine engine
  • 18. The webforms view Engine From ASP.NET MVC source code
  • 19. Why Oh, WHY !!!  Easier …  Tight control over markup  User/SEO friendly URLs  Conventions and Guidance  jQuery (Built-in)  Tight control: Not just markup  Everything is replaceable  Interface based style  Not full with sealed/internal stuff   Testability  The guys who created it are just awesome   94% Code Coverage/1051 unit tests
  • 20. The other side of the story  It’s not as easy as you think!  To go low level or not to go; this IS the question.  IIS 6 Quirks  Custom Controls
  • 21. Where to go  Official website http://asp.net/mvc  Source Code http://codeplex.com/aspnet  Blogs  The ASP.NET MVC Team  Scott Guthrie http://weblogs.asp.net/scottgu  Rob Conrey http://blog.wekeroad.com  MVC Store Front http://blog.wekeroad.com/mvc-storefront  Phil Haack http://haacked.com  Scott Hanselman http://hanselman.com  Stephen Walthler http://weblogs.asp.net/stephenwalther  http://www.chrisvandesteeg.nl  http://www.singingeels.com