1 / 29

The .Net Framework

The .Net Framework. A Brief Overview. Introduction. Major shift in technology Like previous technologies, such as “ActiveX”, .Net is more a brand than a single technology. Main parts. .Net framework Visual Studio.Net .Net My services .Net Enterprise Servers. .Net Framework.

bern
Télécharger la présentation

The .Net Framework

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. The .Net Framework A Brief Overview

  2. Introduction • Major shift in technology • Like previous technologies, such as “ActiveX”, .Net is more a brand than a single technology.

  3. Main parts • .Net framework • Visual Studio.Net • .Net My services • .Net Enterprise Servers

  4. .Net Framework • An environment for creating applications • Previously there was DNA • Distributed interNet Architecture • More marketing than anything else • E.g., COM, DCOM, ADO, ActiveX, ASP, VB, C++ • MS DNA didn’t provide a common foundation for application development. • Scripting vs. compiled; calls to OS; separate runtime libraries; separate types; no common architecture • MS DNA grew incrementally without any real master plan by different groups at different times within MS.

  5. .Net Framework • For MS DNA technologies, COM was the glue: provides common conventions for interfaces etc. DCOM provides remote access to binaries etc. • http://www.microsoft.com/com/default.mspx • Foundation for OLE and ActiveX • Standard and object model

  6. .Net Framework • With .Net, this “glue” technology is unnecessary. • Where there firewall issues with COM? • .Net uses the http ports

  7. .Net Framework Applications Browser Web Services Local Other .Net Framework Class Library ASP.NET ADO.NET Windows Forms Enterprise Services Common Language Runtime Windows

  8. .Net Framework • Software written to run within the framework is called managed code. • The objects created by developers can inherit the Framework’s Class Library code. • For example, ASP web pages inherit the Class Library’s Page class.

  9. Framework Class Library • Organized as a hierarchy of namespaces • For example, the class that creates a connection to a SQL Server database is in the namespace • System.Data.SQLclient

  10. Connection, DataAdpater System Windows Data Web Forms SqlClient This library is huge!

  11. Standard Class Library • Standard class libraries aren’t new. • The point of such libraries is to speed development and increase the quality of software. • A problem with such libraries is that they can become so large and complex that they are unusable. Abstraction isn’t free. Complexity doesn’t go away… • The basic trade-off is between power and complexity. As a library becomes more powerful, it becomes more complex. • Fortunately, a developer can use a subset of the library and ignore what isn’t relevant.

  12. Common Language Runtime • The CLR provides a standard implementation for a modern object-oriented programming language. • What does this mean actually? • “Once you have learned how to program, it is easy to pick-up or learn other languages.” [true?] • Syntax versus semantics

  13. Common Language Runtime • Syntax vs. Semantics • Although the syntax of most modern programming languages differ, the underlying abstractions are very similar. • The CLR provides the semantics that any language can be mapped to. Thus syntax and semantics are separated. (staple concept in compiler design) • Benefits? • Portability (at least for mobile devices etc) • Better security because it will not contain arbitrary memory addresses and the like. It is easier to create a “sand-box” in which the application can “play.” Scope security.

  14. Common Language Runtime • Syntax vs. Semantics • But won’t this lead to slower execution? • Could. It depends on the application • Similar arguments used by Sun to justify the slower speed of Java. • Hardware is getting faster…

  15. Common Language Runtime • The CLR provides technologies for packaging and executing managed code. • When managed code is compiled, two things are produced: Microsoft Intermediate Language MSIL and metadata.

  16. Common Language Runtime Compilation (Default.aspx.cs) Source Code Language Compiler MSIL, MetaData Execution Machine Specific Binary JIT Compiler

  17. When I do a “build” of my managed code, it is compiled into MSIL along with it’s metadata as a Portable Executable (PE). This file can be a DLL or an EXE file. This is the actual file that the Web sever will JIT compile into a machine specific binary when a managed object is requested for the first time.

  18. MSL • MSL is a set of CPU-independent instructions for performing operations etc (semantics). • Syntax  semantics  machine specific binary • VB.Net and C# have roughly the same capabilities • In fact, some of the syntax is interchangeable with the addition of “;” and “{}”s. Why? • Are the “language wars” over? • Why was BASIC (1960), Visual Basic (1991), and then VB.Net (2000) released? Or I should say “for whom?” • C# was created as an entirely new language. Why? Why not just create C++.Net? • C++ will remain the dominant platform for non.Net processor-specific binaries? Don’t know… • Object.method.property[something].somethingelse().tostring

  19. MSL • It is worth noting that the .Net Framework Class Library is written in C# • Some suggest that MS will eventually phase out VB and support only C#

  20. MetaData • Name, methods, properties, events etc • Think “Intelli-sense.” The dropdown list is populated from the metadata.

  21. Assemblies • Assemblies is how .Net organizes managed code. • An assembly is a logical construct. That is, there isn’t a file that contains the managed code files. • The list of files “contained” in an assembly is called the manifest. • A manifest is like metadata for the assembly

  22. Manifest • An assembly’s manifest contains the assembly’s name, it’s version number, dependencies and of course, the files contained in the assembly. • The manifest is stored as part of one of the files in the assembly. • Assemblies can eliminate “DLL hell.” • Multiple versions of an assembly can run at the same time thus removing potential conflicts

  23. Managed code is organized into Assemblies. The files in an assembly are identified by it’s Manifest. The System.Reflection Namespace provides a standard means of reading and interpreting an assemblies manifest. Reflection enables Visual Studio’s IntelliSense. A manifest contains it’s name, version number, language, list of files, other assemblies it relies on. This reduces the risk of exposure to DLL Hell. If the developer is careful about versioning, diverse assemblies can be installed side-by-side without conflict.

  24. Assembly for Web Projects? • If you create your presentation tier as a new web site • File > New > Web Site... • VS will not create an assembly of managed code • If you create your presentation tier as a new web application project • File > New > Project... • VS will create the assembly

  25. Assembly for Web Projects? • Web site is the default. The subfolder of the website project acts as an assembly. If the file is in the folder, it is part of the assembly. • Developers asked for a means to create explicit assemblies for web site projects. Especially for those created in VS 2003. The change from 2003 to 2005 was significant and conversion is not easy… A web application project allows the developer to explicitly specify project structure.

  26. Just-in-time compilation • Each method in an MSIL assembly is compiled only when it is first called. • Or if an assembly changes • Compiled code is not saved but recompiled again if needed (say after a reboot or the application is stopped) • What is the impact of JIT for deployment?

  27. Common Language Runtime • MSIL versus Java ByteCode • Very similar • ByteCode was designed to be either compiled or interpreted. MSIL was designed for compilation only • CLR versus Java Virtual Machine • Roughly equal

  28. JAVA Environment Applications Browser Web Services Local Other Standard Java Packages JavaServerPages JDBC Swing Enterprise JavaBeans Java Virtual Machine (VM) Windows, Solaris, Linux, Others

  29. Common Language Runtime • Java is write-once run-many; diverse operating systems • .Net focuses on Windows • The Java environment requires Java • .Net allows multiple languages

More Related