NET is a software framework developed by Microsoft which provides a controlled programming environment where development, installation and execution of the software can be done on windows based operating system. The .NET Training offers knowledge about .NET framework that supports the building and running of next gen applications and XML web services.
1. The .NET FrameworkThe .NET Framework
• What is
Microsoft .NET?
– A programming
model: CLR +
Classes
– XML Web services
– Server and Client
software and tools
2. Common Language Runtime (CLR)Common Language Runtime (CLR)
• It’s a VM (Java-like) on which any (supported)
language can run.
• Why a VM?
– Memory Protection
– Cross-language
– Support for strong-typing across languages (the data
are typed)
– Thread support
• JIT compilation in the VM
3. Languages in CLRLanguages in CLR
• Language of choice is C# (“C-sharp”) a Java-like language
– No inner classes
– Better type checking
• Other languages will run on CLR, but only within the CLR
constraints
– Visual Basic, JScript are full fledged CLR languages
– For example, only C++ that is VM-safe will run
– That subset looks much like C#
• Under CLR, all languages get object features
– Inheritance used extensively
– Every language gets constructors
4. Languages compile to MSILLanguages compile to MSIL
• Languages compile to MSIL (Microsoft
Intermediate Language)
– Can you say “bytecodes”?
• MSIL is shipped in portable executable
(PE) units
– Can you say .class files or applets?
• An application is made up of assemblies
5. AssembliesAssemblies
• In general, a static
assembly can consist of
four elements:
– The assembly manifest,
which contains assembly
metadata.
– Type metadata.
– Microsoft intermediate
language (MSIL) code
that implements the
types.
– A set of resources.
6. Assemblies can be spread acrossAssemblies can be spread across
.NET.NET
7. Assemblies are the security unitAssemblies are the security unit
• Each assembly has a set of corresponding
grants
• Each grant allows certain permissions
– DnsPermission, Environment, FileDialog, FileIO,
IsolatedStorage, Reflection, Registry, Security, UI,
WebPermission, SocketPermission
• The set of grants establishes a security
policy
8. Class LibraryClass Library
• Data classes support persistent data
management and include SQL classes.
– XML classes enable XML data manipulation
and XML searching and translations.
• Windows Forms support development of
Windows GUI applications across CLR
• Web Forms include classes that enable you
to rapidly develop web GUI applications.
10. Web, Windows, WhateverWeb, Windows, Whatever
• Part of the idea is to smooth transitions
between Windows and Web
• Web interfaces become easier for Windows
developers
• Windows apps become .NET Web-based
apps
11. Data <-> XML, EverywhereData <-> XML, Everywhere
• All CLR data can be
serialized to XML
• All XML can be expanded
into CLR data
• Thus, anything can be
shipped around on the
Web
• Typing through XML
Schema
16. Another Example InstanceAnother Example Instance
<e:Book>
<author>Henry Ford</author>
<preface>Prefatory text</preface>
<intro>This is a book.</intro>
</e:Book>
19. Reading in XML DataReading in XML Data
XmlReader reader
= new
XmlTextReader("http://foo.com/don.xsd");
XmlSchema schema = XmlSchema.Load(reader, null);
schema.Compile(null); // turn xml into objects
reader.Close();
20. ALL Interprocess CommunicationALL Interprocess Communication
via SOAPvia SOAP
• ALL Interprocess communication (across
network or on same machine) is through
SOAP
– Simple Object Access Protocol
– It’s a way of exchanging data and even calling
other methods/threads, all via XML and plain
old HTTP requests
23. ASP.NETASP.NET
• ASP =>
Active Server Pages
– Put most of the
computation in the server
• Very simple model to
use
• ADO.NET is the
database connection part
24. Calling Web ServicesCalling Web Services
• Any class can be converted into an XML Web Service with just a
few lines of code, and can be called by any SOAP client.
25. Take-away lessonsTake-away lessons
• VM’s are important
– Even Microsoft thinks so
• Distributed apps are important, but to do so
requires standard protocols
– Ways of serializing data
– Ways of doing RPC
26. Limitations of the .NET FrameworkLimitations of the .NET Framework
• What if you’re not on the network?
– Maybe that’s not an issue?
• Mapping between XML and any object is
hard
– Any object is controlled by compiler.
XML can be written by anybody with a text
editor.
– There’s a whole bunch of class support for
modified serializers and compilers
Editor's Notes
Type metadata is information about the data types. Resources are things that are needed by the assembly like images and sounds.
A single assembly can be distributed across the network. The resources might be on one machine and the some of the code on another.
Windows Forms is a framework (set of classes) for developing Windows GUI applications. Web Forms is a framework for developing Web-based GUI applications.
Unlike other OO languages the methods start with a capital letter.
Notice that all that is saved in XML is the instance variables.
This is an XML schema to represent instance variables for a Person object.
This is an example instance that uses the XML schema from the previous page.
These are the common language types supported. You can subclass these to allow XML mapping for your classes.
This C# code will read in XML from a location and uses the Compile method to get the CLR objects from the XML.
This slide shows the request of GetLastTradePrice for the DIS (Disney) stock symbol.
This shows the SOAP response with the price for the Disney symobl.
This shows an XML representation of an order in a pet store.
One of the problems of using XML to represent objects is that people can edit and change the XML and what do you do with it if it doesn’t match the class definition. Also the class definition might change and then what do you do with older XML versions?