SlideShare uma empresa Scribd logo
1 de 32
A mudança chegou. Por que?
2002
 600 milhões de usuários
 9,1% da população mundial online
 Tempo de uso médio: 46 minutos
 3 milhões de sites
 2 browsers
 Page load: 16 segundos
3
~2000 Hoje
Consumo
de serviços
Vários pequenos
servidores
Atualização
rápida
Monolítica
Servidores
robustos
Mudanças
lentas
A mudança chegou. Por que?
2016
 3.5 bilhões de usuários
 40% da população mundial online
 Tempo de uso médio: 4 horas
 555 milhões de sites
 5 browsers
 Page load: 6 segundos
5
Máquinas virtuais
Servidor de apliação
Nuvem pública
Disaster Recovery
Máquina de desenvolvimento
Cluster
Data Center
Páginas
estáticas
Web Front EndAlgoritmos de
background
BD do usuário BD de
analytics
Filas API’s
Dev Teste Produção Escalar
Desktop &
ASP.NET.NET Windows StoreBrowsers &
Win Phone
ASP.NET 5 Core 1.0
Framework
Silverlight
.NET Core Multi-
Framework
Windows
Mobile
Compact
Framework
.NET Framework 4.6 .NET Core 5 1.0
Implementação full do framework para
Windows.
Implementação cross-plataform para atender o
universo open souce.
Next gen JIT (RyuJIT)
SIMD
Componentes
Runtime
Compiladores
Inovação das linguagens
Roslyn
Libs .NET Core 5
Libs .NET Framework 4.6
Pacotes NuGet
.NET Framework 4.6 .NET Core 5 1.0
.NET Framework 4.6 .NET Core 5 1.0
Next gen JIT (RyuJIT)
SIMD
Runtime
Components Compilers
Languages innovation
.NET Compiler Platform
.NET Core 5 Libraries
.NET Framework 4.6 Libraries
NuGet packages
Next gen JIT (RyuJIT)
SIMD
Componentes
Runtime
Compiladores
Inovação das linguagens
Roslyn
Libs .NET Core 5
Libs .NET Framework 4.6
Pacotes NuGet
Next gen JIT (RyuJIT)
SIMD
Componentes
Runtime Compiladores
Languages innovation
.NET Compiler Platform
.NET Core 5 Libraries
.NET Framework 4.6 Libraries
Pacotes NuGet
.NET Framework 4.6 .NET Core 5
Next gen JIT (RyuJIT)
SIMD
Componentes
Runtime
Compiladores
Inovação das linguagens
Roslyn
Libs .NET Core 5
Libs .NET Framework 4.6
Pacotes NuGet
ASP.NET
5
ASP.NET
4.6
OpenSource
Operating System
Runtime Loader
Runtime
Platform Libraries
Application Host
Web Server
Application
Frameworks
Libraries
Application
Windows
IIS: WebEngine4.dll
Exe: OS
.NET CLR
.NET BCL & FCL
System.Web
IIS
FCL, GAC, NuGet
Loose, GAC, NuGet
MSBuild -> csc.exe
CodeDOM -> csc.exe
Windows, OSX, Linux
DNX
.NET CLR
.NET Core CLR
.NET BCL & FCL
.NET on NuGet
DNX
IIS, HTTP.SYS
Kestrel
NuGet
NuGet
DNX (Roslyn)
;-)
Um tour pelo ASP.NET 5
ASP.NET Core 1.0
Escolha sua IDE preferida
Open Source de
verdade Cross-PlatformOSS
Transição entre ambientes
simplificada
Ciclo de dev rápidoTotalmente modular
Rápido
 System.Web.dll free
 .NET Native possível
 .NET Full ou .NET Core
 Compilação on the fly (Roslyn)
 Otimização da CLR (DNX)
 Dev multiplataforma
 Deploy no IIS ou via Self-host
 Linux e Mac: execução em
Mono
 Injeção de dependência nativa
(MVC 6)
 Componentes entregues como
middlewares
 Pronto pra nuvem
 Código aberto e disponível no
GitHub
 Implementa o modelo OWIN
 Projetado para containers
DEMO 1
Entendendo a estrutura
Trata-se da especificação do modelo de
execução do novo ASP.NET. Ele
determina todas as diretrizes do
servidor web. Podemos dizer que
OWIN está para o servidor web como
o HTML está para o navegador.
OWIN host versus Host tradicional
Internet Information Server (IIS) ASP.NET
(Webforms, MVC, WebPages, SPA, etc.)
Host
IIS, OwinHost, CustomHost
ASP.NET 5
ASP.NET Core 1.0
COMPONENTS
OWIN (interface)
Enviroment Dictionary
IDictionary<string, object>
Application Delegate
Func< IDictionary<string, object>, Task>
Implementação do modelo OWIN
feita pela Microsoft para rodar
aplicações ASP.NET.
Outras implementações também encontram-se disponíveis:
Helios, Nowin, dentre outros.
Katana (vNext) - Arquitetura
Host
Processa e gerencia o workflow e os processos
IIS – Custom Host – OWIN Host
Server
Abre uma porta TCP, escuta os requests e dispara no OWIN pipeline
SystemWeb – HttpListener - WebListener
Middleware
Componente que implementa OWIN (delegate) que opera
dentro do pipeline. SignalR, Web API.
Application A aplicação em si, que implementa os componentes (middlewares).
Katana (vNext) - ArquiteturaNavegador
Host
Server
Pipeline da aplicação
Middleware Middleware Middleware
 ASP.NET no OSX e Linux
 Tag Helpers
 View Components
 Suporte para GruntJS, NPM e
Bower
 MVC e WebAPI com controllers
unificados
 AngularJS
 ASP.NET Dependency Injection
Framework
 xUnit.net
DEMO 2
Algo mais elaborado…
Runtime Performance
Footprint
Modular
Infraestrutura
Cloud-Ready
Suporte para Containers
ASP.NET 5
ASP.NET 5 Core 1.0 @ Github
Roslyn + .NET 2015
Unleash .NET 2015 in your apps
Giovanni Bassi
http://docs.asp.net
learn & contribute!
Q & A
Session Evaluations
Sign in to the Schedule Builder and
select ‘My Evaluations’ to complete
your Session Evaluations after each
session.
http://aka.ms/cloud.saopaulo

Mais conteúdo relacionado

Mais procurados

Faça Sucesso Desenvolvendo com ASP.NET 4, ASP NET MVC e Visual Studio 2010
Faça Sucesso Desenvolvendo com ASP.NET 4, ASP NET MVC e Visual Studio 2010Faça Sucesso Desenvolvendo com ASP.NET 4, ASP NET MVC e Visual Studio 2010
Faça Sucesso Desenvolvendo com ASP.NET 4, ASP NET MVC e Visual Studio 2010
Rodrigo Kono
 

Mais procurados (20)

Faça Sucesso Desenvolvendo com ASP.NET 4, ASP NET MVC e Visual Studio 2010
Faça Sucesso Desenvolvendo com ASP.NET 4, ASP NET MVC e Visual Studio 2010Faça Sucesso Desenvolvendo com ASP.NET 4, ASP NET MVC e Visual Studio 2010
Faça Sucesso Desenvolvendo com ASP.NET 4, ASP NET MVC e Visual Studio 2010
 
Futuro do ASP.NET vNext - MVP ShowCast
Futuro do ASP.NET vNext - MVP ShowCast Futuro do ASP.NET vNext - MVP ShowCast
Futuro do ASP.NET vNext - MVP ShowCast
 
O Futuro do ASP.NET
O Futuro do ASP.NETO Futuro do ASP.NET
O Futuro do ASP.NET
 
Escalabilidade com docker - ASP.NET Conference 2016
Escalabilidade com docker - ASP.NET Conference 2016Escalabilidade com docker - ASP.NET Conference 2016
Escalabilidade com docker - ASP.NET Conference 2016
 
.NET Core Internals. O que é o .NET Platform Standard?
.NET Core Internals. O que é o .NET Platform Standard?.NET Core Internals. O que é o .NET Platform Standard?
.NET Core Internals. O que é o .NET Platform Standard?
 
ASP.NET MVC, para sua vida melhorar
ASP.NET MVC, para sua vida melhorarASP.NET MVC, para sua vida melhorar
ASP.NET MVC, para sua vida melhorar
 
Começando com meteor
Começando com meteorComeçando com meteor
Começando com meteor
 
Desenvolvimento para web com Meteor
Desenvolvimento para web com MeteorDesenvolvimento para web com Meteor
Desenvolvimento para web com Meteor
 
Meteor - TechParty 2015
Meteor - TechParty 2015Meteor - TechParty 2015
Meteor - TechParty 2015
 
ASP.NET MVC
ASP.NET MVCASP.NET MVC
ASP.NET MVC
 
Desvendando ASP.NET MVC
Desvendando ASP.NET MVCDesvendando ASP.NET MVC
Desvendando ASP.NET MVC
 
Implementando APIs multiplataforma com ASP.NET Core 2.0 - Nerdzão Day #3 - No...
Implementando APIs multiplataforma com ASP.NET Core 2.0 - Nerdzão Day #3 - No...Implementando APIs multiplataforma com ASP.NET Core 2.0 - Nerdzão Day #3 - No...
Implementando APIs multiplataforma com ASP.NET Core 2.0 - Nerdzão Day #3 - No...
 
Asp.net web api
Asp.net web apiAsp.net web api
Asp.net web api
 
Intodução ao React
Intodução ao ReactIntodução ao React
Intodução ao React
 
Implementando APIs seguras na nuvem - Outubro-2018 - Azure Brasil
Implementando APIs seguras na nuvem - Outubro-2018 - Azure BrasilImplementando APIs seguras na nuvem - Outubro-2018 - Azure Brasil
Implementando APIs seguras na nuvem - Outubro-2018 - Azure Brasil
 
TDC2016SP - Trilha Frameworks JavaScript
TDC2016SP - Trilha Frameworks JavaScriptTDC2016SP - Trilha Frameworks JavaScript
TDC2016SP - Trilha Frameworks JavaScript
 
ASP.NET Web API no Windows Azure
ASP.NET Web API no Windows AzureASP.NET Web API no Windows Azure
ASP.NET Web API no Windows Azure
 
Soluções escaláveis com Microsoft Orleans
Soluções escaláveis com Microsoft OrleansSoluções escaláveis com Microsoft Orleans
Soluções escaláveis com Microsoft Orleans
 
Novidades do ASP.NET MVC 4
Novidades do ASP.NET MVC 4Novidades do ASP.NET MVC 4
Novidades do ASP.NET MVC 4
 
Trabalhando com WebHooks no ASP.NET
Trabalhando com WebHooks no ASP.NETTrabalhando com WebHooks no ASP.NET
Trabalhando com WebHooks no ASP.NET
 

Semelhante a Construindo aplicações leves e performáticas com ASP.NET Core 1.0

TDC SP 2015 - Criando aplicações ASP.NET no Mac
TDC SP 2015 - Criando aplicações ASP.NET no MacTDC SP 2015 - Criando aplicações ASP.NET no Mac
TDC SP 2015 - Criando aplicações ASP.NET no Mac
Andre Baltieri
 
Palestra Plataforma .NET na ETEC Marília
Palestra Plataforma .NET na ETEC MaríliaPalestra Plataforma .NET na ETEC Marília
Palestra Plataforma .NET na ETEC Marília
Elvis Fusco
 

Semelhante a Construindo aplicações leves e performáticas com ASP.NET Core 1.0 (20)

.NET 2015, ASP.NET 5, C# 6 e tudo mais
.NET 2015, ASP.NET 5, C# 6 e tudo mais.NET 2015, ASP.NET 5, C# 6 e tudo mais
.NET 2015, ASP.NET 5, C# 6 e tudo mais
 
TDC 2016 POA: O novo ASP.NET Core 1.0 multiplataforma
TDC 2016 POA: O novo ASP.NET Core 1.0 multiplataformaTDC 2016 POA: O novo ASP.NET Core 1.0 multiplataforma
TDC 2016 POA: O novo ASP.NET Core 1.0 multiplataforma
 
TDC2016POA | Trilha .NET - O novo ASP.NET Core 1.0 multiplataforma
TDC2016POA | Trilha .NET - O novo ASP.NET Core 1.0 multiplataformaTDC2016POA | Trilha .NET - O novo ASP.NET Core 1.0 multiplataforma
TDC2016POA | Trilha .NET - O novo ASP.NET Core 1.0 multiplataforma
 
ASP.NET vNext no .NET Architects Days 2014
ASP.NET vNext no .NET Architects Days 2014ASP.NET vNext no .NET Architects Days 2014
ASP.NET vNext no .NET Architects Days 2014
 
O Futuro do ASP.NET (vNext)
O Futuro do ASP.NET (vNext)O Futuro do ASP.NET (vNext)
O Futuro do ASP.NET (vNext)
 
Cebraspe 2016: .NET Core e ASP.NET Core
Cebraspe 2016: .NET Core e ASP.NET CoreCebraspe 2016: .NET Core e ASP.NET Core
Cebraspe 2016: .NET Core e ASP.NET Core
 
TDC SP 2015 - Criando aplicações ASP.NET no Mac
TDC SP 2015 - Criando aplicações ASP.NET no MacTDC SP 2015 - Criando aplicações ASP.NET no Mac
TDC SP 2015 - Criando aplicações ASP.NET no Mac
 
Palestra Plataforma .NET na ETEC Marília
Palestra Plataforma .NET na ETEC MaríliaPalestra Plataforma .NET na ETEC Marília
Palestra Plataforma .NET na ETEC Marília
 
dotnetConf 2016 Goiânia: .NET Core | ASP.NET Core
dotnetConf 2016 Goiânia: .NET Core | ASP.NET CoredotnetConf 2016 Goiânia: .NET Core | ASP.NET Core
dotnetConf 2016 Goiânia: .NET Core | ASP.NET Core
 
Asp.net core
Asp.net coreAsp.net core
Asp.net core
 
Asp.Net Core - Meetup BH
Asp.Net Core - Meetup BHAsp.Net Core - Meetup BH
Asp.Net Core - Meetup BH
 
Aula 1
Aula 1Aula 1
Aula 1
 
.NET Open Source 2009
.NET Open Source 2009.NET Open Source 2009
.NET Open Source 2009
 
01 - Introdução a programação para internet v1.1
01 - Introdução a programação para internet v1.101 - Introdução a programação para internet v1.1
01 - Introdução a programação para internet v1.1
 
.NET 6: O que há de novo e o que está por vir?
.NET 6: O que há de novo e o que está por vir?.NET 6: O que há de novo e o que está por vir?
.NET 6: O que há de novo e o que está por vir?
 
.NET 6: O que há de novo e o que está por vir?
.NET 6: O que há de novo e o que está por vir?.NET 6: O que há de novo e o que está por vir?
.NET 6: O que há de novo e o que está por vir?
 
Projetos Mono e Moonlight
Projetos Mono e MoonlightProjetos Mono e Moonlight
Projetos Mono e Moonlight
 
Palestra de Asp.Net 5 no TDC floripa e DotnetFloripa
Palestra de Asp.Net 5 no TDC floripa e DotnetFloripaPalestra de Asp.Net 5 no TDC floripa e DotnetFloripa
Palestra de Asp.Net 5 no TDC floripa e DotnetFloripa
 
Construindo aplicações robustas com a suíte de tecnologias gratuítas da Micro...
Construindo aplicações robustas com a suíte de tecnologias gratuítas da Micro...Construindo aplicações robustas com a suíte de tecnologias gratuítas da Micro...
Construindo aplicações robustas com a suíte de tecnologias gratuítas da Micro...
 
NodeJS - Tutorial de forma simples e pratica.
NodeJS - Tutorial de forma simples e pratica.NodeJS - Tutorial de forma simples e pratica.
NodeJS - Tutorial de forma simples e pratica.
 

Mais de Fabrício Lopes Sanchez

Mais de Fabrício Lopes Sanchez (19)

Azure Lab Services
Azure Lab ServicesAzure Lab Services
Azure Lab Services
 
Projetando aplicações para a nuvem
Projetando aplicações para a nuvemProjetando aplicações para a nuvem
Projetando aplicações para a nuvem
 
Microserviços na vida real
Microserviços na vida realMicroserviços na vida real
Microserviços na vida real
 
QCon 2016 - Como migramos uma solução de 4 milhões de usuários para o Azure
QCon 2016 - Como migramos uma solução de 4 milhões de usuários para o AzureQCon 2016 - Como migramos uma solução de 4 milhões de usuários para o Azure
QCon 2016 - Como migramos uma solução de 4 milhões de usuários para o Azure
 
Soluções de IoT no Microsoft Azure
Soluções de IoT no Microsoft AzureSoluções de IoT no Microsoft Azure
Soluções de IoT no Microsoft Azure
 
Por que Cloud Services é o melhor dos mundos?
Por que Cloud Services é o melhor dos mundos? Por que Cloud Services é o melhor dos mundos?
Por que Cloud Services é o melhor dos mundos?
 
A Nova Web
A Nova WebA Nova Web
A Nova Web
 
Windows Azure: computação em nuvem no melhor estilo self-service
Windows Azure: computação em nuvem no melhor estilo self-serviceWindows Azure: computação em nuvem no melhor estilo self-service
Windows Azure: computação em nuvem no melhor estilo self-service
 
SSI 2012 - Computação em Nuvem
SSI 2012 - Computação em NuvemSSI 2012 - Computação em Nuvem
SSI 2012 - Computação em Nuvem
 
Desenvolvimento de aplicações para Windows Azure
Desenvolvimento de aplicações para Windows AzureDesenvolvimento de aplicações para Windows Azure
Desenvolvimento de aplicações para Windows Azure
 
Web Dev Camp
Web Dev CampWeb Dev Camp
Web Dev Camp
 
Estrutura de Dados - Conceitos fundamentais
Estrutura de Dados - Conceitos fundamentaisEstrutura de Dados - Conceitos fundamentais
Estrutura de Dados - Conceitos fundamentais
 
Modelagem de dados
Modelagem de dadosModelagem de dados
Modelagem de dados
 
Interop Day 2011 - Construindo aplicações web com WebMatrix
Interop Day 2011 - Construindo aplicações web com WebMatrixInterop Day 2011 - Construindo aplicações web com WebMatrix
Interop Day 2011 - Construindo aplicações web com WebMatrix
 
QS24 - REST e SOAP com Razor e WebMatrix
QS24 - REST e SOAP com Razor e WebMatrixQS24 - REST e SOAP com Razor e WebMatrix
QS24 - REST e SOAP com Razor e WebMatrix
 
Conhecendo o NuGet e utilizando com ASP.NET MVC
Conhecendo o NuGet e utilizando com ASP.NET MVCConhecendo o NuGet e utilizando com ASP.NET MVC
Conhecendo o NuGet e utilizando com ASP.NET MVC
 
Web em grande estilo com CSS 3
Web em grande estilo com CSS 3Web em grande estilo com CSS 3
Web em grande estilo com CSS 3
 
Criando aplicações web com tecnologias Microsoft
Criando aplicações web com tecnologias MicrosoftCriando aplicações web com tecnologias Microsoft
Criando aplicações web com tecnologias Microsoft
 
Construindo aplicações web com WebMatrix e Razor
Construindo aplicações web com WebMatrix e RazorConstruindo aplicações web com WebMatrix e Razor
Construindo aplicações web com WebMatrix e Razor
 

Construindo aplicações leves e performáticas com ASP.NET Core 1.0

  • 1.
  • 2. A mudança chegou. Por que? 2002  600 milhões de usuários  9,1% da população mundial online  Tempo de uso médio: 46 minutos  3 milhões de sites  2 browsers  Page load: 16 segundos
  • 3. 3 ~2000 Hoje Consumo de serviços Vários pequenos servidores Atualização rápida Monolítica Servidores robustos Mudanças lentas
  • 4. A mudança chegou. Por que? 2016  3.5 bilhões de usuários  40% da população mundial online  Tempo de uso médio: 4 horas  555 milhões de sites  5 browsers  Page load: 6 segundos
  • 5. 5 Máquinas virtuais Servidor de apliação Nuvem pública Disaster Recovery Máquina de desenvolvimento Cluster Data Center Páginas estáticas Web Front EndAlgoritmos de background BD do usuário BD de analytics Filas API’s Dev Teste Produção Escalar
  • 6. Desktop & ASP.NET.NET Windows StoreBrowsers & Win Phone ASP.NET 5 Core 1.0 Framework Silverlight .NET Core Multi- Framework Windows Mobile Compact Framework
  • 7. .NET Framework 4.6 .NET Core 5 1.0 Implementação full do framework para Windows. Implementação cross-plataform para atender o universo open souce.
  • 8. Next gen JIT (RyuJIT) SIMD Componentes Runtime Compiladores Inovação das linguagens Roslyn Libs .NET Core 5 Libs .NET Framework 4.6 Pacotes NuGet .NET Framework 4.6 .NET Core 5 1.0
  • 9. .NET Framework 4.6 .NET Core 5 1.0 Next gen JIT (RyuJIT) SIMD Runtime Components Compilers Languages innovation .NET Compiler Platform .NET Core 5 Libraries .NET Framework 4.6 Libraries NuGet packages Next gen JIT (RyuJIT) SIMD Componentes Runtime Compiladores Inovação das linguagens Roslyn Libs .NET Core 5 Libs .NET Framework 4.6 Pacotes NuGet
  • 10. Next gen JIT (RyuJIT) SIMD Componentes Runtime Compiladores Languages innovation .NET Compiler Platform .NET Core 5 Libraries .NET Framework 4.6 Libraries Pacotes NuGet .NET Framework 4.6 .NET Core 5 Next gen JIT (RyuJIT) SIMD Componentes Runtime Compiladores Inovação das linguagens Roslyn Libs .NET Core 5 Libs .NET Framework 4.6 Pacotes NuGet
  • 11. ASP.NET 5 ASP.NET 4.6 OpenSource Operating System Runtime Loader Runtime Platform Libraries Application Host Web Server Application Frameworks Libraries Application Windows IIS: WebEngine4.dll Exe: OS .NET CLR .NET BCL & FCL System.Web IIS FCL, GAC, NuGet Loose, GAC, NuGet MSBuild -> csc.exe CodeDOM -> csc.exe Windows, OSX, Linux DNX .NET CLR .NET Core CLR .NET BCL & FCL .NET on NuGet DNX IIS, HTTP.SYS Kestrel NuGet NuGet DNX (Roslyn)
  • 12. ;-)
  • 13. Um tour pelo ASP.NET 5 ASP.NET Core 1.0
  • 14. Escolha sua IDE preferida Open Source de verdade Cross-PlatformOSS Transição entre ambientes simplificada Ciclo de dev rápidoTotalmente modular Rápido
  • 15.  System.Web.dll free  .NET Native possível  .NET Full ou .NET Core  Compilação on the fly (Roslyn)  Otimização da CLR (DNX)  Dev multiplataforma  Deploy no IIS ou via Self-host  Linux e Mac: execução em Mono  Injeção de dependência nativa (MVC 6)  Componentes entregues como middlewares  Pronto pra nuvem  Código aberto e disponível no GitHub  Implementa o modelo OWIN  Projetado para containers
  • 16.
  • 17. DEMO 1 Entendendo a estrutura
  • 18. Trata-se da especificação do modelo de execução do novo ASP.NET. Ele determina todas as diretrizes do servidor web. Podemos dizer que OWIN está para o servidor web como o HTML está para o navegador.
  • 19. OWIN host versus Host tradicional Internet Information Server (IIS) ASP.NET (Webforms, MVC, WebPages, SPA, etc.) Host IIS, OwinHost, CustomHost ASP.NET 5 ASP.NET Core 1.0 COMPONENTS OWIN (interface) Enviroment Dictionary IDictionary<string, object> Application Delegate Func< IDictionary<string, object>, Task>
  • 20. Implementação do modelo OWIN feita pela Microsoft para rodar aplicações ASP.NET. Outras implementações também encontram-se disponíveis: Helios, Nowin, dentre outros.
  • 21. Katana (vNext) - Arquitetura Host Processa e gerencia o workflow e os processos IIS – Custom Host – OWIN Host Server Abre uma porta TCP, escuta os requests e dispara no OWIN pipeline SystemWeb – HttpListener - WebListener Middleware Componente que implementa OWIN (delegate) que opera dentro do pipeline. SignalR, Web API. Application A aplicação em si, que implementa os componentes (middlewares).
  • 22. Katana (vNext) - ArquiteturaNavegador Host Server Pipeline da aplicação Middleware Middleware Middleware
  • 23.  ASP.NET no OSX e Linux  Tag Helpers  View Components  Suporte para GruntJS, NPM e Bower  MVC e WebAPI com controllers unificados  AngularJS  ASP.NET Dependency Injection Framework  xUnit.net
  • 24. DEMO 2 Algo mais elaborado…
  • 26.
  • 28. ASP.NET 5 ASP.NET 5 Core 1.0 @ Github
  • 29. Roslyn + .NET 2015 Unleash .NET 2015 in your apps Giovanni Bassi
  • 31. Q & A
  • 32. Session Evaluations Sign in to the Schedule Builder and select ‘My Evaluations’ to complete your Session Evaluations after each session. http://aka.ms/cloud.saopaulo

Notas do Editor

  1. Description. ASP.NET 5 is a lean and composable framework for building web and cloud applications. ASP.NET 5 is fully open source and available on GitHub. In this session we’ll put it all into context, answering questions such as what does that ASP.NET 5 mean for compatibility? What powerful new cloud scenarios does ASP.NET 5 enable? Etc. We’ll cover it all both inside and outside of Visual Studio, including support for Mac and Linux.
  2. 1. Última década: saimos de 600 milhões de usuários para 3.2 bilhões 2. Tinhamos 9.1% da população mundial conectada, hoje temos 40% 3. Em 2002 o tempo médio de uso da internet era de 46 minutos no dia, hoje é de 4 horas 4. Tinhamos cerca de 3 milhões de sites, hoje temos 555 milhões 5. Tinhamos 2 browsers principais. Hoje temos pelo menos 5 diferentes 6. Page load médio em 2002: 16 segundos. Hoje 6 segundos
  3. 1. Última década: saimos de 600 milhões de usuários para 3.2 bilhões 2. Tinhamos 9.1% da população mundial conectada, hoje temos 40% 3. Em 2002 o tempo médio de uso da internet era de 46 minutos no dia, hoje é de 4 horas 4. Tinhamos cerca de 3 milhões de sites, hoje temos 555 milhões 5. Tinhamos 2 browsers principais. Hoje temos pelo menos 5 diferentes 6. Page load médio em 2002: 16 segundos. Hoje 6 segundos
  4. Key message: There is certain fragmentation that we’ve to tackle, and be more systematic about how we focus on specific workloads Transition: Today, we can talk about just 2 different versions When we originally shipped the .NET Framework in 2002 there was only a single framework. Shortly after, we released the .NET Compact Framework which was a subset of the .NET Framework that fit within the footprint of smaller devices, specifically the old Windows Mobile. The compact framework was a separate code base from the .NET Framework. It included the entire vertical: a runtime, a framework, and an application model on top. Since then, we’ve repeated this sub-setting exercise many times: Silverlight, Windows Phone and most recently for Windows Store. This yields to fragmentation because the .NET Platform isn’t a single entity but a set of platforms, owned by different teams, and maintained independently. Of course, there is nothing wrong with offering specialized features in order to cater to a particular need. But it becomes a problem if there is no systematic approach and specialization happens at every layer with little to no regards for corresponding layers in other verticals. The outcome is a set of platforms that only share APIs by the fact that they started off from a common code base. Over time this causes more divergence unless explicit (and expensive) measures are taken to converge APIs. What is the problem with fragmentation? If you only target a single vertical then there really isn’t any problem. You’re provided with an API set that is optimized for your vertical. The problem arises as soon as you want to target the horizontal, that is multiple verticals. Now you have to reason about the availability of APIs and come up with a way to produce assets that work across the verticals you want to target. Today it’s extremely common to have applications that span devices: there is virtually always a back end that runs on the web server, there is often an administrative front end that uses the Windows desktop, and a set of mobile applications that are exposed to the consumer, available for multiple devices. Thus, it’s critical to support developers in building components that can span all the .NET verticals.
  5. Key message: Differentiate the purpose and scenarios between .NET Framework and .NET Core. They Key point on .NET Core is that it’s self-contained and specialized on specific workloads. Make sure that we make the point that BOTH are valid. There is no decrease in investment on the .NET Framework side. Transition. There is a common shared layer to these 2 pieces
  6. Key Message: Compilers, certain runtime components, libraries…. Are shared across and any improvement on these will impact on both frameworks, for instance ‘Roslyn’ Transition: With these pieces we enable/serve different application models
  7. Key messages: Briefly comment on these, YES Windows Forms is there, as well as Web forms, we’ll talk more about it later, and YES ASP.NET 5 works both in .NET Framework 4.6 and .NET Core 5 Transition: We’re going to focus on the ASP.NET pieces
  8. Transition: Let’s talk about the fundamental differences between these 2 options
  9. Reference– Damian Edwards on NDC: https://vimeo.com/131191236 Column in the middle represents the stack, an application stack that we’re used to do. Left side represents what asp.net has been until recently, and on the right hand we have at the bottom, Windows:Linux and OS X. This is one of the reasons that determines that we have so many differences Highlights Operating system [Traditional] [New] Runtime loader. [Traditional] Something that loads my runtime. On Windows there is a flag, that boots the CLR and then runs your application, a little bit different on web applications we’ve the native component WebEngine4 that loads the CLR . [New] Runtime [New] Dotnetcore CLR helps us satisfy the cross plat need… and we also have mono, not on this slide, but available Platform libraries [Traditional] BCL [New] still have that if we run in .net crl, if we run .net core, then we use packages. Nuget packages . Application host [Traditional] [New] DNX appears in multiple layers, it has different components Web Server [Traditional] [New] http.sys (selfhost), Kestrel is based on libuv (same abstraction layer than node.js). And btw you can use kestrel on windows Application Frameworks [Traditional] [New] Nuget is an essential part, we even ship the runtime on nuget Libraries [Traditional] [New] Application [Traditional] [New] And most of the new things are open source. Transition. It’s also slightly different how the project is structure, let’s see the key differences
  10. Option 1 – ASP.NET 4.6 + .NET Framework 4.6. There are a ton of websites built on top of the full .NET Framework and it’s a perfectly valid solution, either you choose the productivity of webforms or you prefer to work with MVC for a more granular option Option 2 – Create ASP.NET 5 sites and services and run them on top of the full .NET framework, a slightly different application model that you can choose, but leveraging (if you want) all the BCL classes. Option 3 – Cloud-optimized option. Due to the ability of configuring the pipeline and the different modules of both the application platform and the underlying .NET Core you can optimize for performance and benefit from the side-by-side running benefits. Transition. Different options that you can choose from to develop the so called modern web applications Read: https://weblogs.asp.net/scottgu/introducing-asp-net-5 Transition: We’re working on options and investing on enabling the platforms and tools for modern development web needs
  11. Goal of the demo – Create a new ASP.NET 5 project on Visual Studio 2015 and walk the audience by the key differences at the project level + some nugget context Check https://channel9.msdn.com/events/Ignite/2015/BRK3714 for context As well as a new runtime, ASP.NET 5 projects get a new project system. Instead of using Visual Studio’s usual .csproj or .vbproj files, ASP.NET 5 projects put everything in various JSON files. This is partly because Visual Studio is not technically required. But it also offers some benefits—it’s easier to control some aspects of your project because Visual Studio offers autocompletion for the various JSON files, making them much easier to edit directly than the old-style project files. (You can still do most things in Solution Explorer if you want though.) (UWP app projects do the same, incidentally, although you do need Visual Studio to write those.) One notable improvement that comes from the new project system is its new compilation model (which relies on the new ‘Rosyln’ C# and VB.NET compilers that ship with Visual Studio 2015). It makes it unnecessary to fully compile your project each time you want to change some code. You can just save it, and then see the effect of that immediately by refreshing the browser. You no longer have to wait 10 seconds or more for the code to compile first. ASP.NET 5 projects make a clear distinction between the content that is to be deployed to your site, and all other files. (For example, important though your C# or VB.NET source files are to the operation of your site, you don’t want users to be able to download your source over HTTP.) This is increasingly important with modern web development now that a lot of the artifacts that make it into the server such as CSS and JavaScript are processed in some way. For example, you could use languages such as SASS and LESS which are converted into CSS to be consumed by the browser, and it’s that CSS output that needs to go onto the web server, not the SASS or LESS source. Likewise, you’ll often want to minify JavaScript files before deploying them. Before ASP.NET 5, there wasn’t a great way to deal with these issues, but now the project structure is set up to support it directly. Nuget In an ASP.NET project, NuGet is now the main way to refer to external libraries. Although you can add a reference directly to a DLL from an ASP.NET 5 project, this only works when you’re building against the full .NET Framework – DLLs added this way will be unavailable if you build for .NET Core. Likewise, you can add references to framework components in the conventional way, but again, you cannot use DLLs this way when targeting .NET Core. But using NuGet (for either.NET Framework class library types or other libraries) works for both .NET Core and full .NET. This means you are likely to depend on a lot more packages than you would have done in the past. Fortunately, ASP.NET 5 introduces a change in how NuGet packages are handled that helps a great deal here: indirect references are handled automatically. For example, if you use a package that depends on a particular framework package (e.g. System.IO) you do not need to add a reference to that framework package explicitly—Visual Studio will infer the dependency automatically. This is a big improvement on how NuGet has worked in the past—in general, any project that depends on some package also needed to add dependencies to anything that package depended on. And while the NuGet dialogs would automatically add those for you, keeping them up to date could become problematic over time. Now, since your dependency list only contains the components on which your project depends directly, updating is much simpler. You can manage dependencies through the NuGet package manager, which you reach by right-clicking on the References node as has always been the case (although the package manager now looks substantially different.) Alternatively, you can edit the project.json file manually. Visual Studio will provide IntelliSense if you do that. Transition. ASP.NET 5 is just one of the available options on the .NET stack for web development
  12. Watch https://channel9.msdn.com/Events/dotnetConf/2015/Introduction-to-ASPNET5 0:25 Transition: When we talk about speed, about being fast, we should also take into consideration the developer productivity
  13. Tour around the repo, show collaborations, how to use gitter
  14. Tour around the repo, show collaborations, how to use gitter
  15. [References] Updates for ASP.NET 4.6 Blog post - http://blogs.msdn.com/b/webdev/archive/2015/04/30/updates-for-asp-net-4-6-web-forms-mvc-5-web-api-2.aspx Web Forms 4.6 - https://channel9.msdn.com/Events/Visual-Studio/Connect-event-2014/812 Info about HTTP/2 - http://http2.github.io/
  16. [References] Docker - https://channel9.msdn.com/Series/Docker-for-NET-Developers/Docker-Overview-for-NET-Developers Diagnostics Run/Debug in Cloud Tracing/Logging without re-deploy Open Source https://github.com/aspnet Cross-Platform Entity Framework Entity Framework 6.x Evolution of current EF Runs on .NET Framework 4.6 Entity Framework 7 LINQ and EF skills re-use, easy to move most existing apps Cloud optimized (small memory footprint and high throughput) Device optimized (lightweight, works with SQLite) Supports relational and non-relational stores Runs on .NET Core 5 and .NET Framework 4.6 Cross-platform ready (based on .NET Core 5) Design for disconnected/web scenarios Both versions are OPEN SOURCE! Entity Framework narrative As with ASP.NET 5, the rewriting of Entity Framework 7 hasn’t meant that it is unrecognizable: many core concepts remain in place. For example, there is still a class called DbContext that is your main point of entry to your data source, and collections of entities are still represented by a class called DbSet. Any investment in earlier versions of the Entity Framework remains valuable—developers will be able to apply their existing knowledge to this new version. Some features have been removed. In some cases, these are areas that had already been superseded, and which only remained in v6.1 for backwards compatibility reasons. For example, the old ObjectContext class was long ago replaced by DbContext. Since EF7 does not provide full backwards compatibility, this hangover from very early versions can finally be removed. Also, certain features which are not widely used (either because they proved unpopular, or because better new alternatives exist) have been removed. For example, some complex type mappings which were rarely used have gone. And the ‘multiple entity sets per type’ (MEST) feature’s capabilities are now better supported through inheritance, so that has gone too. There are also some features which have disappeared, but which are expected to return in later releases. A full rewrite required substantial effort, and there wasn’t time to get everything from previous versions into this release. The most notable absence is Lazy Loading, a feature that the Entity Framework team plan to put back in the future. This new version also adds some new functionality. For example, it now supports some non-relational data sources such as Azure Table Storage. And there is new functionality for traditional relational storage too, such as the ability to perform batched updates, or for a model to specify unique constraints besides keys. Also, in keeping with the lightweight spirit of .NET Core, the framework has been refactored into multiple subcomponents, making it possible to use only those parts you actually want, rather than having an all-or-nothing heavyweight framework.
  17. Tour around the repo, show collaborations, how to use gitter
  18. C# language features: String interpolation, elvis….
  19. Introduction to ASP.NET 5 MVA Course https://www.microsoftvirtualacademy.com/en-us/training-courses/introduction-to-aspnet-5-13786?l=PvSZtxoXB_5101937557
  20. Introduction to ASP.NET 5 MVA Course https://www.microsoftvirtualacademy.com/en-us/training-courses/introduction-to-aspnet-5-13786?l=PvSZtxoXB_5101937557