Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Program Execution in the 21 st Century Modern Software Development in.NET and C# A webcast series for C++, Java, and VB6 developers – Part 1 of 15: [

Similar presentations


Presentation on theme: "1 Program Execution in the 21 st Century Modern Software Development in.NET and C# A webcast series for C++, Java, and VB6 developers – Part 1 of 15: ["— Presentation transcript:

1 1 Program Execution in the 21 st Century Modern Software Development in.NET and C# A webcast series for C++, Java, and VB6 developers – Part 1 of 15: [ http://www.lakeforest.edu/~hummel/webcasts.htm ] http://www.lakeforest.edu/~hummel/webcasts.htm Joe Hummel, PhD Software Architect, Author & Professor Barracuda.NET:JoeHummel@Barracuda.net JoeHummel@Barracuda.net Lake Forest College: hummel@lakeforest.edu hummel@lakeforest.edu

2 2 "Modern Software Dev in.NET and C#" A series for C++, Java, and VB6 developers PPT-based lectures Lab exercises — i.e. homework! DateTopic 1. Tues, March 1 Program Exec in the 21 st Century 2. Tues, March 15 Classes, Components & Namespaces 3. Tues, March 22 Modern OO Programming in C# 4. Tues, March 29 Class Design for the.NET Framework...... 15. Tues, June 28 The Microsoft.NET Team System

3 3 Session Prerequisites This is an intro of how.NET executes an app Prereqs:developer object-based programming experience Level 200

4 4 Today's objectives “ The days of compiling and linking a program to produce a single native executable (.EXE) are coming to an end. While program execution in Windows ® has long been DLL-based (dynamic linking), with.NET we are moving towards a virtual machine model of execution… ” Topics: Topics: Managed Execution Component-Based Design Deployment

5 5 Agenda Managed Execution Component-Based Design Assembly Resolution Deployment

6 6 Managed Execution Idea: modern software executes within run-time environment why? portable and safer execution… Hardware Operating System Run-time Environment Your Application

7 7 Java Based on run-time environment called JVM JVM = Java Virtual Machine JCL = Java Class Library x86 Windows JVM PPC Mac OS JVM ARM Palm OS JVM Java Application … … JVM JCL

8 8.NET Based on CLR and FxCL CLR = Common Language Runtime FxCL = Framework Class Library Hardware Operating System Common Language Runtime.NET Application.NET Framework Class Library

9 9 Software Development in.NET Pick your language and platform… x86 Windows CLR ARM Pocket PC CLR PPC FreeBSD CLR x86 Linux CLR … … CLR.NET Application FxCL VBC#C++J#…

10 10 Implications… Your clients must have the.NET Framework available via Redistributable.NET Framework (20MB) 3 versions: v1.0 (2002), v1.1 (2003), v2.0 (june 2005?) Windows 2003 ships with v1.1 otherwise correct version must be installed Design trade-off:  portable  safer execution (memory management, security, …)  slower?

11 11 Managed code C#, VB, J# compilers generate managed code code that requires CLR to run & manage C++ plays a dual role: generates managed code (i.e..NET dll/exe) generates unmanaged code (i.e. native dll/exe) common for OS work, legacy apps, etc.

12 12 CIL CIL = Common Intermediate Language CIL is the assembly language of the CLR managed code == CIL code // adds 2 integers together and returns the result… public int Add(int x, int y) { return x + y; } C:\> ildasm app.exe

13 13 Agenda Managed Execution Component-Based Design Assembly Resolution Deployment

14 14 Apps are Component-Based Apps consist of 1 or more components (DLLs) Example: typical n-tier design Front-end object DB GUI.exe business.dll data.dll

15 15.NET is Component-Based CLR and FxCL are components: CLR = Common Language Runtime FxCL = Framework Class Library CLR (MSCOREE.dll) CLR (MSCOREE.dll) JIT Compiler Process Underlying OS and HW Core FxCL (MSCOR LIB.dll) Core FxCL (MSCOR LIB.dll).DLL.EXE obj code additional FxCL components (DLLs)

16 16 Assemblies.NET components are called assemblies Unit of deployment in.NET 1 assembly = 1 or more compiled source files Visual Studio.NET.EXE /.DLL code.vb code.cs assembly

17 17 Where are FxCL assemblies? FxCL assemblies are stored in the GAC GAC = Global Assembly Cache LocalSharedVersion-awareSecureTamper-proof Some pre-JIT

18 18 Agenda Managed Execution Component-Based Design Assembly Resolution Deployment

19 19 Assembly Resolution CLR must be able to locate correct assemblies FxCL assemblies as well as our own assemblies CLR JIT Compiler Process Core FxCL Core FxCL.DLL.EXE obj code additional FxCL components (DLLs)

20 20 Executive Summary… Returning to the days of old, i.e. DOS-like.NET applies a well-known search algorithm (like a path) can customize search via.config file (like an.ini) no use of registry!

21 21 Resolution Algorithm 1..NET figures out what version is needed 2..NET searches GAC ( Global Assembly Cache ) 3. If not found and.config file is present then.NET searches where configured to else.NET searches directory containing.EXE else.NET searches directory containing.EXE 4. If not found then application terminates with error

22 22 Typical n-tier app…

23 23 How does.NET know version, etc.? Compiled into.DLL/.EXE as manifest use ILDASM tool to peek inside assembly ILDASM = Intermediate Language Disassembler manifest reveals dependencies, versions, etc. C:\> ildasm CustomerGUI.exe

24 24 Observations… Manifest contains reference to assembly name, version #, hash of public key token, etc. Manifest does not contain: code for assembly registry information (no more GUIDs!) location information (.NET uses search path)

25 25 Implications No more registry!.NET uses well-defined search path No more DLL hell! applications never use the wrong version unless you say so via.config file Config file hell? machine config, user config, app config, etc.

26 26 How are assemblies referenced? Tracked via References folder in VS project You can add more:

27 27 Agenda Managed Execution Component-Based Design Assembly Resolution Deployment

28 28 Deployment Options 1. Install assemblies in same dir as.EXE  simplest, called xcopy deployment 2. Install some in.EXE dir, remainder in GAC  GAC allows you to share, install multiple versions 3. Custom deployment via.config file  allows custom location, e.g. on a server 4. "Zero-touch" deployment  clients install via URL:  clients install via URL: http://server/app/app.exehttp://server/app/app.exe  app can update itself periodically  improved ClickOnce coming in VS 2005

29 29 Lots of deploymet details… How do you write.config files? How do you put something in the GAC? Assign a version number? Make an assembly tamper-proof? Topics for webcast #11: Tues, 31 May 2005

30 30 That’s it for today! Thank you for participating Next webcast: DateTopic TODAY Program Exec in the 21 st Century 2. Tues, March 15 Classes, Components & Namespaces 3. Tues, March 22 Modern OO Programming in C# 4. Tues, March 29 Class Design for the.NET Framework...... 15. Tues, June 28 The Microsoft.NET Team System

31 31 Additional Resources Web site for slides, demos, homework: http://www.lakeforest.edu/~hummel/webcasts.htm Resources: J. Richter, " Applied Microsoft.NET Framework Programming " Rocky Lhotka, “ Expert C# Business Objects ” Juval Löwy, “ Programming.NET Components ” Zero-touch deployment: http://msdn.microsoft.com/msdnmag/issues/04/05/clickonce/default.aspx http://www.gotdotnet.com/team/windowsforms/appupdater.aspx http://msdn.microsoft.com/msdnmag/issues/04/10/Bootstrapper/ http://msdn.microsoft.com/msdnmag/issues/02/07/NetSmartClients/default.aspx http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchno- touchdeploymentinnetframework.asp

32 32


Download ppt "1 Program Execution in the 21 st Century Modern Software Development in.NET and C# A webcast series for C++, Java, and VB6 developers – Part 1 of 15: ["

Similar presentations


Ads by Google