Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Ria 04 & 05 - First ASP.NET MVC project

on

  • 1,017 views

 

Statistics

Views

Total Views
1,017
Views on SlideShare
823
Embed Views
194

Actions

Likes
0
Downloads
47
Comments
0

1 Embed 194

http://blog.johanneshoppe.de 194

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Ria 04 & 05 - First ASP.NET MVC project Ria 04 & 05 - First ASP.NET MVC project Presentation Transcript

  • STUDIEREN
    UND DURCHSTARTEN.
    Author: Dip.-Inf. (FH) Johannes Hoppe
    Date: 27.10.2010
    10.11.2010
  • RIA – Rich Internet Applications
    Author: Dip.-Inf. (FH) Johannes Hoppe
    Date: 27.10.2010
    10.11.2010
  • 01
    First ASP.NET Project: WebNoteMvc
    10.11.2010
    Folie 3
  • First ASP.NET Project: WebNoteMvc
    10.11.2010
    Folie 4
  • 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)
    10.11.2010
    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
    10.11.2010
    Folie 6
  • 02
    Repetition of creating “WebNoteMvc”
    10.11.2010
    Folie 7
  • Repetition ofcreating “WebNoteMvc”
    1. We created a database and a table
    10.11.2010
    Folie 8
  • Repetition ofcreating “WebNoteMvc”
    2. We created an EDMX file based on the database
    10.11.2010
    Folie 9
  • Repetition ofcreating “WebNoteMvc”
    3. We used the extension ”MCGe v0.3” to generate POCOs
    10.11.2010
    Folie 10
    http://blog.johanneshoppe.de/2010/10/ado-net-mocking-context-generator-extended-walkthrough/
  • Repetition ofcreating “WebNoteMvc”
    3. We used the extension ”MCGe v0.3” to generate POCOs
    10.11.2010
    Folie 11
  • Repetition ofcreating “WebNoteMvc”
    4. We created a repository layer with all CRUD operations
    10.11.2010
    Folie 12
  • Repetition ofcreating “WebNoteMvc”
    5. We changed the default controller to provide all CRUD operations
    10.11.2010
    Folie 13
  • Repetition ofcreating “WebNoteMvc”
    6. We created views for every Controller operation
    10.11.2010
    Folie 14
  • Repetition ofcreating “WebNoteMvc”
    10.11.2010
    Folie 15
  • Repetition ofcreating “WebNoteMvc”
    Questions?
    ?
    10.11.2010
    Folie 16
  • 03
    Unit Tests
    10.11.2010
    Folie 17
  • Unit Tests
    What?
    Why?
    When?
    How?
    10.11.2010
    Folie 18
  • Unit Tests
    What?
    A piece of software
    that (automatically)
    tests the smallest parts of an application.
    10.11.2010
    Folie 19
  • Unit Tests
    What?
    A unit test enables you to verifywhether a particular methodworks as you intend it to work.
    10.11.2010
    Folie 20
  • Unit Tests
    What?
    A unit test is a straightforward
    way to produce code
    with a low error rate.
    10.11.2010
    Folie 21
  • Unit Tests
    Why?
    10.11.2010
    Folie 22
  • Unit Tests
    10.11.2010
    Folie 23
    Building tests for your codeavoids software bugs.
  • Unit Tests
    10.11.2010
    Folie 24
    Building tests for your codeprovides you with a safety net for change.
  • Unit Tests
    10.11.2010
    Folie 25
    Building tests for your codeforces you to write loosely coupled code.
  • Unit Tests
    10.11.2010
    Folie 26
    Building tests for your codeforces you to take a user perspective on the code.
  • Unit Tests
    10.11.2010
    Folie 27
    Building tests for your codeprovides a documentation for future coders.
  • Unit Tests
    When?
    10.11.2010
    Folie 28
  • Unit Tests
    When?
    Always.
    or
    Whenever it is plannedto reuse the software.
    10.11.2010
    Folie 29
  • Unit Tests
    When?
    Before
    writing the actual code.
    (Test-Driven Development)
    10.11.2010
    Folie 30
  • Unit Tests
    When?
    Test-Driven Development
    Write a unit test that fails.
    Write code that passes the unit tests.
    Refactor your code.
    10.11.2010
    Folie 31
  • Unit Tests
    10.11.2010
    Folie 32
    How?
  • Unit Tests
    Questions?
    ?
    10.11.2010
    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
    10.11.2010
    Folie 34
  • THANK YOU
    FOR YOUR ATTENTION
    10.11.2010
    Folie 35