SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Website Patterns
Agenda
Core Engineering Principles
• DRY
  – Don’t Repeat Yourself
• SOLID
  – Single Responsibility
  – Open Closed
  – Liskov Substitution
  – Interface Segregation
  – Dependency Inversion
Top 5 Web Debt Causes
• Controllers doing too much
• Domain Model Issues
  – Incomplete
  – Lack of constraints / incorrect cardinality
  – Circular Dependencies
• View Issues
  – Inconsistent use of Domain and View Models
  – View code is doing too much
• Database Generation
• Unnecessary WCF Service Layers
Pattern
Domain Model
• The domain model is pure POCO
• The domain model holds state and no
  behaviour.
• The domain model is the currency for all
  layers of the website from the controller to
  the repositories.
View Model
• The View Model is the state required to be
  bound to a View
• The view model object graph is in a format
  most appropriate for a View
• Validation should occur against the view
  model via Data Annotations.
• View Models are extended with helper
  method to assist the flow of View code.
Controllers
• Controllers should only have dependencies on
  Tasks
• Controllers should be responsible for calling
  the required task actions to get / save the data
  required
• Controllers call mappers to map between
  domain objects and view models
Views
• A view should only be bound to a ViewModel
  object and never expose a domain object
  directly as its model
• Logic required for views should be
  implemented as extension methods of the
  ViewModel and not directly within the view
  itself
Tasks
• A task can be viewed as the business layer for
  a domain aggregate.
• A tasks is where the behaviour for a aggregate
  domain object is implemented
• Tasks deal only with domain objects
• Tasks can make one or more repository calls to
  a Repository for the same domain aggregate.
Repository
• A single repository exists for each domain
  aggregate
• A repository will normally map 1-2-1 with tasks.
• The repository is responsible for transactional
  boundaries and compensation if required.
• A repository does not have to be solely for
  communication with a database but can be used
  for any means of data access such as
  communicating with services
ENTITY FRAMEWORK
REPOSITORIES
Domain Model
• Model First Domain using EF 4.1
  – Auto Generated POCO Entities
  – Visualisation of object relationships
  – Build time validation
• Database Generation done in SQL Scripts
Entity Framework Repositories
• Encapsulates DbContext use
• Use Commands to Encapsulate LINQ to
  Entities queries
• Object Disposal handled via Using declarations
Entity Framework Commands
• The command class is a single location where
  all commands against a database context are
  encapsulated.
• Promotes LINQ reuse across all repositories
• Centralised location of all database use of
  IQueryable
• Decorated with multiple interfaces to restrict
  access from repositories.
• Commands are the transaction boundary.

Weitere ähnliche Inhalte

Was ist angesagt?

Migration from ASP.NET MVC to ASP.NET Core
Migration from ASP.NET MVC to ASP.NET CoreMigration from ASP.NET MVC to ASP.NET Core
Migration from ASP.NET MVC to ASP.NET CoreMiroslav Popovic
 
Skillwise - Advanced web application development
Skillwise - Advanced web application developmentSkillwise - Advanced web application development
Skillwise - Advanced web application developmentSkillwise Group
 
A User Interface for adding Machine Learning tools into GitHub
A User Interface for adding Machine Learning tools into GitHubA User Interface for adding Machine Learning tools into GitHub
A User Interface for adding Machine Learning tools into GitHubRumyana Rumenova
 
Alfresco WebScript Connector for Apache ManifoldCF
Alfresco WebScript Connector for Apache ManifoldCFAlfresco WebScript Connector for Apache ManifoldCF
Alfresco WebScript Connector for Apache ManifoldCFPiergiorgio Lucidi
 
Service-oriented architecture
Service-oriented architectureService-oriented architecture
Service-oriented architectureShalva Usubov
 
Architecting Single Page Applications
Architecting Single Page ApplicationsArchitecting Single Page Applications
Architecting Single Page ApplicationsGuy Nesher
 
4 container management
4  container management4  container management
4 container managementLen Bass
 
Asp.Net 3 5 Part 1
Asp.Net 3 5 Part 1Asp.Net 3 5 Part 1
Asp.Net 3 5 Part 1asim78
 
Streams in Parallel Development by Sven Erik Knop
Streams in Parallel Development by Sven Erik KnopStreams in Parallel Development by Sven Erik Knop
Streams in Parallel Development by Sven Erik KnopPerforce
 
SpringPeople Introduction to Mule ESB
SpringPeople Introduction to Mule ESBSpringPeople Introduction to Mule ESB
SpringPeople Introduction to Mule ESBSpringPeople
 
Velocity - NxtGen Oxford
Velocity - NxtGen OxfordVelocity - NxtGen Oxford
Velocity - NxtGen OxfordPhil Pursglove
 
Improving page migration분산처리
Improving page migration분산처리 Improving page migration분산처리
Improving page migration분산처리 Park Chunduck
 
Best spring classes in navi mumbai,spring course-provider in navi-mumbai,spri...
Best spring classes in navi mumbai,spring course-provider in navi-mumbai,spri...Best spring classes in navi mumbai,spring course-provider in navi-mumbai,spri...
Best spring classes in navi mumbai,spring course-provider in navi-mumbai,spri...anshkhurana01
 
Real World Rails Deployment
Real World Rails DeploymentReal World Rails Deployment
Real World Rails DeploymentAlan Hecht
 
Entity Framework Core 2.1: Simple, Powerful Data Access for .NET
Entity Framework Core 2.1: Simple, Powerful Data Access for .NETEntity Framework Core 2.1: Simple, Powerful Data Access for .NET
Entity Framework Core 2.1: Simple, Powerful Data Access for .NETMicrosoft Tech Community
 

Was ist angesagt? (20)

Migration from ASP.NET MVC to ASP.NET Core
Migration from ASP.NET MVC to ASP.NET CoreMigration from ASP.NET MVC to ASP.NET Core
Migration from ASP.NET MVC to ASP.NET Core
 
Skillwise - Advanced web application development
Skillwise - Advanced web application developmentSkillwise - Advanced web application development
Skillwise - Advanced web application development
 
Git preso to valtech cfml team
Git preso to valtech cfml teamGit preso to valtech cfml team
Git preso to valtech cfml team
 
A User Interface for adding Machine Learning tools into GitHub
A User Interface for adding Machine Learning tools into GitHubA User Interface for adding Machine Learning tools into GitHub
A User Interface for adding Machine Learning tools into GitHub
 
Alfresco WebScript Connector for Apache ManifoldCF
Alfresco WebScript Connector for Apache ManifoldCFAlfresco WebScript Connector for Apache ManifoldCF
Alfresco WebScript Connector for Apache ManifoldCF
 
asp-net.pptx
asp-net.pptxasp-net.pptx
asp-net.pptx
 
Service-oriented architecture
Service-oriented architectureService-oriented architecture
Service-oriented architecture
 
Road Trip To Component
Road Trip To ComponentRoad Trip To Component
Road Trip To Component
 
Architecting Single Page Applications
Architecting Single Page ApplicationsArchitecting Single Page Applications
Architecting Single Page Applications
 
4 container management
4  container management4  container management
4 container management
 
Asp.Net 3 5 Part 1
Asp.Net 3 5 Part 1Asp.Net 3 5 Part 1
Asp.Net 3 5 Part 1
 
Java SNMP Oplet
Java SNMP OpletJava SNMP Oplet
Java SNMP Oplet
 
Streams in Parallel Development by Sven Erik Knop
Streams in Parallel Development by Sven Erik KnopStreams in Parallel Development by Sven Erik Knop
Streams in Parallel Development by Sven Erik Knop
 
SpringPeople Introduction to Mule ESB
SpringPeople Introduction to Mule ESBSpringPeople Introduction to Mule ESB
SpringPeople Introduction to Mule ESB
 
Velocity - NxtGen Oxford
Velocity - NxtGen OxfordVelocity - NxtGen Oxford
Velocity - NxtGen Oxford
 
Improving page migration분산처리
Improving page migration분산처리 Improving page migration분산처리
Improving page migration분산처리
 
Best spring classes in navi mumbai,spring course-provider in navi-mumbai,spri...
Best spring classes in navi mumbai,spring course-provider in navi-mumbai,spri...Best spring classes in navi mumbai,spring course-provider in navi-mumbai,spri...
Best spring classes in navi mumbai,spring course-provider in navi-mumbai,spri...
 
FatDB Intro
FatDB IntroFatDB Intro
FatDB Intro
 
Real World Rails Deployment
Real World Rails DeploymentReal World Rails Deployment
Real World Rails Deployment
 
Entity Framework Core 2.1: Simple, Powerful Data Access for .NET
Entity Framework Core 2.1: Simple, Powerful Data Access for .NETEntity Framework Core 2.1: Simple, Powerful Data Access for .NET
Entity Framework Core 2.1: Simple, Powerful Data Access for .NET
 

Andere mochten auch

Model View Command Pattern
Model View Command PatternModel View Command Pattern
Model View Command PatternAkash Kava
 
Opportunity Plan Presentation - Philippines
Opportunity Plan Presentation - PhilippinesOpportunity Plan Presentation - Philippines
Opportunity Plan Presentation - PhilippinesJhun Paran
 
Competencia liderazgo
Competencia liderazgoCompetencia liderazgo
Competencia liderazgoTito Perez
 
Practica de laboratorio el microscopio
Practica de laboratorio el microscopioPractica de laboratorio el microscopio
Practica de laboratorio el microscopiojoshman valarezo
 
Why Your Public Company Doesn't Need Capital Markets Visibility 365
Why Your Public Company Doesn't Need Capital Markets Visibility 365Why Your Public Company Doesn't Need Capital Markets Visibility 365
Why Your Public Company Doesn't Need Capital Markets Visibility 365IR Smartt Inc.
 
Masalah yang Dihadapi Ketika Membuat Kek
Masalah yang Dihadapi Ketika Membuat KekMasalah yang Dihadapi Ketika Membuat Kek
Masalah yang Dihadapi Ketika Membuat KekCik Kyra
 
Analytical thinking 12 - August 2012
Analytical thinking 12 - August 2012Analytical thinking 12 - August 2012
Analytical thinking 12 - August 2012Charlotte Skornik
 
โกลเด้น รีทรีฟเวอร์
โกลเด้น รีทรีฟเวอร์โกลเด้น รีทรีฟเวอร์
โกลเด้น รีทรีฟเวอร์PongsaTorn Sri
 
Actualog presentation for mrsk
Actualog presentation for mrskActualog presentation for mrsk
Actualog presentation for mrskActualog
 
Actialog in pictures
Actialog in picturesActialog in pictures
Actialog in picturesActualog
 
Blog pp cultural diversity
Blog pp cultural diversityBlog pp cultural diversity
Blog pp cultural diversityPaulineHeadley
 
2012 SEO For Press Releases
2012 SEO For Press Releases2012 SEO For Press Releases
2012 SEO For Press ReleasesIR Smartt Inc.
 
東京ソーシャルデザイン研究所3ドラフト
東京ソーシャルデザイン研究所3ドラフト東京ソーシャルデザイン研究所3ドラフト
東京ソーシャルデザイン研究所3ドラフトTakayuki Toda
 
Simon says stand out
Simon says stand outSimon says stand out
Simon says stand outSimon Hurry
 
WepApps mit Play! - Nichts leichter als das
WepApps mit Play! - Nichts leichter als dasWepApps mit Play! - Nichts leichter als das
WepApps mit Play! - Nichts leichter als dasenpit GmbH & Co. KG
 
Poverty group c3
Poverty group c3Poverty group c3
Poverty group c3Bernard Sng
 

Andere mochten auch (20)

Model View Command Pattern
Model View Command PatternModel View Command Pattern
Model View Command Pattern
 
Opportunity Plan Presentation - Philippines
Opportunity Plan Presentation - PhilippinesOpportunity Plan Presentation - Philippines
Opportunity Plan Presentation - Philippines
 
Competencia liderazgo
Competencia liderazgoCompetencia liderazgo
Competencia liderazgo
 
Practica de laboratorio el microscopio
Practica de laboratorio el microscopioPractica de laboratorio el microscopio
Practica de laboratorio el microscopio
 
Why Your Public Company Doesn't Need Capital Markets Visibility 365
Why Your Public Company Doesn't Need Capital Markets Visibility 365Why Your Public Company Doesn't Need Capital Markets Visibility 365
Why Your Public Company Doesn't Need Capital Markets Visibility 365
 
Masalah yang Dihadapi Ketika Membuat Kek
Masalah yang Dihadapi Ketika Membuat KekMasalah yang Dihadapi Ketika Membuat Kek
Masalah yang Dihadapi Ketika Membuat Kek
 
Analytical thinking 12 - August 2012
Analytical thinking 12 - August 2012Analytical thinking 12 - August 2012
Analytical thinking 12 - August 2012
 
Digital Video#1
Digital Video#1Digital Video#1
Digital Video#1
 
โกลเด้น รีทรีฟเวอร์
โกลเด้น รีทรีฟเวอร์โกลเด้น รีทรีฟเวอร์
โกลเด้น รีทรีฟเวอร์
 
Actualog presentation for mrsk
Actualog presentation for mrskActualog presentation for mrsk
Actualog presentation for mrsk
 
Vintage music rien Zubaedah
Vintage music rien ZubaedahVintage music rien Zubaedah
Vintage music rien Zubaedah
 
Actialog in pictures
Actialog in picturesActialog in pictures
Actialog in pictures
 
Blog pp cultural diversity
Blog pp cultural diversityBlog pp cultural diversity
Blog pp cultural diversity
 
Humble sparrow
Humble sparrowHumble sparrow
Humble sparrow
 
Article08
Article08Article08
Article08
 
2012 SEO For Press Releases
2012 SEO For Press Releases2012 SEO For Press Releases
2012 SEO For Press Releases
 
東京ソーシャルデザイン研究所3ドラフト
東京ソーシャルデザイン研究所3ドラフト東京ソーシャルデザイン研究所3ドラフト
東京ソーシャルデザイン研究所3ドラフト
 
Simon says stand out
Simon says stand outSimon says stand out
Simon says stand out
 
WepApps mit Play! - Nichts leichter als das
WepApps mit Play! - Nichts leichter als dasWepApps mit Play! - Nichts leichter als das
WepApps mit Play! - Nichts leichter als das
 
Poverty group c3
Poverty group c3Poverty group c3
Poverty group c3
 

Ähnlich wie MVC Website Pattern The Controller, Task, Repository, Command Pattern

Architecture Principles CodeStock
Architecture Principles CodeStock Architecture Principles CodeStock
Architecture Principles CodeStock Steve Barbour
 
Entity Framework: To the Unit of Work Design Pattern and Beyond
Entity Framework: To the Unit of Work Design Pattern and BeyondEntity Framework: To the Unit of Work Design Pattern and Beyond
Entity Framework: To the Unit of Work Design Pattern and BeyondSteve Westgarth
 
Domain Driven Design Ruby Ways - JURNAL 05/10/2017
Domain Driven Design Ruby Ways -  JURNAL 05/10/2017Domain Driven Design Ruby Ways -  JURNAL 05/10/2017
Domain Driven Design Ruby Ways - JURNAL 05/10/2017Jonathan Wylliem
 
Asp 1-mvc introduction
Asp 1-mvc introductionAsp 1-mvc introduction
Asp 1-mvc introductionFajar Baskoro
 
Segue to design patterns
Segue to design patternsSegue to design patterns
Segue to design patternsRahul Singh
 
Architectural Design & Patterns
Architectural Design&PatternsArchitectural Design&Patterns
Architectural Design & PatternsInocentshuja Ahmad
 
Object-Relational Mapping and Dependency Injection
Object-Relational Mapping and Dependency InjectionObject-Relational Mapping and Dependency Injection
Object-Relational Mapping and Dependency InjectionShane Church
 
Code igniter overview
Code igniter overviewCode igniter overview
Code igniter overviewumesh patil
 
How to Structure Your Xamarin Solution by Adhering to Common .NET Practices -...
How to Structure Your Xamarin Solution by Adhering to Common .NET Practices -...How to Structure Your Xamarin Solution by Adhering to Common .NET Practices -...
How to Structure Your Xamarin Solution by Adhering to Common .NET Practices -...chaturanga ranatunga
 
Software design with Domain-driven design
Software design with Domain-driven design Software design with Domain-driven design
Software design with Domain-driven design Allan Mangune
 
Ruby on Rails & Version Control
Ruby on Rails & Version ControlRuby on Rails & Version Control
Ruby on Rails & Version ControlYash Mittal
 
Mastering asp.net mvc - Dot Net Tricks
Mastering asp.net mvc - Dot Net TricksMastering asp.net mvc - Dot Net Tricks
Mastering asp.net mvc - Dot Net TricksGaurav Singh
 
DevOps+Data: Working with Source Control
DevOps+Data: Working with Source ControlDevOps+Data: Working with Source Control
DevOps+Data: Working with Source ControlEd Leighton-Dick
 
A Note on Distributed Computing - Papers We Love Hyderabad
A Note on Distributed Computing - Papers We Love HyderabadA Note on Distributed Computing - Papers We Love Hyderabad
A Note on Distributed Computing - Papers We Love HyderabadHrishikesh Barua
 
Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3Wen-Tien Chang
 

Ähnlich wie MVC Website Pattern The Controller, Task, Repository, Command Pattern (20)

Architecture Principles CodeStock
Architecture Principles CodeStock Architecture Principles CodeStock
Architecture Principles CodeStock
 
Entity Framework: To the Unit of Work Design Pattern and Beyond
Entity Framework: To the Unit of Work Design Pattern and BeyondEntity Framework: To the Unit of Work Design Pattern and Beyond
Entity Framework: To the Unit of Work Design Pattern and Beyond
 
Domain Driven Design Ruby Ways - JURNAL 05/10/2017
Domain Driven Design Ruby Ways -  JURNAL 05/10/2017Domain Driven Design Ruby Ways -  JURNAL 05/10/2017
Domain Driven Design Ruby Ways - JURNAL 05/10/2017
 
Asp 1-mvc introduction
Asp 1-mvc introductionAsp 1-mvc introduction
Asp 1-mvc introduction
 
Segue to design patterns
Segue to design patternsSegue to design patterns
Segue to design patterns
 
Java Spring
Java SpringJava Spring
Java Spring
 
Architectural Design & Patterns
Architectural Design&PatternsArchitectural Design&Patterns
Architectural Design & Patterns
 
Object-Relational Mapping and Dependency Injection
Object-Relational Mapping and Dependency InjectionObject-Relational Mapping and Dependency Injection
Object-Relational Mapping and Dependency Injection
 
Code igniter overview
Code igniter overviewCode igniter overview
Code igniter overview
 
How to Structure Your Xamarin Solution by Adhering to Common .NET Practices -...
How to Structure Your Xamarin Solution by Adhering to Common .NET Practices -...How to Structure Your Xamarin Solution by Adhering to Common .NET Practices -...
How to Structure Your Xamarin Solution by Adhering to Common .NET Practices -...
 
Software design with Domain-driven design
Software design with Domain-driven design Software design with Domain-driven design
Software design with Domain-driven design
 
Ruby on Rails & Version Control
Ruby on Rails & Version ControlRuby on Rails & Version Control
Ruby on Rails & Version Control
 
Top 10 web application development frameworks 2016
Top 10 web application development frameworks 2016Top 10 web application development frameworks 2016
Top 10 web application development frameworks 2016
 
Mastering asp.net mvc - Dot Net Tricks
Mastering asp.net mvc - Dot Net TricksMastering asp.net mvc - Dot Net Tricks
Mastering asp.net mvc - Dot Net Tricks
 
Hybernat and structs, spring classes in mumbai
Hybernat and structs, spring classes in mumbaiHybernat and structs, spring classes in mumbai
Hybernat and structs, spring classes in mumbai
 
DevOps+Data: Working with Source Control
DevOps+Data: Working with Source ControlDevOps+Data: Working with Source Control
DevOps+Data: Working with Source Control
 
A Note on Distributed Computing - Papers We Love Hyderabad
A Note on Distributed Computing - Papers We Love HyderabadA Note on Distributed Computing - Papers We Love Hyderabad
A Note on Distributed Computing - Papers We Love Hyderabad
 
MVC architecture
MVC architectureMVC architecture
MVC architecture
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3
 

Kürzlich hochgeladen

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 

Kürzlich hochgeladen (20)

E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 

MVC Website Pattern The Controller, Task, Repository, Command Pattern

  • 3. Core Engineering Principles • DRY – Don’t Repeat Yourself • SOLID – Single Responsibility – Open Closed – Liskov Substitution – Interface Segregation – Dependency Inversion
  • 4. Top 5 Web Debt Causes • Controllers doing too much • Domain Model Issues – Incomplete – Lack of constraints / incorrect cardinality – Circular Dependencies • View Issues – Inconsistent use of Domain and View Models – View code is doing too much • Database Generation • Unnecessary WCF Service Layers
  • 6. Domain Model • The domain model is pure POCO • The domain model holds state and no behaviour. • The domain model is the currency for all layers of the website from the controller to the repositories.
  • 7. View Model • The View Model is the state required to be bound to a View • The view model object graph is in a format most appropriate for a View • Validation should occur against the view model via Data Annotations. • View Models are extended with helper method to assist the flow of View code.
  • 8. Controllers • Controllers should only have dependencies on Tasks • Controllers should be responsible for calling the required task actions to get / save the data required • Controllers call mappers to map between domain objects and view models
  • 9. Views • A view should only be bound to a ViewModel object and never expose a domain object directly as its model • Logic required for views should be implemented as extension methods of the ViewModel and not directly within the view itself
  • 10. Tasks • A task can be viewed as the business layer for a domain aggregate. • A tasks is where the behaviour for a aggregate domain object is implemented • Tasks deal only with domain objects • Tasks can make one or more repository calls to a Repository for the same domain aggregate.
  • 11. Repository • A single repository exists for each domain aggregate • A repository will normally map 1-2-1 with tasks. • The repository is responsible for transactional boundaries and compensation if required. • A repository does not have to be solely for communication with a database but can be used for any means of data access such as communicating with services
  • 13. Domain Model • Model First Domain using EF 4.1 – Auto Generated POCO Entities – Visualisation of object relationships – Build time validation • Database Generation done in SQL Scripts
  • 14. Entity Framework Repositories • Encapsulates DbContext use • Use Commands to Encapsulate LINQ to Entities queries • Object Disposal handled via Using declarations
  • 15. Entity Framework Commands • The command class is a single location where all commands against a database context are encapsulated. • Promotes LINQ reuse across all repositories • Centralised location of all database use of IQueryable • Decorated with multiple interfaces to restrict access from repositories. • Commands are the transaction boundary.