+ All Categories
Home > Documents > Real Life ASP.MVC

Real Life ASP.MVC

Date post: 01-Jan-2016
Category:
Upload: vincent-mckenzie
View: 33 times
Download: 1 times
Share this document with a friend
Description:
KEA September 22 2011. Real Life ASP.MVC. Christian Dalager, Eksponent ApS. Me. .NET developer, Eksponent ApS Lead on Arena365.com C#, Ruby, Java, PHP, Perl Background in Nordic Language and Literature + IT University. ASP.NET MVC. MVC a what??. Model View Controller design pattern - PowerPoint PPT Presentation
35
Real Life ASP.MVC KEA September 22 2011 Christian Dalager, Eksponent A
Transcript

Real Life ASP.MVCKEA September 22 2011

Christian Dalager, Eksponent ApS

Me.NET developer, Eksponent ApS

Lead on Arena365.com

C#, Ruby, Java, PHP, Perl

Background in Nordic Language and Literature + IT University

ASP.NET MVC

MVC a what??Model View Controller design pattern

Separates data, presentation og logic

MVC partsView• Webforms view engine <%= ”yay” %>• Alternatives: Razor (MVC3), Spark,Nhaml

Controller• Core framework• public class MyController: BaseController{}

Model• ... nothing...

The Missing MNo builtin database/persistence features

Lots of options• Entity Framework / linq2sql• NHibernate / Castle ActiveRecord• Subsonic• External services (WCF i.e)• Home made DataAccessLayer with SQL

statements (sooo 2003)

Arena365Case

Arena365.comSocial tool for active lifestyle, for groups and individuals

Track your training, manage your teams

Google maps / Routes

Facebook Integration

Campaigns

7.500 users

Arena365 DEMO

Arena365

NHibernateDatabase

Repository

Service

Controllers

Console App

Windows service

Repository

Repository Repository

Service

Views

iCal

XML CSVJSON

Service

Facebook, RSS, Maps, Twitter, GetSatisfaction,

MailChimp.

CMS

Cache

ViewModels

Building blocksDI Containers

Logging

Caching

Error reporting

Mail sending

Facebook integration

iCal feeds

Import routes

Import RSS

CMS functionality

Security/ACL

Build scripts

UnitTests

Source Control

Show me the code!# lines of C# code (LOC) 17 157

# lines of comment 4 010

Percentage Comment 18%

# Assemblies 11

# Namespaces 112

# Types 1 185

# Methods 7 658

# Fields 3 284

Complex Systems are.. complex

Requirements change over time

Build for change

YAGNI (you aint gonna need it)

Pragmatism vs Idealism

Arkitektur

http://www.iwaysoftware.com/solutions/by_integration/DataIntegrationSolutions.html

Hands-on AgendaSkinny controllers

ViewModels

Dependency Injection

AutoMapper

ModelBinders

ASP.NET MVC

Model

View

Controller

Architecture i MVC

ASP.NET MVC

ViewModel

View

Controller

Data /Business logic

Domain model

DB

Architecture in MVC

ViewModelsFlattened classes

Tailor made for views

Projections

/product/list

/product/show/3

/product/edit/3

Skinny ControllersKeep your methods small

Keep your dependency count down

Keep your controllers skinny

Benefits• Reusability• Testability• The essentials may always fit your screen

TIME TO DO THE CODES

Dependency Injection

AutoMapper

ModelBinders

Arkitektur

Solution-layout

Ask QuestionsHow big is this beast gonna get?!

How many entities do you have?

How many controllers will you need?

How long do you expect your app to live?

Are there many stakeholders that together define the project scope?

Will the project change directions before it’s done? (Funding will do this to you)

Is the project an exploratory journey or do you know exactly where you will end?

How many integrationpoints do you have?

Thank you. I love you <3

[email protected]

Blogdalager.com

Tweetstwitter.com/dalager

Source Code / Presentationbitbucket.org/dalager/

Job?job.eksponent.com/


Recommended