Advanced Managed Code Development Features Marcus Perryman

Slides:



Advertisements
Similar presentations
Unit 1: Overview of the Microsoft.NET Platform
Advertisements

1 Unit 1: Introduction To.Net. 2 Introduction to.Net Integrated Development Environment (IDE) Languages in the.NET Framework The Common Language Runtime.
.Net Compact Framework A Mostly Straight Path, but with Some Interesting Curves Richard Kucia Kucia Associates
Introduction to .NET Framework
Tahir Nawaz Introduction to.NET Framework. .NET – What Is It? Software platform Language neutral In other words:.NET is not a language (Runtime and a.
Using.NET Platform Note: Most of the material of these slides have been taken & extended from Nakov’s excellent overview for.NET framework, MSDN and wikipedia.
SSCLI (Shared Source Common Language Infrastructure) (code name: Rotor)
Developing with the.NET Framework Rob Howard Program Manager.NET Framework Team Microsoft Corporation.
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
.Net Compact Framework. Microsoft.Net is often referred as Plateform for web services But.net vision is more than web services – It talks about how people.
Introduction. What is.Net? The hype: “Microsoft.Net is a set of Microsoft software technologies for connecting information, people, systems, and devices.
.Net Overview Giuseppe Attardi Università di Pisa.
64bit Development Overview March 28 Microsoft. Objectives Learn about the current 64-bit platforms from a hardware, software and tools perspective Review.
What’s New for Smart Client Developers in Visual Studio 2005? Mike Pelton Systems Engineer Microsoft Ltd
Thursday Evening 6.30VB.NET Introduction 7.30Break for food 8.00VB.NET Migration 8.45Q & A 9.00Done.
What’s New for Smart Client Developers in Visual Studio 2005? Mike Pelton Systems Engineer Microsoft Ltd
Windows Mobile Developer Marcus Perryman Morgan Skinner.
Module 1: Overview of the Microsoft.NET Framework.
Introducing the Common Language Runtime for.NET. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution.
Introducing the Common Language Runtime. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution engine.
SQL Server 2005 CLR Integration ADO.NET 2.0 Mike Taulty
What’s new for Rich Clients? Martin Parry Developer & Platform Group Microsoft Ltd
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
Developing International Applications for Mobile Devices with.NET Achim Ruopp International Program Manager Microsoft Corporation.
Punit Shah Technical Lead | Microsoft
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 18 Microsoft’s Approach 1 –.NET Mobile Framework Rob Pooley.
Using.NET Skills To Build Mobile Applications In Compact Framework Punit Shah Technical Lead | Microsoft |
.NET, and Service Gateways Group members: Andre Tran, Priyanka Gangishetty, Irena Mao, Wileen Chiu.
September 2008 IT Software Development Guide.
DEV317 Integrating Extensible Business Graphics into Enterprise Applications using Visio 2003 Mai-lan Tomsen Bukovec Program Manager.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
June 2003 Beginning Compact Framework Mohammad Faridi (faridianslip) Umer Faruq.
Visual Studio.NET and.NET Compact Framework Application Development Mike D. Smith Group Program Manager Developer Division Microsoft Corporation.
Microsoft.NET Framework Overview Abidi Mahmoud Seminarium on Component -based Software Engineering.
Architecture of.NET Framework .NET Framework ٭ Microsoft.NET (pronounced “dot net”) is a software component that runs on the Windows operating.
Introduction to.NET Framework. .NET – What Is It? Software platform Language neutral In other words:.NET is not a language (Runtime and a library for.
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
1 Developing Apps For The Pocket PC Platform Anup Mistry Technology Manager D-2 (22 nd May ’03)
Windows CE 시스템 개발 개요. 임베디드시스템소프트웨어 -Windows CE 2 Overview  Selecting a Windows Embedded Operating System  The Windows CE Platform Development Cycle.
Overview of System Development. Overview Selecting a Windows Embedded Operating System The Windows CE Platform Development Cycle The Application Development.
What is.NET? CS 351 Ed Gellenbeck. Today What is.NET? What Problems Does.NET Solve? What are.NET Framework Components?
CF and.NET Working Together Using Web Services Geoff Snowman Developer Community Champion Microsoft Corporation.
.NET Compact Framework Performance Strategies MBL 402 Ivo Salmre Product Manager.NET Developer Technologies, UK Microsoft Corporation.
Introduction to the Compact Framework Marcus Perryman Principal Consultant Microsoft.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 17 Microsoft’s Approach 1 –.NET Mobile Framework Rob Pooley.
Rajiv and Shipra Introduction to.NET (asp.net,c#,vb)
tom perkins1 XML Web Services -.NET FRAMEWORK – Part 1 CHAPTER 1.1 – 1.3.
Windows Forms in Visual Studio 2005 Mike Pelton Systems Engineer Microsoft Ltd
Windows CE 시스템 개발 개요. 모바일운영체제 - Windows CE 2 Overview  Selecting a Windows Embedded Operating System  The Windows CE Platform Development Cycle  The.
Localization Support in Microsoft.NET Framework François Liger Program Manager Microsoft Corporation.
Rob Tiffany Mobility Architect Microsoft Corporation MOB401.
MBL401.Net Compact Framework: Data Access Best Practices Paul Foster Mobile solutions architect.
Intro to dot Net Dr. John Abraham UTPA CSCI 3327.
PRIOR TO WEB SERVICES THE OTHER TECHNOLOGIES ARE:.
.NET Compact Framework Per Ahlberg. Agenda.NET CF vs.NET Framework Major Areas Base Classes Drawing/Forms Data/XML Web Services Application Development.
The 100% Inspiration Tour. An Introduction to Building Connected Mobile Applications Gavin King Academic Team, Microsoft UK
What’s New in Windows Forms 2.0 Stephen Turner Software Design Engineer
Introduction to.NET Technology Overview Sean Puffett Developer & Platform Group Microsoft Ltd
.NET Mobile Application Development XML Web Services.
Introducing the Microsoft® .NET Framework
Introducing the Windows Mobile development
Introduction to .NET Framework Ch2 – Deitel’s Book
Mobile Application Development 2005 By Sam Nasr July 25, 2006
.NET and .NET Core 2. .NET Runtimes Pan Wuming 2017.
Windows Forms and Smart Device Extensions in the End-to-End Application Hans Verbeeck Developer Consultant Microsoft EMEA.
Overview of System Development for Windows CE.NET
Windows Forms in Visual Studio 2005: An in-depth look at key features
Mark Quirk Head of Technology Developer & Platform Group
Getting Data Where and When You Want it with SQL Server 2005
.NET Framework Design Goals
Presentation transcript:

Advanced Managed Code Development Features Marcus Perryman

Agenda Compact Framework Detail Compact Framework Detail  Under the hood!  Performance  Interop Using CF in the Real World Using CF in the Real World  Graphics  Forms management  Web Services Summary Summary

Compact Framework Detail

The EE A short review Compiled managed code is a binary in Microsoft Intermediate Language Compiled managed code is a binary in Microsoft Intermediate Language Code is just-in-time compiled to the native processor language on type-by-type, method-by-method basis Code is just-in-time compiled to the native processor language on type-by-type, method-by-method basis Resulting native code is cached for later reuse Resulting native code is cached for later reuse Over the lifetime of the app, the up front cost of jitting is amortized, and becomes less and less significant Over the lifetime of the app, the up front cost of jitting is amortized, and becomes less and less significant

Per-Thread Control Flow ExecuteManagedMethod JITCompiled? Verify & JIT CompileMethod Load Base Classes Locate “Main” Class Class Execute Native (Until next Method) Yes LoadContainingClass No OtherClasses? Load Other Class Yes -Parents -Containing called methods -Declaring Args, Locals, Fields -Allocated (new) Jump to Native Code Return to CLR

Under the Hood Build process Build process  Same compilers  Local exe produced – additional Deploy step File format File format  Standard PE format with no native code  Module load upgraded on device  Contains Intermediate Language (IL) blocks  Resources bound in or deployed in parallel Deploy Deploy  Uses Connection Manager not Platform Manager  Again over Active Sync

.NET Compact Framework System System.DataSystem.Xml System.Web Globalization Text Security Collections Resources Reflection Net IO Threading Diagnostics ServiceProcess Configuration Design ADO.NET SqlServerCe SqlClient Xslt/XPath XmlDocument Runtime InteropServices Remoting Serialization Serialization ConfigurationSessionState CachingSecurity Services Description Discovery Protocols UI HtmlControls WebControls System.Drawing Imaging Drawing2D Text Printing System.WinForms DesignComponentModel Reader/Writers

Unsupported Excluded Supported Pocket PC NETCF Controls ButtonCheckBoxComboBoxContextMenuDataGridDomainUpDownFileOpenDialog HScrollBarImageListLabelListBoxListViewTreeViewTrackBarFileSaveDialogMainMenuNumericUpDownPanelPictureBoxProgressBarInputPanel GroupBox Printing Controls RichTextBox NotificationBubble (PPC) RadioButtonStatusBarTabControlTextBoxTimerToolBarVScrollBar CheckedListBoxColorDialogErrorProvider HelpProviderLinkLabel NotifyIconToolTip ToolTipSplitterFontDialog

Framework Size Framework size (RAM or ROM) Framework size (RAM or ROM)  ~1.5 MB Running RAM needs Running RAM needs  1 MB+ (depends on app) Typical application sizes Typical application sizes  KB  Apps often smaller due to use of platform features in the framework

ILDASM Multiple environments

Active Sync Connection Manager Remote Deploy And Debug Visual Studio.NET Windows DebugManager Device or Emulator STREAM CONNECT Process Enumerate App.exe File Copy App.pdb App.exe Remote Exec STREAM CONNECT Remote Debug

Garbage Collection Desktop: G 0G 1G 2 2k Mark Promote Mark Promote

Garbage Collection Compact Framework : 5K Threshold MarkCompact Pitch Code? LRU

Performance

What Is Performance? Affected by two principles Affected by two principles  Absolute Performance of the system; the raw processing horsepower  Apparent Performance of the application; affected by how the application is written Application performance is qualitatively measured by how responsive the application is to the end user

Code Pitching Occurs when large volumes of allocated memory cause memory pressure Occurs when large volumes of allocated memory cause memory pressure Runtime will discard or pitch code from the code cache Runtime will discard or pitch code from the code cache Qualitative inspection will tell you when this occurs Qualitative inspection will tell you when this occurs

Behavior Under Memory Pressure Memory utilization Performance

Performance User Interface: User Interface:  Version 1 performance is excellent!  System.Drawing and System.Windows.Forms call to native APIs beneath  Call “batching” where possible  Pools and reuses Window Handles Data And XML Performance Data And XML Performance  Version 1 performance is good  Mostly implemented in managed code  Memory pressure effect data performance Compact Framework SP2 Compact Framework SP2  Improved performance everywhere  Most notable with XML DOM

Interop

Overall Native Code Interop strategy Focus on enabling versus exhaustive Focus on enabling versus exhaustive  PInvoke is powerful, but advanced or edge case scenarios are more difficult than the desktop  It is possible for COM and.NET components to peacefully coexist in the same process/thread Focus on simplicity for Version 1.0 Focus on simplicity for Version 1.0  Native code interop is very fast and simple Compact Framework V2.0 Compact Framework V2.0  Adds Com Interop  Rich marshaling – Layout of structures

Marshaling Of Simple Types The execution engine marshaling of simple data types The execution engine marshaling of simple data types C# Visual Basic Native Code intInteger int (32-bit integer) shortShort short (16-bit) boolBoolean BYTE (8-bit)* charChar wchar (16-bit) StringString wchar * Array int [] Array Integer () Data of the Array int * longLong Not Supported (64-bit) doubleDouble Not Supported (floating point) *bool and Boolean DO NOT convert to a Win32 BOOL

Marshaling Complex Objects Marshal class Marshal class  Located in System.Runtime.InteropServices  Provides advanced functionality to customize marshaling Allows you to get copy managed objects into native code Allows you to get copy managed objects into native code Allows you to read and write raw memory if needed Allows you to read and write raw memory if needed

Callbacks No support for direct native to managed function calls No support for direct native to managed function calls Use MessageWindow Use MessageWindow  Part of Microsoft.WindowsCE.Forms Steps for Callback Steps for Callback  Create a MessageWindow in Managed  Pass window handle to native  Native sends messages back with it  Managed code can trap window messages

Using the Compact Framework

Common Application Features Using Graphics for Business Applications Using Graphics for Business Applications Dealing with Form Management Dealing with Form Management Being Smart about Web Services Being Smart about Web Services

Graphics System.Drawing System.Drawing  Supports GDI functions  (line, circle, rectangle etc…)  Good performance  Business application graphics  Wire frame diagrams Games API Games API  No DirectX support (coming soon)  Fast screen access  Sound, hardware buttons

More advanced graphics Speed Considerations Speed Considerations  Delayed draw protected override void OnPaint(PaintEventArgs e) { buffer = new Bitmap(Width, Height); Graphics g = Graphics.FromImage(buffer); // … Calculate new position PostRender(g); // Call post rendering routines... g.Dispose(); // Clean up... // Draw to display... e.Graphics.DrawImage(buffer, 0, 0); }  Double buffering  Sprites  Exclusion drawing

Custom Controls Provides encapsulation and code sharing Provides encapsulation and code sharing No support for User Controls No support for User Controls Derive class from Control: Derive class from Control: public class Visualizer : Control protected override void OnPaint(PaintEventArgs e) Creating the Control: Creating the Control: // Create the 3D warehouse visualizer... this.visualizer = new Warehouse3D(); this.Controls.Add(this.visualizer); Installing to the designer Installing to the designer  Include RuntimeAssemblyAttribute [assembly:System.CF.Design.RuntimeAssemblyAttr ibute”…”)]  Requires desktop build of the control

Form Management The Form Flow Challenge The Form Flow Challenge  No Multiple Document Interface  Multi form input more common  Which form to display next?  Hide or destroy current form? Solutions Solutions  Dynamic form construction  Forms manager  Wizard based input (e.g. tight scripting of forms)

Form Management Application Kernel Web Service Interface Local Store (SQL CE ) Main FormCollect Form Inspect Form Truck Form Form Manager Main

Being Smart about Web Services Mobile Communication challenges Mobile Communication challenges  Latency, speed, coverage (we are mobile)  Chatty vs monologue? Consider interface to MapPoint Consider interface to MapPoint  Request the Lat / Long for start and end address FindAddress(startAddress); FindAddress(endAddress)  Request map or driving directions GetMap(mapspec)CalculateSimpleRoute(...) Chatty / State full breaks Store and Forward model Chatty / State full breaks Store and Forward model Monologue ==(?) Performance issues Monologue ==(?) Performance issues Consider a server Agent Consider a server Agent Agent.GetMapData(start,end,GET_MAP | GET_DIRECTIONS)

Summary Windows Mobile 2003 offers a rich and robust platform on which to build and deploy Mobile applications. Windows Mobile 2003 offers a rich and robust platform on which to build and deploy Mobile applications. Microsoft Visual Studio.NET 2003 provides state of the art development tools for targeting the Compact Framework. Microsoft Visual Studio.NET 2003 provides state of the art development tools for targeting the Compact Framework. The Compact Framework brings Mobile devices to the mainstream development community. The Compact Framework brings Mobile devices to the mainstream development community.

© Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.