NET Compact Framework Application Platforms Today Browser Apps
. NET Compact Framework
Application Platforms Today Browser Apps GUI Services Web Services Apps Transaction Services Local Apps Web Scripting Data Access Standard Library Runtime Environment Operating System Other Apps More
What is Microsoft. Net? � Visi: ◦ The platform for the digital future ◦ ‘. NET is Microsoft’s platform for a new computing model built around XML Web Services’ Microsoft Corporation Annual Report, 2001 � Suatu brand name ◦ Applied to many things � Diperkenalkan 2000) oleh Microsoft pada (Juni ◦ Sekarang sudah sampai. net framework 3. 5
. NET FRAMEWORK � Bersifat independen dalam hal bahasa � Mampu dijalankan di semua platform ◦ Aplikasi dapat dikembangkan di beberapa bahasa yang didukung oleh. NET: Visual Basic. NET, Visual C++. NET, C# dan J# ◦ Programmer dapat memilih salah satu bahasa yang paling dikuasainya.
. NET Blueprint Visual Studio. N ET A p p l i c a ti o n s Usi n g Y o u r S ervi ce S m a r t C l i e n ts. NE T F W Windows S mart Devi ces. NE T F W S i mp l e Bro w sers Your applicatio n and web service. NET Framework Windows CE , X P , 2000, . NE T Open Internet Protocols XML, XSLT, XSD, SOAP, DISCO, UDDI, XHTML, HTTP, SSL, WAP Your Internal Services Sales Data Service Corporate Fullfilment Service . NET Enterprise Servers SQL Server Biz. Talk Server Application Center Commerce Server Host Integration Server Internet Security and Acceleratio Exchange Server . NE T F W Windows Building Block Passport – Identity Services Calendaring Service … [my. Service 3 rd Party Web Services Geographic Mapping Service Credit Card Statement Service … [Active. X Paradigm
. NET Framework (2)
. NET Framework (3) System. Web Services Description UI Html. Controls Discovery Web. Controls System. Win. Forms Design Component. Model System. Drawing Protocols Caching Security Drawing 2 D Configuration Session. State Imaging System. Data ADO. NET Design Printing Text System. Xml Sql. Client Ole. DB, odbc, Oracle Xml. Document Serialization Xslt/XPath Reader/Writers System Collections IO Configuration Security Net Service. Process Runtime Interop. Services Text Reflection Diagnostics Remoting Globalization Resources Threading Serialization
Common Language Runtime � Bagian utama dari framework yang akan mengkompilasi dan mengeksekusi program yang ditulis dengan bahasa yang mendukung. NET � Compilation process ◦ Dua Langkah Kompilasi �Pertama program di compile menjadi Microsoft Intermediate Language (MSIL) / Common Intermediate Language (CIL) � Mendefinisikan instruksi untuk CLR �Kemudian MSIL code diterjemahkan kedalam machine code � Machine code untuk platform yang khusus ◦ Mengapa dua proses kompilasi ? �Agar platformnya bersifat independence �. NET Framework dapat diinstal di platform berbeda � Mengeksekusi program. NET tanpa modifikasi kode-nya �Language independence �. NET program tidak terikat dengan bahasa tertentu � Komponen yang lama dan baru dapat terintegrasi
Common Language Runtime (2) � Keuntungan lain dari CLR ◦ Execution-management features �Manages memory, security �Membebaskan programmer dari banyak tanggung jawab �Programmer lebih berkonsentrasi pada program logic � CLR menyediakan JIT compilation. � JIT hanya akan mengkompilasi method-method yang memang digunakan dalam suatu bagian aplikasi pada saat tertentu, dan hasil kompilasi ini sendiri di cache di dalam mesin dan akan dikompile kembali jika memang ada perubahan pada kode aplikasi kita. ◦ Jadi tidak semua method diload ke-memori pada saat yang sama
Common Language Runtime (3) Base Class Library Support Thread Support COM Marshaler Type Checker Exception Manager Security Engine Debug Engine IL to Native Compilers Code Manager Class Loader Garbage Collector
CLR Execution Model VB Native Code C# Install time Code Gen Script . . . Assembly: MSIL + Metadata Development Deployment Common Language Runtime JIT Code Gen Native Code
Data Types in the CLR � The CLR mendefinisikan Common Type System (CTS) ◦ All languages built on the CLR use the CTS (managed code) � Ada 2 kategori: ◦ Value types: �Relatively simple types �Allocated on the stack ◦ Reference types: �More complex types �Allocated on the heap �Destroyed through garbage collection
Compiling & Executing Managed Code Compilation Source Code Language Compiler Microsoft Intermediate Language (MSIL) The first time each method is called Native Code JIT Compiler Execution
. NET Class Library � Sering disebut sebagai Base Class Library. � Adalah koleksi dari reusable types yang sangat terintegrasi secara melekat dengan CLR. � Class library bersifat berorientasi objek yang akan menyediakan types dari fungsi managed code. � Dengan BCL kita dapat membuat: ◦ ◦ Aplikasi � Aplikasi console berbasis windowd (Windows Form) ASP. NET (berbasis web) Web Services XML berbasis Windows Services
A Brief History of Windows Mobile Development � Embedded Tools for Visual Studio � e. MBedded Tools ◦ VS 6 ◦ Tools for VB, C++ ◦ Standalone and free ◦ e. VB ◦ e. C++ �. NET Compact Framework (First Pass) ◦ Visual Studio. NET ◦ Smart Device Extensions
. NET Compact Framework Design Goals � � � Portable and small. NET CLR for devices ◦ Enable Visual Basic® and C# ◦ ◦ Run managed. EXEs and. DLLs directly Debug with Visual Studio. NET ◦ ◦ ◦ Compaq, HP, Dell, Toshiba, … Pocket. PC 2000, 2002 Windows Mobile (alias PPC 2003) ◦ ◦ ◦ Windows CE Smart. Phone No Palm/Handspring Integrated in Visual Studio®. NET Target devices: �. Net CF in ROM!
The Framework – “Optimized” � 20 mb 1. 5 mb � Same languages, same code, same MSIL � Multiple target CPUs / Mobile device
. NET Compact Framework System. Web Services Description UI Html. Controls Discovery Web. Controls System. Win. Forms Design Component. Model System. Drawing Protocols Caching Security Drawing 2 D Configuration Session. State Imaging System. Data Printing Text System. Xml ADO. NET Sql. Client Xml. Document Serialization Design Sql. Server. Ce Xslt/XPath Reader/Writers System Collections IO Configuration Security Net Service. Process Runtime Interop. Services Text Reflection Diagnostics Remoting Globalization Resources Threading Serialization
. NET CF Architecture App Domain Host . NET Compact Framework CLR Applications Device Specific Class Libs … Launch Base Class Libs Execution Engine (“MSCOREE. DLL”) Platform Adaptation Layer Host Operating System Managed Native
Platform Adaptation Layer � � Base Services ◦ Threads, sync, timers, memory, math ◦ ◦ Open, close, read/write, directory Direct addressing mode ◦ ◦ Sockets Connection Control ◦ Framebuffer, char and pointer I/O, Fonts Storage Networking GUI
Execution Engine � Basic services for managed execution ◦ Loader �Meta-data engine/cache �Representation of class hierarchy/layout �Reflection ◦ JIT-Compiler/Verifier ◦ Execution Infrastructure �Exceptions, Native Code Inter. Op, Security ◦ Garbage Collector ◦ Debugging Support ◦ “Native” implementation of some managed APIs (class libraries)
Class Libs � Base Types ◦ Type conversion, display formatting ◦ String manipulation ◦ Array. Sort � Threading & Sync (System. Threading) � Storage (System. IO) � Resources (System. Resources) � Collections (System. Collections) � Reflection (System. Reflection) � XML ◦ DOM and Reader/Writer � Networking, Forms, Data Access
Developing in a Compact World � VS. Net 2003/2005 installation option � Only C#, VB. Net � True on-device debugging ◦ If you can get it connected… � Emulator � Deployment
Developing in a Compact World VS. NET Integration � Templates for devices in New Project dialog ◦ Template sets device and project type � Template types ◦ ◦ ◦ � Pocket PC Application Pocket PC Class Library Pocket PC Control Library Windows CE. NET Application Mobile Phone Application Default set of references that are appropriate for your platform
Develop Symbian in VS 2005 � You can get it! You can download App. Forge plugin!
Developing in a Compact World Deployment � Same user experience as desktop � Compiles application for device � Output Window used for deployment messages � Visual Studio deploys the framework to device if needed
Packaging and Deployment Source Code (Hello. *) Windows + Visual Studio. NET Cab. Wiz. exe . NET Compiler Hello. exe Hello. dll(s) Active. Sync, SMS, Etc/. Device Hello. cab WCELoad. exe Hello. dll(s) . NET CF Class Libs . NET CF. cab Per-Processor/OS and Language Package . NET CF. cab . NET CF CLR
More Deployment Options Windows + Visual Studio. NET Hello. cab . NET CF. cab Desktop Executables Active. Sync, Add/Remove Programs, Etc. Setup. exe Windows Device Setup. exe Hello. cab Hello. exe Hello. dll(s) . NET CF. cab + Desktop Executables . NET CF. cab . NET CF CLR
Working with data: SQL Server CE � Limited subset of SQL Server functionality � Good for: ◦ Persistent storage locally ◦ Persistent storage for occasionally-connected applications and large sets of data ◦ Merge Replication � Currently, SQL Server CE requires an additional installation
Working with data: SQLite � SQLite adalah database bukan client-server, dia bersifat stand-alone � Hanya terdiri dari 1 file ◦ Berekstensi: . db 3 � Perlu download file DLL tambahan agar bisa koneksi: ◦ System. Data. SQLite � Secure, bisa menggunakan bahasa SQL � Bersifat lokal
Working with data: XML � Good for: ◦ Persistent storage of smaller sets of data �Local storage �Occasionally-connected computing ◦ Not as secure as SQL Server CE
How Compact ? File Size Classes NETCF Desktop % NETCF Desktop “MSCor. EE” 400 K* 2. 2 M 18% N/A MSCor. Lib 200 K 2 M 10% 364 System 100 K 1. 2 M 8% System. Drawing 20 K 458 K System. Web. Services 67 K 503 K System. Windows. Forms 56+55 K 2 M System. XML 138 K 1. 2 M Methods NETCF Desktop N/A N/A 1286 28% 3989 13817 29% 140 765 18% 1090 6953 16% 5% 41 254 16% 385 3509 11% 13% 54 274 20% 302 2083 14% 5% 43 823 5% 393 11337 3% 12% 100 724 14% 927 7227 13% *. NETCF file size of MSCor. EE is for Win 32/x 86 version % %
Framework Size � Framework size (RAM or ROM) ◦ � Running RAM needs ◦ � ~1. 5 MB 1 MB+ (depends on app) Typical application sizes ◦ ◦ 5 - 100 KB Apps often smaller due to use of platform features in the framework
- Slides: 33