The Start Menu……..Exposed What you never knew existed.

Slides:



Advertisements
Similar presentations
And so to Code. Forward, Reverse, and Round-Trip Engineering Forward Engineering Reverse Engineering Round-Trip Engineering.
Advertisements

Software Testing with Visual Studio 2013 & Team Foundation Server 2013 Benjamin Day.
Apache Struts Technology
INTRODUCTION TO ASP.NET MVC AND EXAMPLE WALKTHROUGH RAJAT ARYA EFECS - OIM DAWG – 4/21/2009 ASP.NET MVC.
MVC Nick Lopez Duplication of course material for any commercial purpose without the explicit written permission of the professor is prohibited.

Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models.
Red-Green-Refactor! EclipseCon 2008 Kevin P. Taylor, Nicolaus Malnick Test-Driven Development (TDD) for Eclipse RCP.
Who am I? ● Catalin Comanici ● QA for 10 years, doing test automation for about 6 years ● fun guy and rock star wannabe.
By Bob Bunson  Simulation of software development project  Fictitious system from Concept to Code  Oriented around the.
By John Boal  Continuous Integration [CI] ◦ Automating the build process ◦ Build the entire system each time any new.
N-Tier Architecture.
UNIT-V The MVC architecture and Struts Framework.
Dependency Injection and Model-View-Controller. Overview Inversion of Control Model-View-Controller.
TEST-DRIVEN DEVELOPMENT AND MVP Cory Foy and Michael Russo.
Design for Testability: Mocks, Stubs, Refactoring, and User Interfaces Benjamin Day.
Ivan Marković MSP Lead Software Developer at SPAN d.o.o. m.
Entity Framework Code First End to End
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
@benday #vslive Better Unit Tests through Design Patterns: Repository, Adapter, Mocks, and more… Benjamin
MVC and MVP. References enter.html enter.html
What is Architecture  Architecture is a subjective thing, a shared understanding of a system’s design by the expert developers on a project  In the.
Domain Driven Design. Set of blog posts spanning 10 months – building an app Fefactored along the way code to Patterns eg repository.
Todd Snyder Development Team Lead Infragistics Experience Design Group.
Building an Offline Smart Client using Domain-Driven Design Principles Tim McCarthy.
ICINETIC Experts in.NET technologies and architectures.
Software Refactoring Part I: Introduction Bartosz Walter Advanced Object-Oriented Design Lecture 5.
1 Another group of Patterns Architectural Patterns.
Chapter 26 GoF Design Patterns. The Adapter Design Pattern.
© ALEXANDRE CUVA  VERSION 2.00 Test Driven Design.
Composite User Interface Application Block Peter Provost Development Lead – patterns & practices
ARCH-4: The Presentation Layer in the OpenEdge® Reference Architecture Frank Beusenberg Senior Technical Consultant.
Alcatel-Lucent CDC Workshop, Coaching & Knowledge Transfer Architecture.
Architectural Patterns Support Lecture. Software Architecture l Architecture is OVERLOADED System architecture Application architecture l Architecture.
ICINETIC Experts in.NET technologies and architectures.
Getting Started with ASP.NET MVC BRIJ BHUSHAN MISHRA.
Model View Controller MVC Web Software Architecture.
ARCH-11: Building your Presentation with Classes John Sadd Fellow and OpenEdge Evangelist Sasha Kraljevic Principal TSE.
Getting started with ASP.NET MVC Dhananjay
ANDROID AND MODEL / VIEW / CONTROLLER. Slide 2 Design Patters Common solutions to programming problems are called design patterns Design patterns are.
Introduction (Continued) Design Patterns (I) Lecture Two.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Testing Spring Applications Unit Testing.
Test-Driving ASP.NET Development Tampa Code Camp – July 15 th, 2006 Cory Foy
SEA Side – Extreme Programming 1 SEA Side Software Engineering Annotations Architectural Patterns Professor Sara Stoecklin Director of Software Engineering-
Test Driven Development Introduction Issued date: 8/29/2007 Author: Nguyen Phuc Hai.
How to implement the Repository Pattern in an ASP.NET MVC Application Dhananjay Kumar Developer Evangelist – Infragistics Microsoft MVP
ASP.NET MVC An Introduction. What is MVC The Model-View-Controller (MVC) is an architectural pattern separates an application into three main components:
Zlatan Dzinic Principal Consultant Microsoft Most Valuable Professional - SharePoint Business Connexion.
#SPSSAN June 30, 2012 San Diego Convention Center WRITING TESTABLE CODE In SharePoint.
2 Architectural Concerns for Object/Relational Mappers (O/R-M) with Examples in NHibernate Jeffrey Palermo Chief Technology Officer Headspring Systems,
Testing WebForms w/ Model-View-Presenter Erik Peterson.
Northwest Arkansas.Net User Group Jay Smith Tyson Foods, Inc. Unit Testing nUnit, nUnitAsp, nUnitForms.
Hanoi - December 2012 Capstone Project. Project Team Supervisor: Mr. Nguyen Hong Ky FLIS Team: Pham Hoang Phuong Chu Dinh Nam Pham Van Quyen-
Automation Testing Trainer: Eran Ruso. Training Agenda Automation Testing Introduction Microsoft Automation Testing Tool Box Coded UI Test and Unit Test.
Benjamin Unit Testing & Test-Driven Development for Mere Mortals.
Beyond Basic Unit Testing: Mocks, Stubs, User Interfaces, and Refactoring for Testability Benjamin Day
Model View Presenter Design Pattern Jay Smith PMO Architect and Evangelist Tyson Foods, Inc.
Better Unit Tests through Design Patterns: Repository, Adapter, Mocks, and more… Benjamin
N-Tier Architecture.
Building Web Applications with Microsoft ASP
Unit Testing & Test-Driven Development for Mere Mortals
Unit Testing & Test-Driven Development for Mere Mortals
Chapter 13 Logical Architecture.
Tech Ed North America /1/2018 4:27 PM Required Slide
ARCH-1: Application Architecture made Simple
Chapter 13 Logical Architecture.
Real World Scrum with TFS & VSTS / Azure DevOps
Designing For Testability
An Introduction to the Model-View-ViewModel Pattern
Chapter 13 Logical Architecture.
Presentation transcript:

The Start Menu……..Exposed What you never knew existed

Model View Presenter in ASP.NET 2.0

Introductions Nick Parker Tim Gifford

Gifford Consulting Embedded Agile Coaching –Adaptive, Informed Planning –Simple Design –Refactoring –Test-Driven Development –Continuous Integration –Self-Managing Teams –Approaching Deadline Behaviors

Nick Parker Two Rivers Marketing Microsoft Visual C# MVP

Agenda Compare Code-Behind vs. MVP Demo 1 MVP Definition Comparison to Model View Controller Demo 2 Advantages Agile Testing Overview Disadvantages Review/Resources/Q&A

Expectations?

Code-Behind vs MVP (Code) protected void btnAdd_Click(object sender, EventArgs e) { txtFirstName.Enabled = true; txtLastName.Enabled = true; txt Address.Enabled = true; btnSave.Enabled = true; btnSave.Visible = true; btnAdd.Enabled = false; btnAdd.Visible = false; btnCancel.Enabled = true; btnCancel.Visible = true; txtContactId.Value = string.Empty; btnUpdate.Enabled = false; btnUpdate.Visible = false; } private void EditContact(Guid guidContactId) { //Get the contact factory = config.BuildSessionFactory(); ContactDTO contact = null; ISession session = factory.OpenSession(); contact = (ContactDTO)session.CreateCriteria( typeof(ContactDTO)).Add(Expression.Eq("ContactId", guidContactId)).UniqueResult(); session.Close(); if (contact != null) { txtFirstName.Text = contact.FirstName; txtLastName.Text = contact.LastName; this.txt Address.Text = contact. Address; this.txtFirstName.Enabled = true; txtLastName.Enabled = true; txt Address.Enabled = true; btnSave.Enabled = false; btnSave.Visible = false; btnCancel.Enabled = true; btnCancel.Visible = true; btnAdd.Enabled = false; btnAdd.Visible = false; txtContactId.Value = guidContactId.ToString(); btnUpdate.Enabled = true; btnUpdate.Visible = true; } protected void btnSave_Click(object sender, EventArgs e) { presenter.SaveContact(); } protected void btnUpdate_Click(object sender, EventArgs e) { presenter.UpdateContact(); } protected void btnAdd_Click(object sender, EventArgs e) { presenter.NewContact(); } protected void btnCancel_Click(object sender, EventArgs e) { presenter.Cancel(); } public IList DataSource { set { this.gvContacts.DataSource = value; this.gvContacts.DataBind(); } public ITextBoxAdapter EditFirstName { get { return new TextboxAdapter(this.txtFirstName); } } public ITextBoxAdapter EditLastName { get { return new TextboxAdapter(this.txtLastName); } } public ITextBoxAdapter Edit { get { return new TextboxAdapter(this.txt Address); } }

Code-Behind vs MVP Data Access Business Logic Domain Model Presentation User Interface Database Data Access Business Logic Domain Model Code Behind User Interface Database

Demo Swap Demo

Model – View – Presenter Model Presenter Update View User Actions

Model Responsibilities: –Stores Data Collaborators: –None Anti-Collaborators: –Model does NOT talk to the view –* Model’s don’t talk to me either!

View Responsibilities: Display and User Interface Delegate User Actions to Presenter Collaborators: Presenter Anti-Collaborators: Services

Presenter Responsibilities: Map between the UI and the Data Handle User Events Collaborators: View Model Service Anti-Collaborators: None*

Split Pattern Passive View –All synchronization between the View & Model is handled by the presenter –Minimal behavior on the View Supervising Controller/Presenter –Allows for more advanced Data Binding –More behaviors handled by view

MVP vs MVC MVP is MVC done “right” Data Access Model Presenter View Data Access Model Controller View MVPMVC

MVP UML(ish) Diagram

Advantages Reduce duplicate code Reduce maintenance Separation of Concerns Testable/Test-Driven Reduce UI defects

Agile Testing UI Integration Unit Tests Selenium Mercury Automated QA FIT FitNesse Nunit

Testing Layers

Demo Disable/Hide Controls

Disadvantages Complexity Learning Curve When NOT to use MVP? Quick & Dirty Short Application Lifetime Support Staff Not supported in technology (VB 6.0)

Review Benefit –Use MVP to create a unit tested UI –Helps minimize (or eliminate) defects Costs –Complexity

Resources Tim Gifford Blog: blogs.giffordconsulting.com Nick Parker Blog: Code: