Building an End-to-End HTML5 App with ASP.NET MVC, EF and jQuery Dan Wahlin.

Slides:



Advertisements
Similar presentations
.NET 3.5 SP1 New features Enhancements Visual Studio 2008 SP1 New features Enhancements Additional features/enhancements.
Advertisements

Introduction to HTML5 Programming donghao. HTML5 is the New HTML Standard New Elements, Attributes. Full CSS3 Support Video and Audio 2D/3D Graphics Local.
Philly.NET Hands-On MVC Razor, HTML5, CSS3 Rob Keiser, Bill Wolff.
Integrating Silverlight with ASP.NET AJAX and Web Services Dan Wahlin Interface Technical Training
IS 360 Course Introduction. Slide 2 What you will Learn (1) The role of Web servers and clients How to create HTML, XHTML, and HTML 5 pages suitable for.
Agenda What is BIRT? BIRT Features and Report Gallery Scripting BIRT
V1.00 © 2009 Research In Motion Limited Introduction to Mobile Device Web Development Trainer name Date.
06 | Implementing Web APIs Jon Galloway | Tech Evangelist Christopher Harrison | Head Geek.
User Group 2015 Version 5 Features & Infrastructure Enhancements.
XML on the Web: is it still relevant? O'Neil D. Delpratt.
Using jQuery Templates with ASP.NET Stephen Walther Superexpert.com
Kay Herzam Herzam IT Consulting What‘s new in ASP.NET MS TechTalk.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
Computer Concepts 2014 Chapter 7 The Web and .
ITP 104.  How the web as a medium is perceived and used, and how that evolution of the web has affected and changed us  What do you do on the Web? 
NextGen Technology upgrade – Synerizip - Sandeep Kamble.
Lightning Talk Fred Rodriguez Nguyen Do CPSC 473 May 6, 2012.
Joel Bapaga on Web Design Strategies Technologies Commercial Value.
Getting Started with the ASP.NET Web API Dhananjay Kumar Infragistics Consultant Microsoft MVP
AJAX and Atlas in ASP.NET 2.0 William J. Steele MSDN Developer Evangelist Microsoft Corporation
An Introduction To Building An Open Standard Web Map Application Joe Daigneau Pennsylvania State University.
ASP.NET Web API. ASP.NET Members MS Open Source ASP.NET MVC 4, ASP.NET Web API and ASP.NET Web Pages v2 (Razor) now all open source ASP.NET MVC 4, ASP.NET.
The Web Architecture and ASP.NET. Slide 2 Review of the Web (1) It began with HTTP and HTML, which delivers static Web pages to browsers which would render.
Microsoft SharePoint Server 2010 for the Microsoft ASP.NET Developer Yaroslav Pentsarskyy
Enabling High-Quality Printing in Web Applications
Cross Site Integration “mashups” cross site scripting.
StockWatch Developers: Nimrod Hagay Hagai Barkan Supervisors: Assaf Solomovitch Viktor Kulikov June 2009.
JavaScript Framework for Rich Apps in Every Browser Maura Wilder Joan Wortman
Congratulations! You are part of a global community of thousands of web developers who attend Web Camps to keep their web development skills up-to-date.
Web Applications BIS4430 – unit 8. Learning Objectives Explain the uses of web application frameworks Relate the client-side, server-side architecture.
WEBMATRIX Microsoft Pranav Rastogi.
Lap Around Visual Studio 2008 &.NET 3.5 Enhancements.
CS 494 Web Development Class Size: Winter, 214: 97 Spring, 214: 81 Summer, 2014: 69.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Telerik Software Academy ASP.NET Web Forms Telerik Software Academy ASP.NET Web Forms.
Creating User Interfaces Recap HTML/HTML5 JavaScript features Homework: keep working on user observation studies. Review JavaScript.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 14 Database Connectivity and Web Technologies.
The Web Developer’s Toolbox Steve Fabian e:
ASP.Net MVC Extensibility, scalability and testability Andrew Locatelli Woodcock.
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
1 What is JQuery. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax* interactions.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
CMS 2: Advanced Web Editing - Content Presented By: Katie Pagano, Special Projects Manager Steve Pont, Product Architect.
Working with Data Model Binders, Display Templates, Editor Templates, Validation… SoftUni Team Technical Trainers Software University
ASP.NET MVC An Introduction. What is MVC The Model-View-Controller (MVC) is an architectural pattern separates an application into three main components:
05 | Integrating JavaScript and MVC 4 Jon Galloway | Tech Evangelist Christopher Harrison | Head Geek.
(1) HTML5, CSS, Twitter Bootstrap. (2) HTML5 Will be the new standard New features Drag and Drop and Support for local storage,,,, New input types Removed.
Virtual techdays INDIA │ 9-11 February 2011 SESSION TITLE Kamala Rajan S │ Technical Manager, Marlabs.
Overview Web Technologies Computing Science Thompson Rivers University.
Leveraging Web Content Management in SharePoint 2013 Christina Wheeler.
The New Face of ASP.NET ASP.NET MVC, Razor, and jQuery Ido Flatow | Senior Architect | Sela | This session is.
丁建文 國立高雄應用科大資管系副教授 兼任計網中心軟體發展組組長 跨平台行動應用軟體開發技術 : HTML5 & Mobile JavaScript Framework 暨南大學.
CSCI 3100 Tutorial 5 JavaScript & Ajax Jichuan Zeng Department of Computer Science and Engineering The Chinese University of Hong.
I18n - DateTime ASP.NET MVC. I18n DateTime – EF changes  In model classes, use attributes  DataType(DataType.DateTime)  DataType(DataType.Date)  DataType(DataType.Time)
Kendo UI ASP.NET MVC Wrappers
Develop a Quick and Dirty Web interface to your database:
Web API - Introduction AJAX, Spring Data REST SoftUni Team Web API
Kendo UI ASP.NET MVC Wrappers
ASP.NET Core Tag Helpers
Application with Cross-Platform GUI
KnockoutJS -Pradeep Shet 31st August 2014.
End to end app development ASP.NET, WCF, WF, EF, & RIA Services
Environmental Sensing Monitoring and Analyzing Water Temperatures
IS 360 Course Introduction
Secure Web Programming
MIS Professor Sandvig MIS 324 Professor Sandvig
ASP.NET MVC Web Development
Creating User Interfaces
MIS Professor Sandvig MIS 424 Professor Sandvig
#01# ASP.NET Core Overview Design by: TEDU Trainer: Bach Ngoc Toan
Presentation transcript:

Building an End-to-End HTML5 App with ASP.NET MVC, EF and jQuery Dan Wahlin

Blog

Agenda The Account at a Glance Application Project Structure Data Retrieval Serving Up JSON Data Processing Data Canvas, SVG, and Video

The Account at a Glance Application

Quick Glance View

Key Application Features Multiple data views Drag and drop tiles Context-aware tiles AJAX-enabled

Application Technologies Client-Side Technologies HTML5 Modernizr Handlebars HTML5 Boilerplate jQuery Canvas SVG CSS3 JavaScript Patterns Server-Side Technologies JSON and Ajax ASP.NET MVC ASP.NET Web API Entity Framework Code First Repository Pattern C# Unity IoC Container SQL Server Nuget

Agenda The Account at a Glance Application Project Structure Data Retrieval Serving Up JSON Data Rendering Data on the Client Canvas, SVG, and Video

Web Project Structure Server-side and Client-side

Model/Repository Project Structure Data Repository Classes Model Classes

Agenda The Account at a Glance Application Project Structure Data Retrieval Serving Up JSON Data Rendering Data on the Client Canvas, SVG, and Video

Data Retrieval Financial data retrieved from Google REST service Data processed and stored in SQL Server Data operations performed using EF Code First –Model classes used to hold account and financial data –Repository pattern used for data retrieval classes

Data Patterns are Key!

Model Classes  Plain Old CLR Objects (POCOs) used to hold data: public class Stock : Security { public decimal DayHigh { get; set; } public decimal DayLow { get; set; } public decimal Dividend { get; set; } public decimal Open { get; set; } public decimal Volume { get; set; } //Code removed for brevity }

Repository Pattern  Repository classes created to handle CRUD operations: public class SecurityRepository : RepositoryBase, ISecurityRepository { public Security GetSecurity(string symbol) {...} public List GetSecurityTickerQuotes() {...} public OperationStatus UpdateSecurities() {...} public OperationStatus InsertSecurityData() {...} }

Repository Class Example public class AccountRepository : RepositoryBase, IAccountRepository { public Customer GetCustomer(string custId) { using (var context = DataContext) { return context.Customers.Include("BrokerageAccounts").Where(c => c.CustomerCode == custId).SingleOrDefault(); }

Agenda The Account at a Glance Application Project Structure Data Retrieval Serving Up JSON Data Rendering Data on the Client Canvas, SVG, and Video

Serving Up JSON Data Data served to client using ASP.NET Web API Web API actions call repository objects Model objects converted to JSON and returned to client

How is ASP.NET Web API Used? ASP.NET MVC ASP.NET Web API SQL Server Entity Framework HTML (Razor) JSON

JSON Action Example public class DataServiceController : ApiController { [HttpGet] public BrokerageAccount Account(string acctNumber) { } [HttpGet] public Security Quote(string symbol) { } [HttpGet] public MarketQuotes MarketIndices() { } [HttpGet] public MarketsAndNews TickerQuotes() { } }

Agenda The Account at a Glance Application Project Structure Data Retrieval Serving Up JSON Data Rendering Data on the Client Canvas, SVG, and Video

JavaScript Patterns are Key!

Client-Side Scripts Script Purpose scene.layoutservice.js Defines tile "scenes" scene.statemanager.js Creates tiles dynamically at runtime scene.dataservice.js Handles performing AJAX calls to the server scene.tile.binder.js Handles converting JSON data into HTML for each tile’s size (small, medium and large) scene.tile.renderer.js Renders different tile sizes based on position scene.tile.formatter.js Custom formatting functionality for tiles

Account at a Glance Templates Application templates are stored on the server in the Templates folder Templates are downloaded dynamically to the client by scene.tile.binder.js Handlebars.js used to convert JSON to HTML

Tile Template Example ACCOUNT TOTAL {{Total}}

Converting JSON to HTML tmpl = function (tileName, data) { var templateHtml = $('#' + tileName).html(); if (data != null) { var compiledTemplate = Handlebars.compile(templateHtml); return compiledTemplate(data); } else { return templateHtml; }

Agenda The Account at a Glance Application Project Structure Data Retrieval Serving Up JSON Data Rendering Data on the Client Canvas, SVG, and Video

HTML5 Canvas HTML5 canvas provides a way to render pixels using JavaScript functions Plugins can simplify working with the canvas: –EaselJS –Fabric –Flot –Gury –JCanvaScript

Canvas in Account at a Glance  Account at a Glance uses Flot to render stock quote graphs using the canvas: $.plot(canvasDiv, [{ color: color, shadowSize: 4, label: 'Simulated Data', data: quoteData }], chartOptions);

Scalable Vector Graphics  SVG provides a way to render vector graphics using script or elements  Application uses the Raphael SVG plugin: raphael('AccountPositionsSVG', 500, 420).pieChart(scene.width / 2, scene.height / , 66, values, labels, "#fff");

Displaying Video

Multiple Video Sources  Video element supports multiple sources  Free conversion tool:

Summary Account at a Glance demonstrates integrating several HTML5 technologies Plugins used to convert JSON to HTML, generate canvas charts, SVG, and more Lessons learned: –Pick a pattern for structuring JavaScript code to keep it organized! –Leverage plugins for productivity – but test, test, test!

Thank weblogs.asp.net/dwahlin Code:

This presentation is based on an online training course available at