1 / 22

Lesson 1 What is .NET

Lesson 1 What is .NET. Prepared by Shawn Dossie Microsoft SA @ NYIT. Learning Objectives. By the end of this week you will be able to: Understand the reasons for the creation .NET Learn the core goals of the .NET initiative

rusk
Télécharger la présentation

Lesson 1 What is .NET

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lesson 1What is .NET Prepared by Shawn Dossie Microsoft SA @ NYIT

  2. Learning Objectives • By the end of this week you will be able to: • Understand the reasons for the creation .NET • Learn the core goals of the .NET initiative • Describe at a high level of detail the core components of the .NET Framework.

  3. The Need For .NET • Complexity of Software development process • Distributed systems • Development time • Version control & updates (The end to DLL Hell!) • Language Interoperability (Replaces COM Model) • Componentized-based Software Engineering (Lego-block dev.) • Security • Making Services available to users anywhere in the world

  4. The Objectives of .NET • To provide a consistent object-oriented programming environment whether object code is stored and executed locally, executed locally but Internet-distributed, or executed remotely. • To provide a code-execution environment that minimizes software deployment and versioning conflicts. • To provide a code-execution environment that guarantees safe execution of code, including code created by an unknown or semi-trusted third party.

  5. The Objectives of .NET (cont.) • To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments. • To make the developer experience consistent across widely varying types of applications, such as Windows-based applications and Web-based applications. • To build all communication on industry standards to ensure that code based on the .NET Framework can integrate with any other code.

  6. The Objectives of .NET (Quick and Dirty Overview) • Consistent programming model • Simplified programming model • Run once, run always • Simplified deployment • Wide platform reach • Programming integration • Simplified code reuse • Automatic memory management • Type safe verification • Rich debugging support • Consistent method failure paradigm • Security • Interoperability

  7. The Implementation of the Goals of .NET Initiative • The .NET Framework is the real software product that meets objectives and requirements of the .NET initiative

  8. The .NET Framework in Context

  9. Main Components of the .NET Framework • Common Language Runtime (CLR) • Foundation Class Library (FCL)

  10. Common Language Runtime (CLR) • Considered the foundation of the .NET Framework • Thought if as an agent that: • Manages code at runtime, providing core services as: • Memory management • Thread management • Enforcing strict type safety (CTS) • Code access security

  11. Common Type System • Ensures compatibility between . NET Types. • All Primitive data types for all .NET compliant languages are .NET types. • These types are converted to IL during the compilation process.

  12. Developer Benefits from the CLR • The CLR provides the following benefits to developers using .NET: • Automatic object referencing and garbage collection. Solves two BIG problems: • Invalid memory references • Memory Leaks • Accelerated productivity • ALL .NET compliant Languages can access, consume, and use all features of the .NET framework.

  13. Foundation Class Library (FCL) • An extensive, object-oriented library of classes (types) that provide the core functionally of .NET. • Tight integration with the CLR • Extensible; you can derive your own types form existing types. • Common programming tasks are handled efficiently and logically. Some examples are: • String management • Data collections • File access • Windows/Web UI And Services • Database connectivity

  14. Specialized Applications • The FCL inherently supports these typical development scenarios, providing specialized types for ease of implementation: • Console Apps • Windows Apps • ASP.NET Apps • Web Apps • XML Web Services • Windows Services

  15. The Structure of a .NET Application • The primary unit of a .NET application is the assembly. • An assembly is a self-describing collection of code, resources, and metadata. • The assembly manifest stores information about the contents of an assembly. • The assembly manifest provides: • Identity information, such as the assembly’s name and version number • A list of all types exposed by the assembly • A list of other assemblies required by the assembly • A list of code access security instructions, including permissions required by the assembly and permissions to be denied the assembly • Each assembly has one and only one assembly manifest • The assembly manifest can be contained in its own file or within one of the assembly’s modules.

  16. The Structure of a .NET Application (cont.) • Types are templates that describe a set of data encapsulation and functionality. • There are two kinds of types: • Reference types (classes) • Value types (structures). • Each type is described to the common language runtime in the assembly manifest. • A type can contain: • Fields • A field represents storage of a particular type of data. • Properties • Properties are similar to fields, but properties usually provide some kind of validation when data is set or retrieved. • Methods • Methods represent behavior.

  17. Compilation of a .NET Application • When you compile a .NET application, it is not compiled to binary machine code; rather, it is converted to IL. • The application consists of one or more assemblies consisting of executable files and DLL files in IL form. At least one of these assemblies will contain an executable file that has been designated as the entry point for the application.

  18. Execution of a .NET Application • Execution of a .NET Application • The first assembly is loaded into memory. • At this point, the common language runtime examines the assembly manifest and determines the requirements to run the program. • The CLR examines security permissions requested by the assembly and compares them with the system’s security policy. • If the system’s security policy does not allow the requested permissions, the application will not run. • If the application passes the system’s security policy, the CLR executes the code. • It creates a process for the application and begins application execution.

  19. Execution of a .NET Application (cont.) • When execution starts, the first bit of code that needs to be executed is loaded into memory compiled into native binary code from IL by the common language runtime’s Just-In-Time (JIT) compiler. • Once compiled, the code is executed and stored in memory as native code. • Thus, each portion of code is compiled only once when an application executes. • Whenever program execution branches to code that has not yet run, the JIT compiler compiles it ahead of execution and stores it in memory as binary code. This way, application performance is maximized because only the parts of a program that are executed are compiled.

  20. Summary • .NET was needed because Software is hard to develop; and it is just getting harder with the passage of time. • .NET solves many development problems by standardizing certain elements of the programming environment. • The Common Language Runtime and the Foundation Class Library are the core components of the .NET Framework. These components are what make the promises of .NET real. • .NET applications are not complied like traditional applications.

  21. References • .NET Framework Developer's Guide (inside help docs) • Applied . Net Framework Programming, Richter; Microsoft Press 2002 • Introducing Microsoft .NET, Platt; Microsoft Press 2001;

  22. Any Questions?

More Related