1 / 49

Microsoft .NET Framework

Microsoft .NET Framework. Overview. Svetlin Nakov. http:// www.nakov.com. Software Development Consultant, Part-time Computer Science Lecturer. Sofia University “St. Kliment Ohridski”. .NET Enterprise Vision. Users Any device, Any place, Any time.

violetaz
Download Presentation

Microsoft .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. Microsoft .NET Framework Overview Svetlin Nakov http://www.nakov.com Software Development Consultant,Part-time Computer Science Lecturer Sofia University“St. Kliment Ohridski”

  2. .NET Enterprise Vision UsersAny device,Any place,Any time XML Web ServicesIntegrate business applications and processes Authentication Scheduling Notification Back OfficeHeterogeneous application and server infrastructure Sales Customer Service ERP & Billing

  3. .NET Framework • Programming model for .NET • Platform for running .NET code in a managed environment • Provides a very good environment to develop networked applications and Web Services • Provides programming API and unified language-independent development framework • Code runs on multiple platforms (Windows, Linux, FreeBSD, …)

  4. The Core of .NETFramework: FCL & CLR • Common Language Runtime • Garbage collection • Language integration • Multiple versioning support for assemblies (no more DLL hell!) • Integrated security • Framework Class Library • Provides the core functionality: ASP.NET, Web Services, ADO.NET, Windows Forms, IO, XML, etc.

  5. .NET FrameworkCommon Language Runtime • CLR manages code execution at runtime • Memory management, thread management, etc. • Code-based security • Role-based security Common Language Runtime Operating System

  6. .NET FrameworkBase Class Library • Object-oriented collection of reusable types • Collections, I/O, Strings, … .NET Framework (Base Class Library) Common Language Runtime Operating System

  7. .NET FrameworkData Access Layer • Access relational databases • Disconnected data model • Work with XML ADO .NET and XML .NET Framework (Base Class Library) Common Language Runtime Operating System

  8. .NET FrameworkASP.NET & Windows Forms • Create application’s front-end – Web-based user interface, Windows GUI, Web services, … ASP .NET Web Forms Web Services Mobile Internet Toolkit Windows Forms ADO .NET and XML .NET Framework (Base Class Library) Common Language Runtime Operating System

  9. ASP .NET Web Forms Web Services Mobile Internet Toolkit Windows Forms ADO .NET and XML .NET Framework (Base Class Library) .NET FrameworkProgramming Languages • Use your favorite language C++ C# VB.NET Perl J# … Common Language Runtime Operating System

  10. C++ C# VB Perl J# … ASP .NET Web Forms Web Services Mobile Internet Toolkit Windows Forms ADO .NET and XML .NET Framework (Base Class Library) .NET FrameworkCommon Language Specification Common Language Specification Common Language Runtime Operating System

  11. ASP .NET Web Forms Web Services Mobile Internet Toolkit Windows Forms ADO .NET and XML .NET Framework (Base Class Library) .NET FrameworkVisual Studio .NET C++ C# VB Perl J# … Visual Studio .NET Common Language Specification Common Language Runtime Operating System

  12. Multiple Language Support • IL (MSIL or CIL) – Intermediate Language • It is low-level (machine) language, like Assembler, but is Object-oriented • CTS is a rich type system built into the CLR • Implements various types (int, float, string, …) • And operations on those types • CLS is a set of specifications that all languages and libraries need to follow • This will ensure interoperability between languages

  13. Example of MSIL Code .method private hidebysig static void Main() cil managed { .entrypoint // Code size 11 (0xb) .maxstack 8 IL_0000: ldstr "Hello, world!" IL_0005: call void [mscorlib]System.Console::WriteLine(string) IL_000a: ret } // end of method HelloWorld::Main

  14. .NET Languages • Languages provided by Microsoft • C++, C#, J#, VB.NET, JScript • Third-parties languages • Perl, Python, Pascal, APL, COBOL, Eiffel, Haskell, ML, Oberon, Scheme, Smalltalk… • Advanced multi-language features • Cross-language inheritance and exceptions handling • Single project can share code written in multiple languages • Integration is built in, not bolted on • No additional rules or API to learn

  15. C# Language • Mixture between C++, Java and Delphi • Component-oriented • Properties, Methods, Events • Attributes, XML documentation • All in one place, no header files, IDL, etc. • Can be embedded in Webapplications • Everything really is an object • Primitive types aren’t magic, e.g.5.ToString() is valid • Unified type system == Deep simplicity • Good extensibility and reusability

  16. C# Language – Example using System; class HelloWorld { public static void main() { Console.WriteLine(“Hello, world!”); } }

  17. Code Source Code Language Compiler MSIL Metadata Native Code JIT Compiler Code Compilation and Execution Compilation Also called Assembly (.EXE or .DLL file) - First time each method is called Execution - Install time precompilation

  18. VS.NET – Single Development Environment & Skill Set • From Visual Studio.NET you can: • Write code • Design user interface • Study documentation • Execute, test and deploy • Debug • Same tools for all languages • Same tools for all platforms • Same tools for all technologies

  19. Visual Studio .NET

  20. ASP.NET Web Forms Web Services Mobile Internet Toolkit Windows Forms The .NET Framework Library ADO.NET and XML Base Class Library

  21. System.Web System.WinForms Services UI Design ComponentModel Description HtmlControls Discovery WebControls Protocols System.Drawing Caching Security Drawing2D Printing Configuration SessionState Imaging Text System.Data System.Xml ADO SQL XSLT Serialization Design SQLTypes XPath System Collections IO Security Runtime InteropServices Configuration Net ServiceProcess Remoting Diagnostics Reflection Text Serialization Globalization Resources Threading .NET Framework Namespaces

  22. Base Class Library Namespaces System Collections Security Configuration ServiceProcess Diagnostics Text Globalization Threading IO Runtime InteropServices Net Remoting Reflection Serialization Resources

  23. Base Class Library • Data types, conversions, formatting • Collections: ArrayList, Hashtable, etc. • Globalization: Cultures, sorting, etc. • I/O: Binary and text streams, files, etc. • Networking: TCP/IP sockets, HTTP, etc. • Reflection: Metadata and IL emit • Security: Permissions, cryptography • Text: Encodings, regular expressions • Multithreading and synchronization • Remoting and serialization

  24. System.Data OleDb SQLClient Common SQLTypes System.Xml XSLT Serialization XPath Data And XML Namespaces

  25. ADO.NET And XML • ADO.NET consumes all types of data • XML (hierarchical), relational, etc. • Powerful in-memory data cache (DataSet) • DataSet contains various data objects: tables, views, relations, constraints, etc. • Lightweight, stateless, disconnected • Supports both relational and XML access • High-performance, low overhead stream access • Great XML support including: • W3C DOM, XSL/T, XPath, and Schema

  26. VS.NET – DataSet Designer

  27. Windows Forms Namespaces System.Windows.Forms Design ComponentModel System.Drawing Drawing2D Printing Imaging Text

  28. Windows Forms • Windows Forms is framework for building rich GUI applications • RAD (Rapid Application Development) • component-based • event-driven • Rich set of controls • Data aware components • Printing support • Unicode support • UI inheritance

  29. VS.NET – Windows Forms Designer

  30. Demo 1 • Create simple database application with: • Windows Forms • ADO.NET • MS SQL Server • Visual Studio .NET

  31. Application DataSet DataGrid Demo 1 – Architecture Database Microsoft SQL Server SqlConnection SqlDataAdapter Update Fill

  32. ASP.NET Namespaces System.Web Services UI Description HtmlControls Discovery WebControls Protocols Caching Security Configuration SessionState

  33. ASP.NET • Framework for building Web applications and Web services in any .NET language • C#, C++, VB.NET, JScript, etc. • Automatic multiple clients support • DHTML, HTML 3.2, WML, small devices • Compilation of ASP.NET Web applications into .NET assemblies • Cached the first time when called • All subsequent calls use the cached version • Separation of code and content • Developers and designers can work independently

  34. ASP.NET • Rich set of ASP.NET server controls • Data validation • Data bound grids • Event-driven execution model • Great Web-services support • Easy to deploy • High reliability and availability • High performance and scalability • Scalable handling of state information

  35. VS.NET – Web Forms Designer

  36. ASP.NET WebMatrix

  37. Demo 2 • Create simple Web-based database application with: • ASP.NET (Web Forms) • ADO.NET • MS SQL Server • MS Internet Information Server • Visual Studio .NET

  38. Web Application DataSet DataGrid Demo 2 – Architecture Database Microsoft SQL Server SqlConnection SqlDataAdapter Update Fill

  39. Web Services • Web Services are programmable components accessible remotely over the Web • Built on the standards HTTP, XML and SOAP • Each service is described in WSDL • Easy accessible from any client on any platform • “Request-response” execution model – like component-based programming over the Web • ASP.NET – Simple programming model for Web Services development • Author .ASMX files with normal class methods • ASP.NET compiles on demand, generates WSDL contract, exposes HTML test page

  40. Web Service Example in C# ParcelTracker.asmx <%@ WebService Language="C#" %> using System; using System.Web.Services; public class ParcelTrackerWebService { [WebMethod] public string GetOrderStatus(int orderNumber) { //Implementation here } }

  41. Demo 3 • Create simple Web Service with: • ASP.NET (Web Services) • MS Internet Information Server • Visual Studio .NET

  42. Shared Source CLI (Rotor) • Non-commercial CLI implementation, available as source code. Contains: • Managed execution environment for MSIL with JIT-compiler • Compiler for C# and Jscript • Set of development tools – ilasm, ildasm, cordbg, metainfo, … • Implemented entirely in C++ and C# • Compiles with MS Visual Studio .NET • Available for research, academic, teaching and other non-profit use • Works on FreeBSD, Windowsand Mac OS

  43. .NET Framework – Resources • Visit following web sites: • .NET Framework Home Site – http://msdn.microsoft.com/netframework/ • Microsoft .NET Framework Community – http://www.gotdotnet.com/ • ASP.NET – http://www.asp.net/ • .NET Windows Forms – http://www.windowsforms.net/ • O’Reilly .NET Community Site – http://www.ondotnet.com/ • Microsoft Patterns and Practices – http://msdn.microsoft.com/practices/ • Code Project – http://www.codeproject.net/

  44. .NET Framework – Resources • Visit following web sites: • Mono – Open Source .NET Framework – http://www.go-mono.org/ • Rotor – MS Shared Source .NET CLI – http://msdn.microsoft.com/net/sscli/ • .NET Framework Course in Sofia University– http://www.nakov.com/dotnet/ • Read the news groups: • .NET Framework Official News Group – news://msnews.microsoft.com/microsoft.public.dotnet.framework • The Bulgarian Developers’ Newsgroup –news://msnews.microsoft.com/microsoft.public.bg.developer

  45. Questions?

  46. My Questions • How can we create .NET Framework applications that run on mobile devices (such as mobile phones, PDA, handhelds, …)? • Answer: • Microsoft .NET Compact Framework • Standard part of MS Visual Studio .NET 2003

  47. My Questions • How can we precompile .NET assemblies to speedup their execution? Any standard tool? • Answer: • Use the tool ngen.exe • It is standard part of .NET Framework

  48. My Questions • MSIL is great for decompiling. How can we protect our .NET code from reverse engineering attacks? • Answer: • Use obfuscation tools like Dotfuscator

More Related