SlideShare une entreprise Scribd logo
1  sur  35
STAATLICH
ANERKANNTE
FACHHOCHSCHULE
Author: Dip.-Inf. (FH) Johannes Hoppe
Date: 27.10.2010
10.11.2010
STUDIEREN
UND DURCHSTARTEN.
STAATLICH
ANERKANNTE
FACHHOCHSCHULE
RIA – Rich Internet Applications
Author: Dip.-Inf. (FH) Johannes Hoppe
Date: 27.10.2010
10.11.2010
First ASP.NET Project: WebNoteMvc
01
30.01.2015
Folie 3
First ASP.NET Project: WebNoteMvc
30.01.2015
Folie 4
View
(Presentation)
Controller Layer
(Application flow controll)
Model
(Business Layer)
Service Layer
Repository Layer
Data Access Layer
First ASP.NET Project: WebNoteMvc
Tiers for the Model
› Service Layer
› Sub-Applications boundary  “Access from outside”
› CRUD, Validation, Transactions…
› A good place to “talk” with other repositories
› Repository Layer
› “Shields” application from real data access
› A good place for caching
› Data Access Layer (here: Entity Framework)
› Data mapper that moves data between objects and a database
(brutally simplified Martin Fowler: Patterns of Enterprise Application Architecture)
30.01.2015
Folie 5
First ASP.NET Project: WebNoteMvc
Implementation
› 1. We created a database and a table
› 2. We created an EDMX file based on the database
› 3. We used the plugin ”MCGe” to generate POCOs
› 4. We created a repository layer with all CRUD operations
› We did not created a service layer (for now)
› 5. We changed the default controller to provide all CRUD operations
› 6. We created views for every Controller operation
http://code.google.com/p/lecture-
hoppe/downloads/detail?name=WebNoteMvc_v0.3.zip
30.01.2015
Folie 6
Repetition of creating “WebNoteMvc”
02
30.01.2015
Folie 7
Repetition of creating “WebNoteMvc”
1. We created a database and a table
30.01.2015
Folie 8
Repetition of creating “WebNoteMvc”
2. We created an EDMX file based on the database
30.01.2015
Folie 9
Repetition of creating “WebNoteMvc”
3. We used the extension ”MCGe v0.3” to generate POCOs
30.01.2015
Folie 10
http://blog.johanneshoppe.de/2010/10/ado-net-mocking-context-generator-
extended-walkthrough/
Repetition of creating “WebNoteMvc”
3. We used the extension ”MCGe v0.3” to generate POCOs
30.01.2015
Folie 11
Repetition of creating “WebNoteMvc”
4. We created a repository layer with all CRUD operations
30.01.2015
Folie 12
Repetition of creating “WebNoteMvc”
5. We changed the default controller to provide all CRUD operations
30.01.2015
Folie 13
Repetition of creating “WebNoteMvc”
6. We created views for every Controller operation
30.01.2015
Folie 14
Repetition of creating “WebNoteMvc”
30.01.2015
Folie 15
Repetition of creating “WebNoteMvc”
Questions?
?
30.01.2015
Folie 16
Unit Tests
03
30.01.2015
Folie 17
Unit Tests
What?
Why?
When?
How?
30.01.2015
Folie 18
Unit Tests
What?
A piece of software
that (automatically)
tests the smallest parts of an application.
30.01.2015
Folie 19
Unit Tests
What?
A unit test enables you to verify
whether a particular method
works as you intend it to work.
30.01.2015
Folie 20
Unit Tests
What?
A unit test is a straightforward
way to produce code
with a low error rate.
30.01.2015
Folie 21
Unit Tests
Why?
30.01.2015
Folie 22
Unit Tests
30.01.2015
Folie 23
Building tests for your code
avoids software bugs.
Unit Tests
30.01.2015
Folie 24
Building tests for your code
provides you with a safety
net for change.
Unit Tests
30.01.2015
Folie 25
Building tests for your code
forces you to write loosely
coupled code.
Unit Tests
30.01.2015
Folie 26
Building tests for your code
forces you to take a user
perspective on the code.
Unit Tests
30.01.2015
Folie 27
Building tests for your code
provides a documentation
for future coders.
Unit Tests
When?
30.01.2015
Folie 28
Unit Tests
When?
Always.
or
Whenever it is planned
to reuse the software.
30.01.2015
Folie 29
Unit Tests
When?
Before
writing the actual code.
(Test-Driven Development)
30.01.2015
Folie 30
Unit Tests
When?
Test-Driven Development
1. Write a unit test that fails.
2. Write code that passes the unit tests.
3. Refactor your code.
30.01.2015
Folie 31
Unit Tests
30.01.2015
Folie 32
How?
Unit Tests
Questions?
?
30.01.2015
Folie 33
Unit Tests
Your tasks:
› Try to write your first set of unit tests
› Work together with you neighbor (2 persons, one team)
› Use the Mock-Framework “Moq” from www.moq.me
› Implement:
 AddNoteTest, EditNoteTest, DeleteNoteTest
 DeleteNoteShouldThrowExceptionTest
 GetNoteShouldNotCallSaveChangesTest
 6 Tests for the Controller
30.01.2015
Folie 34
THANK YOU
FOR YOUR ATTENTION
30.01.2015
Folie 35

Contenu connexe

Similaire à Ria 04 & 05 - First ASP.NET MVC project

RIA 06 & 07 - Unit Testing in Detail
RIA 06 & 07 - Unit Testing in DetailRIA 06 & 07 - Unit Testing in Detail
RIA 06 & 07 - Unit Testing in Detail
Johannes Hoppe
 
OSMC 2016 | Application Performance Management with Open-Source-Tooling by Ma...
OSMC 2016 | Application Performance Management with Open-Source-Tooling by Ma...OSMC 2016 | Application Performance Management with Open-Source-Tooling by Ma...
OSMC 2016 | Application Performance Management with Open-Source-Tooling by Ma...
NETWAYS
 
20101109 (tech ed) how frameworks kill projects
20101109   (tech ed) how frameworks kill projects20101109   (tech ed) how frameworks kill projects
20101109 (tech ed) how frameworks kill projects
Sander Hoogendoorn
 

Similaire à Ria 04 & 05 - First ASP.NET MVC project (20)

RIA 06 & 07 - Unit Testing in Detail
RIA 06 & 07 - Unit Testing in DetailRIA 06 & 07 - Unit Testing in Detail
RIA 06 & 07 - Unit Testing in Detail
 
Testing your applications with mbunit
Testing your applications with mbunitTesting your applications with mbunit
Testing your applications with mbunit
 
Web services, WCF services and Multi Threading with Windows Forms
Web services, WCF services and Multi Threading with Windows FormsWeb services, WCF services and Multi Threading with Windows Forms
Web services, WCF services and Multi Threading with Windows Forms
 
Stateful mock servers to the rescue on REST ecosystems
Stateful mock servers to the rescue on REST ecosystemsStateful mock servers to the rescue on REST ecosystems
Stateful mock servers to the rescue on REST ecosystems
 
First fare 2010 lab-view overview
First fare 2010 lab-view overviewFirst fare 2010 lab-view overview
First fare 2010 lab-view overview
 
JavaLand - Integration Testing How-to
JavaLand - Integration Testing How-toJavaLand - Integration Testing How-to
JavaLand - Integration Testing How-to
 
OSMC 2016 | Application Performance Management with Open-Source-Tooling by Ma...
OSMC 2016 | Application Performance Management with Open-Source-Tooling by Ma...OSMC 2016 | Application Performance Management with Open-Source-Tooling by Ma...
OSMC 2016 | Application Performance Management with Open-Source-Tooling by Ma...
 
OSMC 2016 - Application Performance Management with Open-Source-Tooling by M...
OSMC 2016 -  Application Performance Management with Open-Source-Tooling by M...OSMC 2016 -  Application Performance Management with Open-Source-Tooling by M...
OSMC 2016 - Application Performance Management with Open-Source-Tooling by M...
 
Building Applications Using the U2 Toolkit for .NET
Building Applications Using the U2 Toolkit for .NETBuilding Applications Using the U2 Toolkit for .NET
Building Applications Using the U2 Toolkit for .NET
 
Enterprise Architecture in Practice: from Datastore to APIs and Apps
Enterprise Architecture in Practice: from Datastore to APIs and AppsEnterprise Architecture in Practice: from Datastore to APIs and Apps
Enterprise Architecture in Practice: from Datastore to APIs and Apps
 
20101109 (tech ed) how frameworks kill projects
20101109   (tech ed) how frameworks kill projects20101109   (tech ed) how frameworks kill projects
20101109 (tech ed) how frameworks kill projects
 
Implementation of a SaaS based simulation platform using open standards and o...
Implementation of a SaaS based simulation platform using open standards and o...Implementation of a SaaS based simulation platform using open standards and o...
Implementation of a SaaS based simulation platform using open standards and o...
 
Cloud Reliability: Decreasing outage frequency using fault injection
Cloud Reliability: Decreasing outage frequency using fault injectionCloud Reliability: Decreasing outage frequency using fault injection
Cloud Reliability: Decreasing outage frequency using fault injection
 
Building IoT Solutions using Windows IoT Core
Building IoT Solutions using Windows IoT CoreBuilding IoT Solutions using Windows IoT Core
Building IoT Solutions using Windows IoT Core
 
Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008
 
Gui automation framework
Gui automation frameworkGui automation framework
Gui automation framework
 
Asynchronous Programming in Android
Asynchronous Programming in AndroidAsynchronous Programming in Android
Asynchronous Programming in Android
 
Techdays 2011 - Things I will remember
Techdays 2011 - Things I will rememberTechdays 2011 - Things I will remember
Techdays 2011 - Things I will remember
 
ON.LAB Mininet
ON.LAB MininetON.LAB Mininet
ON.LAB Mininet
 
A component based architecture for the Web of Things
A component based architecture for the Web of ThingsA component based architecture for the Web of Things
A component based architecture for the Web of Things
 

Plus de Johannes Hoppe

2012-10-16 - WebTechCon 2012: HTML5 & WebGL
2012-10-16 - WebTechCon 2012: HTML5 & WebGL2012-10-16 - WebTechCon 2012: HTML5 & WebGL
2012-10-16 - WebTechCon 2012: HTML5 & WebGL
Johannes Hoppe
 
2012-10-12 - NoSQL in .NET - mit Redis und Mongodb
2012-10-12 - NoSQL in .NET - mit Redis und Mongodb2012-10-12 - NoSQL in .NET - mit Redis und Mongodb
2012-10-12 - NoSQL in .NET - mit Redis und Mongodb
Johannes Hoppe
 
2012-05-10 - UG Karlsruhe: NoSQL in .NET - mit Redis und MongoDB
2012-05-10 - UG Karlsruhe: NoSQL in .NET - mit Redis und MongoDB2012-05-10 - UG Karlsruhe: NoSQL in .NET - mit Redis und MongoDB
2012-05-10 - UG Karlsruhe: NoSQL in .NET - mit Redis und MongoDB
Johannes Hoppe
 

Plus de Johannes Hoppe (20)

2017 - NoSQL Vorlesung Mosbach
2017 - NoSQL Vorlesung Mosbach2017 - NoSQL Vorlesung Mosbach
2017 - NoSQL Vorlesung Mosbach
 
NoSQL - Hands on
NoSQL - Hands onNoSQL - Hands on
NoSQL - Hands on
 
Einführung in Angular 2
Einführung in Angular 2Einführung in Angular 2
Einführung in Angular 2
 
MDC kompakt 2014: Hybride Apps mit Cordova, AngularJS und Ionic
MDC kompakt 2014: Hybride Apps mit Cordova, AngularJS und IonicMDC kompakt 2014: Hybride Apps mit Cordova, AngularJS und Ionic
MDC kompakt 2014: Hybride Apps mit Cordova, AngularJS und Ionic
 
2015 02-09 - NoSQL Vorlesung Mosbach
2015 02-09 - NoSQL Vorlesung Mosbach2015 02-09 - NoSQL Vorlesung Mosbach
2015 02-09 - NoSQL Vorlesung Mosbach
 
2012-06-25 - MapReduce auf Azure
2012-06-25 - MapReduce auf Azure2012-06-25 - MapReduce auf Azure
2012-06-25 - MapReduce auf Azure
 
2013-06-25 - HTML5 & JavaScript Security
2013-06-25 - HTML5 & JavaScript Security2013-06-25 - HTML5 & JavaScript Security
2013-06-25 - HTML5 & JavaScript Security
 
2013-06-24 - Software Craftsmanship with JavaScript
2013-06-24 - Software Craftsmanship with JavaScript2013-06-24 - Software Craftsmanship with JavaScript
2013-06-24 - Software Craftsmanship with JavaScript
 
2013-06-15 - Software Craftsmanship mit JavaScript
2013-06-15 - Software Craftsmanship mit JavaScript2013-06-15 - Software Craftsmanship mit JavaScript
2013-06-15 - Software Craftsmanship mit JavaScript
 
2013 05-03 - HTML5 & JavaScript Security
2013 05-03 -  HTML5 & JavaScript Security2013 05-03 -  HTML5 & JavaScript Security
2013 05-03 - HTML5 & JavaScript Security
 
2013-03-23 - NoSQL Spartakiade
2013-03-23 - NoSQL Spartakiade2013-03-23 - NoSQL Spartakiade
2013-03-23 - NoSQL Spartakiade
 
2013 02-26 - Software Tests with Mongo db
2013 02-26 - Software Tests with Mongo db2013 02-26 - Software Tests with Mongo db
2013 02-26 - Software Tests with Mongo db
 
2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices
2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices
2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices
 
2012-10-16 - WebTechCon 2012: HTML5 & WebGL
2012-10-16 - WebTechCon 2012: HTML5 & WebGL2012-10-16 - WebTechCon 2012: HTML5 & WebGL
2012-10-16 - WebTechCon 2012: HTML5 & WebGL
 
2012-10-12 - NoSQL in .NET - mit Redis und Mongodb
2012-10-12 - NoSQL in .NET - mit Redis und Mongodb2012-10-12 - NoSQL in .NET - mit Redis und Mongodb
2012-10-12 - NoSQL in .NET - mit Redis und Mongodb
 
2012-09-18 - HTML5 & WebGL
2012-09-18 - HTML5 & WebGL2012-09-18 - HTML5 & WebGL
2012-09-18 - HTML5 & WebGL
 
2012-09-17 - WDC12: Node.js & MongoDB
2012-09-17 - WDC12: Node.js & MongoDB2012-09-17 - WDC12: Node.js & MongoDB
2012-09-17 - WDC12: Node.js & MongoDB
 
2012-08-29 - NoSQL Bootcamp (Redis, RavenDB & MongoDB für .NET Entwickler)
2012-08-29 - NoSQL Bootcamp (Redis, RavenDB & MongoDB für .NET Entwickler)2012-08-29 - NoSQL Bootcamp (Redis, RavenDB & MongoDB für .NET Entwickler)
2012-08-29 - NoSQL Bootcamp (Redis, RavenDB & MongoDB für .NET Entwickler)
 
2012-05-14 NoSQL in .NET - mit Redis und MongoDB
2012-05-14 NoSQL in .NET - mit Redis und MongoDB2012-05-14 NoSQL in .NET - mit Redis und MongoDB
2012-05-14 NoSQL in .NET - mit Redis und MongoDB
 
2012-05-10 - UG Karlsruhe: NoSQL in .NET - mit Redis und MongoDB
2012-05-10 - UG Karlsruhe: NoSQL in .NET - mit Redis und MongoDB2012-05-10 - UG Karlsruhe: NoSQL in .NET - mit Redis und MongoDB
2012-05-10 - UG Karlsruhe: NoSQL in .NET - mit Redis und MongoDB
 

Dernier

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Dernier (20)

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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?
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 

Ria 04 & 05 - First ASP.NET MVC project