.NET Framework & C#
<ul><li>.NET Framework </li></ul><ul><ul><li>Problem background </li></ul></ul><ul><ul><li>Solution </li></ul></ul><ul><ul...
Problems Background <ul><li>Good code is hard to write </li></ul><ul><li>All system features in any language </li></ul><ul...
Solution  (Common Language Runtime)  Managed Code in Common Language Runtime Requests for existing feature New CLR-Only Fe...
Solution  (Microsoft Intermediate Language) Different Languages are Compiled into MSIL Source code : Any languages MS Inte...
.Net platform features <ul><li>Automatic memory management </li></ul><ul><li>Explicit Versioning </li></ul><ul><li>OO feat...
Costs: <ul><li>OS got harder to write </li></ul><ul><li>More memory and CPU time </li></ul>
CLR structure
Compare with traditional ways C#  VB  C++  J-script  other Compiler Intermediate Language JIT  econoJIT  PreJIT  Executabl...
A simple example
Imports Microsoft.VisualBasic ' Declare the namespace that clients will use to access  ' the classes in this component Nam...
// Import the namespaces that this program uses, thereby allowing // us to use the short names of the functions inside the...
Assembly <ul><li>A logical collection of one or more exe and dll file containing an application’s code and resources </li>...
Metadata <ul><li>What classes and method it contains </li></ul><ul><li>What external objects it requires </li></ul><ul><li...
Manifest example (TimeComponent.dll) .assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )  // .zV.4.. ...
Private or Public <ul><li>Private </li></ul><ul><li>In client directory </li></ul><ul><li>Public (shared) </li></ul><ul><l...
Namespaces  <ul><li>A logical division within which a name need to be unique  </li></ul><ul><li>The best way to handle a l...
Versioning <ul><li>DLL Hell </li></ul><ul><li>Replacing a DLL used by an existing client, with a newer version (or vice ve...
Object oriented programming <ul><li>Whether to smarten up non-object oriented languages or dump down OO languages </li></u...
<ul><li>All .NET classes inherit from the base class System.Object </li></ul><ul><ul><li>Equals </li></ul></ul><ul><ul><li...
Cross-language inheritance  <ul><li>Because of the standardized IL architecture </li></ul><ul><li>you can inherit form a c...
.NET memory management  <ul><li>.NET CLR provides all languages with automatic memory management. </li></ul><ul><li>Garbag...
Interoperability with COM objects  <ul><ul><li>.NET Supports  interoperation with COM object  as client or server   via a ...
Using COM objects from .NET objects
Using .NET objects from COM objects
Transaction in .NET <ul><li>Transaction ensure the integrity of databases during complex operations </li></ul><ul><li>Nati...
Structured exception handling   <ul><li>.NET provides structured exception handling as a fundamental feature available in ...
Code access security   <ul><li>Most software comes from web </li></ul><ul><li>A user doesn’t know whether a Web code is sa...
Upcoming SlideShare
Loading in...5
×

Dot net framework

1,160

Published on

I am not the author of this file but wanted to collect it for study purpose.

Published in: Technology
1 Comment
0 Likes
Statistics
Notes
  • IT Pathshala, Noida-Sector-63, offers Guaranteed JOB with .NET Training Programs.

    PAY US ONLY IF YOU GET A JOB!

    CALL US - +91-9871350999 or +91-8800394970

    Technology Centre Address: H-110, Sector-63, Noida (UP)

    Program Takeaways:

    - GUARANTEED JOB in your technology domain
    - Live Major Project development
    - Experience Letter on Training Completion
    - Certification on Training Completion
    - Project Source Code available in CD

    Program Highlights:

    - 100% Guaranteed Job – Don’t pay us if you don’t get a JOB!
    - Industry Ready Courses
    - LIVE International Project Experience
    - Exposure to corporate culture at our IT services facility
    - Networking & Interaction with Industry Experts
    - Training Provided by a reputed IT Company
    - Live Project Source Code made available in CD
    - Technology certification and experience letter at program completion
    - Online Study Content

    CALL US - +91-9871350999 or +91-8800394970

    Our website: www.itpathshala.com
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Views
Total Views
1,160
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Dot net framework

  1. 1. .NET Framework & C#
  2. 2. <ul><li>.NET Framework </li></ul><ul><ul><li>Problem background </li></ul></ul><ul><ul><li>Solution </li></ul></ul><ul><ul><li>Common Language Runtime (CLR) </li></ul></ul><ul><li>MS Intermediate Language </li></ul><ul><ul><li>MSIL Structure </li></ul></ul><ul><ul><li>MSIL and Java bytecode </li></ul></ul><ul><li>Introduction to C# language </li></ul><ul><ul><li>C# Structure </li></ul></ul><ul><ul><li>C# Features </li></ul></ul>
  3. 3. Problems Background <ul><li>Good code is hard to write </li></ul><ul><li>All system features in any language </li></ul><ul><li>COM problems </li></ul><ul><li>Platform Interoperability </li></ul><ul><li>Automatic memory management </li></ul><ul><li>Object-Oriented features in and between all PLs </li></ul><ul><li>Safety & Security </li></ul><ul><li>Better Access to OS functions </li></ul><ul><li>Interoperate with COM (both as client & server) </li></ul>
  4. 4. Solution (Common Language Runtime) Managed Code in Common Language Runtime Requests for existing feature New CLR-Only Feature Common Language Runtime Managed Code Win 32 OS
  5. 5. Solution (Microsoft Intermediate Language) Different Languages are Compiled into MSIL Source code : Any languages MS Intermediate Language Platform specific code Development tools Just-In-Time compiler
  6. 6. .Net platform features <ul><li>Automatic memory management </li></ul><ul><li>Explicit Versioning </li></ul><ul><li>OO features in any languages </li></ul><ul><li>Accessing system functionality throw a hierarchical namespace </li></ul><ul><li>Code security </li></ul><ul><li>Interoperability with COM </li></ul>
  7. 7. Costs: <ul><li>OS got harder to write </li></ul><ul><li>More memory and CPU time </li></ul>
  8. 8. CLR structure
  9. 9. Compare with traditional ways C# VB C++ J-script other Compiler Intermediate Language JIT econoJIT PreJIT Executables .NET CLR Compiler C++ Executable Existing OS Machine hardware
  10. 10. A simple example
  11. 11. Imports Microsoft.VisualBasic ' Declare the namespace that clients will use to access ' the classes in this component Namespace TimeComponentNS Public Class TimeComponent Public Function GetTime(ByVal ShowSeconds As Boolean) As String If (ShowSeconds = True) Then Return Now.ToLongTimeString Else Return Now.ToShortTimeString End If End Function End Class End Namespace TimeComponent.vb
  12. 12. // Import the namespaces that this program uses, thereby allowing // us to use the short names of the functions inside them. using System ; using TimeComponentNS ; class MainApp { // The static method &quot;Main&quot; is an application's entry point public static void Main() { // Declare and create a new component of the class // provided by the VB server we wrote TimeComponent tc = new TimeComponent ( ) ; // Call the server's GetTime method. Write its // resulting string to a console window. Console.Write (tc.GetTime (true)) ; } } using System ; using TimeComponentNS ; class MainApp { public static void Main() { // Declare and create a new component of the class // provided by the VB server we wrote TimeComponent tc = new TimeComponent ( ) ; // Call the server's GetTime method. Write its // resulting string to a console window. Console.Write (tc.GetTime (true)) ; } } Timeclient.cs
  13. 13. Assembly <ul><li>A logical collection of one or more exe and dll file containing an application’s code and resources </li></ul><ul><li>It contains </li></ul><ul><li>1-Codes in MSIL </li></ul><ul><li>2-Manifest </li></ul><ul><li>A metadata description of the code and resources </li></ul>
  14. 14. Metadata <ul><li>What classes and method it contains </li></ul><ul><li>What external objects it requires </li></ul><ul><li>What version of code it represents </li></ul>
  15. 15. Manifest example (TimeComponent.dll) .assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .zV.4.. .ver 1:0:2411:0 } .assembly extern Microsoft.VisualBasic { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: .ver 7:0:0:0 } .assembly TimeComponent { .hash algorithm 0x00008004 .ver 0:0:0:0 } .module TimeComponent.dll // MVID: {144ACC38-E825-45C4-83A6-C2A9E5A901DD} .imagebase 0x00400000 .subsystem 0x00000002 .file alignment 512 .corflags 0x00000001 // Image base: 0x032a0000
  16. 16. Private or Public <ul><li>Private </li></ul><ul><li>In client directory </li></ul><ul><li>Public (shared) </li></ul><ul><li> In Global Assembly Cache (GAC) </li></ul><ul><li>winntassembly </li></ul>
  17. 17. Namespaces <ul><li>A logical division within which a name need to be unique </li></ul><ul><li>The best way to handle a large list of system objects and functions </li></ul><ul><li>System namespace (implemented in several separated DLLs </li></ul><ul><li>We can import a namespace </li></ul><ul><li>Your code can have its own namespace </li></ul>
  18. 18. Versioning <ul><li>DLL Hell </li></ul><ul><li>Replacing a DLL used by an existing client, with a newer version (or vice versa) </li></ul><ul><li>.NET provides a standard way to specify </li></ul><ul><li>version </li></ul><ul><li>Each client assembly uses its own specified versions of related assemblies </li></ul>
  19. 19. Object oriented programming <ul><li>Whether to smarten up non-object oriented languages or dump down OO languages </li></ul><ul><li>.NET provides all languages with inheritance and constructors features </li></ul><ul><li>Virtual Object Model </li></ul>
  20. 20. <ul><li>All .NET classes inherit from the base class System.Object </li></ul><ul><ul><li>Equals </li></ul></ul><ul><ul><li>GetHashCode </li></ul></ul><ul><ul><li>GetType </li></ul></ul><ul><ul><li>ToString </li></ul></ul>
  21. 21. Cross-language inheritance <ul><li>Because of the standardized IL architecture </li></ul><ul><li>you can inherit form a class in another </li></ul><ul><li>language </li></ul><ul><li>For example: </li></ul><ul><li>System.Object </li></ul>
  22. 22. .NET memory management <ul><li>.NET CLR provides all languages with automatic memory management. </li></ul><ul><li>Garbage collector automatically removes </li></ul><ul><li>unreferenced objects </li></ul><ul><li>You can force a garbage collection manually </li></ul>
  23. 23. Interoperability with COM objects <ul><ul><li>.NET Supports interoperation with COM object as client or server via a runtime callable wrapper or a COM Callable Wrapper </li></ul></ul>
  24. 24. Using COM objects from .NET objects
  25. 25. Using .NET objects from COM objects
  26. 26. Transaction in .NET <ul><li>Transaction ensure the integrity of databases during complex operations </li></ul><ul><li>Native .NET objects can also participate in transactions with a simple attribute </li></ul>
  27. 27. Structured exception handling <ul><li>.NET provides structured exception handling as a fundamental feature available in and between all languages </li></ul><ul><li>The exception handler can tell exactly where the exception originated by using a stack trace </li></ul>
  28. 28. Code access security <ul><li>Most software comes from web </li></ul><ul><li>A user doesn’t know whether a Web code is safe or not </li></ul><ul><li>.NET allows an administrator to specify privileges that each managed code has. </li></ul><ul><li>You can specify these privileges in three level </li></ul><ul><li>by modifying XML-based files </li></ul><ul><ul><li>Enterprise </li></ul></ul><ul><ul><li>Machine </li></ul></ul><ul><ul><li>User </li></ul></ul><ul><li>winntmicrosoft.netframework[c.v.]config </li></ul>

×