SlideShare a Scribd company logo
1 of 52
Seven Habits of Highly
Effective ASP.NET MVC
       Developers
  presented by curtis mitchell
Original 7 Habits
What are habits ?
What are habits ?

“Excellence is an art won by training and habituation. We do
not act rightly because we have virtue or excellence, but we
rather have those because we have acted rightly. We are
what we repeatedly do. Excellence, then, is not an act but
a habit.” 
 
                - Aristotle
The 7 Habits

1.   Be proactive
2.   Begin with the end in mind
3.   Put first things first
4.   Think Win-Win
5.   Seek first to understand, then to be understood
6.   Synergize
7.   Sharpen the saw
Be Proactive

   Habit #1
Habit 1: Be Proactive

OH: A leader is a person that does work when there is work to
be done
Habit 1: Be Proactive

Do some research
   Bing or Google "ASP.NET MVC Best Practices"
Habit 1: Be Proactive

Top Findings:

1. Use HTTP Accept Verbs on Action Methods
2. Rid Controllers of all dependencies
3. Use strong-typed views instead of the ViewData Dictionary
   with "Magic" string keys
4. Use an IoC container
5. Use view helper classes for conditional view logic
Use Accept Verbs on Action Methods
Rid Controllers of all dependencies
Rid Controllers of all dependencies
Use strong-typed views instead of
"Magic" string keys




               versus
Use an IoC container




 Example uses Ninject v1.0
Use view helper classes for conditional
view logic
Habit 1: Be Proactive

Resources used in previous slide:

   http://weblogs.asp.net/rashid
   http://codeclimber.net.nz/
Habit 1: Be Proactive

Resources used in previous slide:

   http://weblogs.asp.net/rashid
   http://codeclimber.net.nz/
   And, my own experiences
Habit 1: Be Proactive

  Read up on ASP.NET MVC best practices
  Subscribe to feeds
  As you write apps, develop your own best practices
  Share your experiences with the world
Begin with the end in mind

          Habit #2
Habit 2: Begin with the end in mind

Organize your MVC project for maintenance and deployment
Habit 2: Begin with the end in mind

Organize your MVC project for maintenance and deployment


Project Root (Solution Folder)
  Lib - to hold dependencies
  MVC Project
  Unit Tests folder - to hold Unit Test projects
  Other auxiliary folders...
Put First Things First

        Habit #3
Habit 3 - Put First Things First

Question:
Do you know what your database will look like in three months?
Habit 3 - Put First Things First

Question:
Do you know what changes your PM will be stressing you out
to deliver next month?
Habit 3 - Put First Things First

Make your database schema migration strategy a priority
Habit 3 - Put First Things First

Make your database schema migration strategy a priority

   Explore alternative storage methods
      Object DBs like db4o
      Schema-less storage like MongoDB
   For RDBMS, plan to alter your schema as your application
   changes
      Use a tool like Migrator.Net (my suggestion)
      Use another method like managed SQL scripts
Habit 3 - Put First Things First
Think Win-Win

    Habit #4
Habit 4 - Think Win-Win

Develop with two audiences in mind: end users and
developers. Then, create wins for each of them.
Habit 4 - Think Win-Win

Typical end user wants:
 1. Intuitive interface, not necessarily beautiful
Habit 4 - Think Win-Win

Typical end user wants:
 1. Intuitive interface, not necessarily beautiful
Habit 4 - Think Win-Win

Typical end user wants:
 1. Intuitive interface, not necessarily beautiful
 2. A responsive application rather than a fast application
Habit 4 - Think Win-Win

Typical end user wants:
 1. Intuitive interface, not necessarily beautiful
 2. A responsive application rather than a fast application

How to give them what they want:
1. Add Javascript, CSS, and HTML to your toolbox
Habit 4 - Think Win-Win

Javascript Frameworks   CSS Frameworks

JQuery                  Blueprint CSS
MooTools                960 Grid
Prototype               YUI Grid
Scriptaculous
Dojo
Habit 4 - Think Win-Win

Typical developer wants:
 1. Latest and greatest emerging technology
 2. Clean code, not perfect code - an opportunity to
    contribute/refactor
Habit 4 - Think Win-Win

 "In everything...uniformity is undesirable. Leaving
something incomplete makes it interesting, and gives one
the feeling that there is room for growth...
Even when building the imperial palace, they always leave
one place unfinished."

- Japanese Essays to Idleness
14th Century (via Marcus du Sautoy on TED.com)
Habit 4 - Think Win-Win

Typical developer wants:
 1. Latest and greatest emerging technology
 2. Clean code, not perfect code - an opportunity to
    contribute/refactor

How to give them what they want:
1. See Habit #1 (Be Proactive)
2. Write SOLID code
Habit 4 - Think Win-Win

Single Responsibility Principle
   a class should have only one reason to change
Open/Closed Principle
   a class should be open to extension, but closed to modification
Liskov's Substitution Principle
   using a derived class in place of a base class should offer no
   surprises
Interface Segregation Principle
   use fine-grained interfaces specific to the client
Dependency of Inversion Principle
   depend on abstract objects instead of concrete objects
Habit 4 - Think Win-Win




        SOLID code == Testable code
Seek first to understand, and
   then to be understood
           Habit #5
Habit 5 - Seek first to understand, and
then to be understood
I'm listening...
Habit 5 - Seek first to understand, and
then to be understood
"How do I use the gridview control or the [some other ASP.NET
2.0 user control] in my view pages if I don't use code-behind
classes or viewstate" - An ASP.NET developer transitioning
from ASP.NET to MVC
Habit 5 - Seek first to understand, and
then to be understood
"How do I use the gridview control or the [some other ASP.NET
2.0 user control] in my view pages if I don't use code-behind
classes or viewstate" - An ASP.NET developer transitioning
from ASP.NET to MVC

"You don't" - Me
Habit 5 - Seek first to understand, and
then to be understood
"How do I use the gridview control or the [some other ASP.NET
2.0 user control] in my view pages if I don't use code-behind
classes or viewstate" - An ASP.NET developer transitioning
from ASP.NET to MVC

"You don't" - Me

"Then, how do I implement some kind of view component that
can be reused across my application for consistency and
maintainability?" - AADTFATM
Habit 5 - Seek first to understand, and
then to be understood
"How do I use the gridview control or the [some other ASP.NET
2.0 user control] in my view pages if I don't use code-behind
classes or viewstate" - An ASP.NET developer transitioning
from ASP.NET to MVC

"You don't" - Me

"Then, how do I implement some kind of view component that
can be reused across my application for consistency and
maintainability?" - AADTFATM

"Ah, I understand your concerns. And, I have an answer for
you" - Me
Habit 5 - Seek first to understand, and
then to be understood
Html Helpers
   When elements of the view contain conditional logic

Partial views
   For common view elements that can be reused arbitrarily

Spark View Engine
   In case you can't shake the urge to use code-behind
   classes in your Webforms or you just want to use an
   awesomer view engine
Synergize

 Habit #6
Habit 6 - Synergize

Take separate parts and make them work together in a way
that the whole is greater than the sum of the individual parts
Habit 6 - Synergize

Take separate parts and make them work together in a way
that the whole is greater than the sum of the individual parts

How?
  Separate your concerns
      Controllers should ask views to display data, not tell
      them how
      View-Models are not domain-models
  DRY (Don't Repeat Yourself)
      Make it so components will need each other in order to
      do more
  Once your components are independent, make them
  interdependent
Sharpen the Saw

     Habit #7
Habit 7 - Sharpen the Saw

"There is no substitute for experience" - Proverb
Habit 7 - Sharpen the Saw

"There is no substitute for experience" - Proverb

Some Resources:
  http://weblogs.asp.net/rashid
  http://codeclimber.net.nz/
  http://www.dimecasts.net
  http://www.tekpub.com/
  http://haacked.com/
  http://blog.wekeroad.com
  http://weblogs.asp.net/scottgu/

More Related Content

Viewers also liked

Event Driven Architecture
Event Driven ArchitectureEvent Driven Architecture
Event Driven ArchitectureChris Patterson
 
Introducing Azure DocumentDB - NoSQL, No Problem
Introducing Azure DocumentDB - NoSQL, No ProblemIntroducing Azure DocumentDB - NoSQL, No Problem
Introducing Azure DocumentDB - NoSQL, No ProblemAndrew Liu
 
MobConf - session on C# async-await on 18june2016 at Kochi
MobConf - session on C# async-await on 18june2016 at KochiMobConf - session on C# async-await on 18june2016 at Kochi
MobConf - session on C# async-await on 18june2016 at KochiPraveen Nair
 
Internet of things - IoT - Things are talking to Internet
Internet of things - IoT - Things are talking to InternetInternet of things - IoT - Things are talking to Internet
Internet of things - IoT - Things are talking to InternetJyotindra Zaveri
 

Viewers also liked (6)

Mocking with Moq
Mocking with MoqMocking with Moq
Mocking with Moq
 
Event Driven Architecture
Event Driven ArchitectureEvent Driven Architecture
Event Driven Architecture
 
Introducing Azure DocumentDB - NoSQL, No Problem
Introducing Azure DocumentDB - NoSQL, No ProblemIntroducing Azure DocumentDB - NoSQL, No Problem
Introducing Azure DocumentDB - NoSQL, No Problem
 
MobConf - session on C# async-await on 18june2016 at Kochi
MobConf - session on C# async-await on 18june2016 at KochiMobConf - session on C# async-await on 18june2016 at Kochi
MobConf - session on C# async-await on 18june2016 at Kochi
 
Internet of things - IoT - Things are talking to Internet
Internet of things - IoT - Things are talking to InternetInternet of things - IoT - Things are talking to Internet
Internet of things - IoT - Things are talking to Internet
 
Risk asssessment
Risk asssessmentRisk asssessment
Risk asssessment
 

Similar to Seven Habits Of Highly Effective Asp Net Mvc D

Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)Ivo Jansch
 
Professionalizing the Front-end
Professionalizing the Front-endProfessionalizing the Front-end
Professionalizing the Front-endJordi Anguela
 
Learning Web Development with Ruby on Rails Launch
Learning Web Development with Ruby on Rails LaunchLearning Web Development with Ruby on Rails Launch
Learning Web Development with Ruby on Rails LaunchThiam Hock Ng
 
Workshop: Refactoring Legacy PHP: The Complete Guide
Workshop: Refactoring Legacy PHP: The Complete Guide Workshop: Refactoring Legacy PHP: The Complete Guide
Workshop: Refactoring Legacy PHP: The Complete Guide Junade Ali
 
Learn reactjs, how to code with example and general understanding thinkwik
Learn reactjs, how to code with example and general understanding   thinkwikLearn reactjs, how to code with example and general understanding   thinkwik
Learn reactjs, how to code with example and general understanding thinkwikHetaxi patel
 
iOS development best practices
iOS development best practicesiOS development best practices
iOS development best practicesMichal Juhas
 
30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software EngineerSean Coates
 
Pain Driven Development by Alexandr Sugak
Pain Driven Development by Alexandr SugakPain Driven Development by Alexandr Sugak
Pain Driven Development by Alexandr SugakSigma Software
 
Thin Controllers Fat Models - How to Write Better Code
Thin Controllers Fat Models - How to Write Better CodeThin Controllers Fat Models - How to Write Better Code
Thin Controllers Fat Models - How to Write Better CodeDr. Syed Hassan Amin
 
Top tips from what we've learned from our 10 years experience
Top tips from what we've learned from our 10 years experienceTop tips from what we've learned from our 10 years experience
Top tips from what we've learned from our 10 years experienceJoomlaDay Australia
 
Solid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven DesignSolid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven DesignIrwansyah Irwansyah
 
ITARC15 Workshop - Architecting a Large Software Project - Lessons Learned
ITARC15 Workshop - Architecting a Large Software Project - Lessons LearnedITARC15 Workshop - Architecting a Large Software Project - Lessons Learned
ITARC15 Workshop - Architecting a Large Software Project - Lessons LearnedJoão Pedro Martins
 
Dev Learn Handout - Session 604
Dev Learn Handout - Session 604Dev Learn Handout - Session 604
Dev Learn Handout - Session 604Chad Udell
 
Enterprise PHP (Zend UK Business Conference)
Enterprise PHP (Zend UK Business Conference)Enterprise PHP (Zend UK Business Conference)
Enterprise PHP (Zend UK Business Conference)Ivo Jansch
 
BADCamp 2012 -Beginner Best Practices
BADCamp 2012 -Beginner Best PracticesBADCamp 2012 -Beginner Best Practices
BADCamp 2012 -Beginner Best Practicesmeghsweet
 
Surviving a Hackathon and Beyond
Surviving a Hackathon and BeyondSurviving a Hackathon and Beyond
Surviving a Hackathon and Beyondimoneytech
 
Architecting a Large Software Project - Lessons Learned
Architecting a Large Software Project - Lessons LearnedArchitecting a Large Software Project - Lessons Learned
Architecting a Large Software Project - Lessons LearnedJoão Pedro Martins
 

Similar to Seven Habits Of Highly Effective Asp Net Mvc D (20)

Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)
 
Professionalizing the Front-end
Professionalizing the Front-endProfessionalizing the Front-end
Professionalizing the Front-end
 
Ps02 cint24 mvc in php
Ps02 cint24 mvc in phpPs02 cint24 mvc in php
Ps02 cint24 mvc in php
 
Learning Web Development with Ruby on Rails Launch
Learning Web Development with Ruby on Rails LaunchLearning Web Development with Ruby on Rails Launch
Learning Web Development with Ruby on Rails Launch
 
Workshop: Refactoring Legacy PHP: The Complete Guide
Workshop: Refactoring Legacy PHP: The Complete Guide Workshop: Refactoring Legacy PHP: The Complete Guide
Workshop: Refactoring Legacy PHP: The Complete Guide
 
Learn reactjs, how to code with example and general understanding thinkwik
Learn reactjs, how to code with example and general understanding   thinkwikLearn reactjs, how to code with example and general understanding   thinkwik
Learn reactjs, how to code with example and general understanding thinkwik
 
iOS development best practices
iOS development best practicesiOS development best practices
iOS development best practices
 
30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer
 
Pain Driven Development by Alexandr Sugak
Pain Driven Development by Alexandr SugakPain Driven Development by Alexandr Sugak
Pain Driven Development by Alexandr Sugak
 
Thin Controllers Fat Models - How to Write Better Code
Thin Controllers Fat Models - How to Write Better CodeThin Controllers Fat Models - How to Write Better Code
Thin Controllers Fat Models - How to Write Better Code
 
Top tips from what we've learned from our 10 years experience
Top tips from what we've learned from our 10 years experienceTop tips from what we've learned from our 10 years experience
Top tips from what we've learned from our 10 years experience
 
Solid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven DesignSolid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven Design
 
ITARC15 Workshop - Architecting a Large Software Project - Lessons Learned
ITARC15 Workshop - Architecting a Large Software Project - Lessons LearnedITARC15 Workshop - Architecting a Large Software Project - Lessons Learned
ITARC15 Workshop - Architecting a Large Software Project - Lessons Learned
 
Raptor 2
Raptor 2Raptor 2
Raptor 2
 
Dev Learn Handout - Session 604
Dev Learn Handout - Session 604Dev Learn Handout - Session 604
Dev Learn Handout - Session 604
 
Enterprise PHP (Zend UK Business Conference)
Enterprise PHP (Zend UK Business Conference)Enterprise PHP (Zend UK Business Conference)
Enterprise PHP (Zend UK Business Conference)
 
BADCamp 2012 -Beginner Best Practices
BADCamp 2012 -Beginner Best PracticesBADCamp 2012 -Beginner Best Practices
BADCamp 2012 -Beginner Best Practices
 
Surviving a Hackathon and Beyond
Surviving a Hackathon and BeyondSurviving a Hackathon and Beyond
Surviving a Hackathon and Beyond
 
Solid principles
Solid principlesSolid principles
Solid principles
 
Architecting a Large Software Project - Lessons Learned
Architecting a Large Software Project - Lessons LearnedArchitecting a Large Software Project - Lessons Learned
Architecting a Large Software Project - Lessons Learned
 

Recently uploaded

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 

Recently uploaded (20)

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 

Seven Habits Of Highly Effective Asp Net Mvc D

  • 1. Seven Habits of Highly Effective ASP.NET MVC Developers presented by curtis mitchell
  • 4. What are habits ? “Excellence is an art won by training and habituation. We do not act rightly because we have virtue or excellence, but we rather have those because we have acted rightly. We are what we repeatedly do. Excellence, then, is not an act but a habit.”                    - Aristotle
  • 5. The 7 Habits 1. Be proactive 2. Begin with the end in mind 3. Put first things first 4. Think Win-Win 5. Seek first to understand, then to be understood 6. Synergize 7. Sharpen the saw
  • 6. Be Proactive Habit #1
  • 7. Habit 1: Be Proactive OH: A leader is a person that does work when there is work to be done
  • 8. Habit 1: Be Proactive Do some research Bing or Google "ASP.NET MVC Best Practices"
  • 9. Habit 1: Be Proactive Top Findings: 1. Use HTTP Accept Verbs on Action Methods 2. Rid Controllers of all dependencies 3. Use strong-typed views instead of the ViewData Dictionary with "Magic" string keys 4. Use an IoC container 5. Use view helper classes for conditional view logic
  • 10. Use Accept Verbs on Action Methods
  • 11. Rid Controllers of all dependencies
  • 12. Rid Controllers of all dependencies
  • 13. Use strong-typed views instead of "Magic" string keys versus
  • 14. Use an IoC container Example uses Ninject v1.0
  • 15. Use view helper classes for conditional view logic
  • 16. Habit 1: Be Proactive Resources used in previous slide: http://weblogs.asp.net/rashid http://codeclimber.net.nz/
  • 17. Habit 1: Be Proactive Resources used in previous slide: http://weblogs.asp.net/rashid http://codeclimber.net.nz/ And, my own experiences
  • 18. Habit 1: Be Proactive Read up on ASP.NET MVC best practices Subscribe to feeds As you write apps, develop your own best practices Share your experiences with the world
  • 19. Begin with the end in mind Habit #2
  • 20. Habit 2: Begin with the end in mind Organize your MVC project for maintenance and deployment
  • 21. Habit 2: Begin with the end in mind Organize your MVC project for maintenance and deployment Project Root (Solution Folder) Lib - to hold dependencies MVC Project Unit Tests folder - to hold Unit Test projects Other auxiliary folders...
  • 22. Put First Things First Habit #3
  • 23. Habit 3 - Put First Things First Question: Do you know what your database will look like in three months?
  • 24. Habit 3 - Put First Things First Question: Do you know what changes your PM will be stressing you out to deliver next month?
  • 25. Habit 3 - Put First Things First Make your database schema migration strategy a priority
  • 26. Habit 3 - Put First Things First Make your database schema migration strategy a priority Explore alternative storage methods Object DBs like db4o Schema-less storage like MongoDB For RDBMS, plan to alter your schema as your application changes Use a tool like Migrator.Net (my suggestion) Use another method like managed SQL scripts
  • 27. Habit 3 - Put First Things First
  • 28. Think Win-Win Habit #4
  • 29. Habit 4 - Think Win-Win Develop with two audiences in mind: end users and developers. Then, create wins for each of them.
  • 30. Habit 4 - Think Win-Win Typical end user wants: 1. Intuitive interface, not necessarily beautiful
  • 31. Habit 4 - Think Win-Win Typical end user wants: 1. Intuitive interface, not necessarily beautiful
  • 32. Habit 4 - Think Win-Win Typical end user wants: 1. Intuitive interface, not necessarily beautiful 2. A responsive application rather than a fast application
  • 33. Habit 4 - Think Win-Win Typical end user wants: 1. Intuitive interface, not necessarily beautiful 2. A responsive application rather than a fast application How to give them what they want: 1. Add Javascript, CSS, and HTML to your toolbox
  • 34. Habit 4 - Think Win-Win Javascript Frameworks CSS Frameworks JQuery Blueprint CSS MooTools 960 Grid Prototype YUI Grid Scriptaculous Dojo
  • 35. Habit 4 - Think Win-Win Typical developer wants: 1. Latest and greatest emerging technology 2. Clean code, not perfect code - an opportunity to contribute/refactor
  • 36. Habit 4 - Think Win-Win "In everything...uniformity is undesirable. Leaving something incomplete makes it interesting, and gives one the feeling that there is room for growth... Even when building the imperial palace, they always leave one place unfinished." - Japanese Essays to Idleness 14th Century (via Marcus du Sautoy on TED.com)
  • 37. Habit 4 - Think Win-Win Typical developer wants: 1. Latest and greatest emerging technology 2. Clean code, not perfect code - an opportunity to contribute/refactor How to give them what they want: 1. See Habit #1 (Be Proactive) 2. Write SOLID code
  • 38. Habit 4 - Think Win-Win Single Responsibility Principle a class should have only one reason to change Open/Closed Principle a class should be open to extension, but closed to modification Liskov's Substitution Principle using a derived class in place of a base class should offer no surprises Interface Segregation Principle use fine-grained interfaces specific to the client Dependency of Inversion Principle depend on abstract objects instead of concrete objects
  • 39. Habit 4 - Think Win-Win SOLID code == Testable code
  • 40. Seek first to understand, and then to be understood Habit #5
  • 41. Habit 5 - Seek first to understand, and then to be understood I'm listening...
  • 42. Habit 5 - Seek first to understand, and then to be understood "How do I use the gridview control or the [some other ASP.NET 2.0 user control] in my view pages if I don't use code-behind classes or viewstate" - An ASP.NET developer transitioning from ASP.NET to MVC
  • 43. Habit 5 - Seek first to understand, and then to be understood "How do I use the gridview control or the [some other ASP.NET 2.0 user control] in my view pages if I don't use code-behind classes or viewstate" - An ASP.NET developer transitioning from ASP.NET to MVC "You don't" - Me
  • 44. Habit 5 - Seek first to understand, and then to be understood "How do I use the gridview control or the [some other ASP.NET 2.0 user control] in my view pages if I don't use code-behind classes or viewstate" - An ASP.NET developer transitioning from ASP.NET to MVC "You don't" - Me "Then, how do I implement some kind of view component that can be reused across my application for consistency and maintainability?" - AADTFATM
  • 45. Habit 5 - Seek first to understand, and then to be understood "How do I use the gridview control or the [some other ASP.NET 2.0 user control] in my view pages if I don't use code-behind classes or viewstate" - An ASP.NET developer transitioning from ASP.NET to MVC "You don't" - Me "Then, how do I implement some kind of view component that can be reused across my application for consistency and maintainability?" - AADTFATM "Ah, I understand your concerns. And, I have an answer for you" - Me
  • 46. Habit 5 - Seek first to understand, and then to be understood Html Helpers When elements of the view contain conditional logic Partial views For common view elements that can be reused arbitrarily Spark View Engine In case you can't shake the urge to use code-behind classes in your Webforms or you just want to use an awesomer view engine
  • 48. Habit 6 - Synergize Take separate parts and make them work together in a way that the whole is greater than the sum of the individual parts
  • 49. Habit 6 - Synergize Take separate parts and make them work together in a way that the whole is greater than the sum of the individual parts How? Separate your concerns Controllers should ask views to display data, not tell them how View-Models are not domain-models DRY (Don't Repeat Yourself) Make it so components will need each other in order to do more Once your components are independent, make them interdependent
  • 50. Sharpen the Saw Habit #7
  • 51. Habit 7 - Sharpen the Saw "There is no substitute for experience" - Proverb
  • 52. Habit 7 - Sharpen the Saw "There is no substitute for experience" - Proverb Some Resources: http://weblogs.asp.net/rashid http://codeclimber.net.nz/ http://www.dimecasts.net http://www.tekpub.com/ http://haacked.com/ http://blog.wekeroad.com http://weblogs.asp.net/scottgu/