O slideshow foi denunciado.
Seu SlideShare está sendo baixado. ×

Intro to .NET for Government Developers

Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Próximos SlideShares
Asp.net
Asp.net
Carregando em…3
×

Confira estes a seguir

1 de 69 Anúncio
Anúncio

Mais Conteúdo rRelacionado

Diapositivos para si (20)

Anúncio

Semelhante a Intro to .NET for Government Developers (20)

Mais de Frank La Vigne (20)

Anúncio

Mais recentes (20)

Intro to .NET for Government Developers

  1. 1. Developing with .NET Frank La Vigne Developer Evangelist Microsoft @tableteer | FrankLa@Microsoft.com www.FranksWorld.com/blog
  2. 2. Not just downloads • Documentation • Articles • Sample Code • Specialty sites • ASP.NET • Silverlight.net • WindowsClient.net • And much more! A Quick Word About MSDN
  3. 3. The Future
  4. 4. Soon, Very Soon.
  5. 5. • Visual Studio 2010 • Multiple versions with multiple price points • Expression Blend Nice to have tools • F12 Dev Tools • Fiddler • Silverlight Spy Tools of the Trade
  6. 6. Web Windows Cloud Phone Games Data Write .NET Code in All of These Environments .NET Everywhere
  7. 7. Win And WPF DLR ASP.NET WCF LINQ Forms more! Base Class Libraries .NET Framework Common Language Runtime Architecture JIT & Garbage Security Exception Loader & NGEN Collector Model Handling Binder .NET Architecture
  8. 8. BASE CLASS LIBRARIES (BCL) IMPROVEMENTS IN .NET 4.X
  9. 9.  Set of public types and APIs  System.Threading  System.Threading.Tasks // Sequential foreach (var item in sourceCollection) { Process(item); } // Parallel Parallel.ForEach (sourceCollection, item => Process(item)); Task Parallel Library (TPL)
  10. 10.  Implements the full set of LINQ standard query operators  Extension methods for the IParallelEnumerable interface  Additional operators for parallel operations from n in names.AsParallel().WithDegreeOfParallelism(ProcessorsT oUse.Value) where n.Name.Equals(queryInfo.Name, StringComparison.InvariantCultureIgnoreCase) && n.State == queryInfo.State && n.Year >= yearStart && n.Year <= yearEnd orderby n.Year ascending select n; Parallel LINQ (PLINQ)
  11. 11. • System.Diagnostics.Contracts • Code Contracts introduce a way to specify contractual information that is not represented by a method or type’s signature alone • Scenarios for using contracts include: • Perform static bug finding, which enables some bugs to be found without executing the code • Create guidance for automated testing tools to enhance test coverage • Create a standard notation for code behavior, which provides more information for documentation Design By Contract
  12. 12. • BigInteger • Immutable type that represents an arbitrarily large integer whose value in theory has no upper or lower bounds • SortedSet<T> • Provides a self-balancing tree that maintains data in sorted order after insertions, deletions, and searches Data Types
  13. 13. • Memory-Mapped File • Used to edit very large files and to create shared memory for inter-process communication • Stream.CopyTo • Allows you to copy the contents of one stream into another I/O
  14. 14. EHANCEMENTS TO PROGRAMMING LANGUAGES IN .NET 4.X
  15. 15. • Auto-Implemented Properties • Shortened syntax that enables you to quickly specify a property of a class without having to write code • Collection Initializer • Shortened syntax that enables you to create a collection and populate it with an initial set of values • Implicit Line Continuation • Enables you to continue a statement on the next consecutive line without using the underscore character Visual Basic
  16. 16. • Dynamic Type • Operations that contain expressions of type dynamic are not resolved or type ch`ecked by the compiler. The compiler packages together information about the operation, and that information is later used to evaluate the operation at run time • Optional and Named Parameters • Named arguments enable you to specify an argument for a particular parameter by associating the argument with the parameter's name rather than with the parameter's position in the parameter list. • Optional arguments enable you to omit arguments for some parameters. Both techniques can be used with methods, indexers, constructors, and delegates. C#
  17. 17. • You can configure restart manager to autosave documents and restart your application after it exits unexpectedly • Lambda expressions are available in C++ • The new CTaskDialog replaces the standard Windows message box and adds functionality to display and gather more information C++
  18. 18. • IDE support for F# • Interactive F# for prototyping code • Asynchronous constructs • Parallel constructs • Immutable data types F#
  19. 19. Web Client Development
  20. 20. But What About?
  21. 21. I <3 Silverlight!
  22. 22. • Blue Angels Web Site • http://blueangels.navy.mil You Can Use Them Both
  23. 23. Looking Forward
  24. 24. http://buildmypinnedsite.com/ Site Pinning
  25. 25. Web Platform Installer Ajax Control Toolkit & jQuery ASP.NET ADO.NET Entity Framework SQL Server IIS The Microsoft Web Platform combines a rich and powerful web application framework with a supporting cast of tools, servers, technologies and applications for creating, designing, developing and delivering web solutions. The Microsoft Web Platform
  26. 26. I’m a professional I <3 Web Apps. I want to build web software developer and I just need a tool that sites myself with an I build complex, large makes them easier to easy to learn tool scale web sites with a configure, customize and framework team of developers and publish them Today’s Web Developers
  27. 27. A Free Web Dev Tool
  28. 28. Visual Studio 2010 WebMatrix ASP.NET Core Caching Modules Globalization Web Forms View Engine Razor View Engine Pages Controls Master Pages Profile Roles Membership ASP.NET ASP.NET ASP.NET Web Forms Intrinsics MVC Handlers Web Pages Etc. ASP.NET: A Framework For All
  29. 29. • Ability to set meta tags • More control over view state • Added and Updated browser definition files • ASP.NET Routing • The ability to persist selected rows in data controls • More control over rendered HTML in the FormView and ListView controls • Filtering support for data source controls ASP.NET 4 Webforms
  30. 30. WHAT IS MVC?
  31. 31. • Huge investment from Microsoft • Alternative to WebForms • Modular Architecture • MVC 3.0 now available • MVC 4 in Developer Preview stage • Razor Syntax • MVC 3.0 Tooling Updated April 2011 Model-View-Controller (MVC)
  32. 32. Controller (Input) View Model (Presentation) (Data) ASP.NET MVC 101
  33. 33. • What does MVC look like? Controller Request Controller Retrieves Model “Performs Work” View Response View Visually represents the model How MVC Works
  34. 34. WHY SHOULD WE CARE ABOUT ASP.NET MVC IN PUBLIC SECTOR?
  35. 35. • Users disdain “Ugly” URLs • http://answers.usa.gov/system/selfservice.controller?CONFI GURATION=1000&PARTITION_ID=1&CMD=VIEW_A RTICLE&ARTICLE_ID=11951&USERTYPE=1&LANGU AGE=en&COUNTRY=US vs http://www.whitehouse.gov/briefing-room/speeches-and- remarks • Search Engine Optimization (SEO) • Discoverability More Web Savvy Citizens
  36. 36. • Powerful, patterns-based way to build dynamic websites • Enables a clean separation of concerns • Gives you full control over markup for enjoyable, agile development. Developer Productivity
  37. 37. • Enable fast, TDD-friendly development for creating sophisticated applications • Separation of concerns makes for easier testing Testing
  38. 38. • Uses the latest web standards. • Full control over markup makes creating compliant sites easier Accessibility
  39. 39. • No ViewState • Smaller HTML payload • Faster downloads • HTML5 • Easy to implement eye catching graphics that leverage GPU acceleration with IE9 and IE10 Performance
  40. 40. DEMO Creating an ASP.NET MVC 3 Project
  41. 41. Razor
  42. 42. @if (You.Understand(Razor)) { <div>Hooray!</div> } • New, Simplified View Engine • Write fewer lines of code • More natural mix code and markup • Helpers save you time • Compatible with ASP.NET Web Pages in WebMatrix • http://bit.ly/WhatIsWebMatrix Razor Syntax
  43. 43. Web Forms <ul> (6 markup transitions): <% for (int i = 0; i < 10; i++) { %> <li><% =i %></li> <% } %> </ul> PHP <ul> <?php (2 markup transitions for ($i = 0; $i < 10; $i++) { & an echo): echo("<li>$i</li>"); } ?> </ul> Razor <ul> @for (int i = 0; i < 10; i++) { (2 markup transitions): <li>@i</li> } </ul> Razor: a Cut Above the Rest
  44. 44. @{ var name = “John Doe”; Option 1: <div> HTML Block Your name: @name </div> } @{ var name = “John Doe”; Option 2: <text> Text Block Your name: @name </text> } Option 3: @{ var name = “John Doe”; Single line of output @: Your name: @name in markup } Easier Code to Markup Transitions
  45. 45. @* <div> Option 1: Hello World Markup </div> *@ @{ //var name = "John Doe”; Option 2: //@name Code } @* Option 3: @{ var name = "John Doe"; Both @name } *@ Code Comments in Razor
  46. 46. SILVERLIGHT & WPF DEVELOPMENT
  47. 47. Two Platforms
  48. 48. WPF Silverlight Similar But Different
  49. 49. Two Core One Common Technologies Language 2 Platforms Powered By XAML
  50. 50. • Markup language derived from XML • XML serialization of CLR objects • Markup files have code-behind files • Could be C# or VB.NET • Conceptually similar to ASP.NET • X stands for Extensible • Data Binding • Styles • Templates Intro to XAML
  51. 51. <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > <Grid> <Button>Click Me!</Button> </Grid> </Window> What Does XAML Look Like?
  52. 52. Results
  53. 53. Most Devs Reaction to Blend
  54. 54. Demo
  55. 55. Mobile
  56. 56. For the purposes of this talk, we’ll focus on Silverlight. 1 Platform. 2 Choices.
  57. 57. What is Metro?
  58. 58. METRO IS OUR DESIGN ETRO LANGUAGE. WE CALL IT METRO BECAUSE IT’S MODERN AND CLEAN. IT’S FAST AND IN MOTION. IT’S ABOUT CONTENT AND TYPOGRAPHY. AND IT’S ENTIRELY AUTHENTIC.
  59. 59. Desktop?
  60. 60. • http://frnk.us/8GreatTraitsOfMetroApps • http://frnk.us/MetroTutorial Metro Resources
  61. 61. DEMO Creating a Windows Phone App
  62. 62. Marketplace Sample
  63. 63. • Creates Entity Model from Database • Helpful in creating RESTful Services • Exposes Database as Classes/Methods • Works with any Database • Useful in MVC, Dynamic Data Models What is the Entity Framework?
  64. 64. Database Generated First Existing Entity Data Database Model Model First Entity Data Generated Model Database Code-First in EF 4.1
  65. 65. DEMO
  66. 66.  Phone SDK Download http://bit.ly/WinPhoneSDKDownload  Web Matrix http://bit.ly/WhatIsWebMatrix  Azure http://bit.ly/FreeAzure90DayTrial http://bit.ly/DownloadAzureSDK Useful Resources

×