Web Services and .NET

Download Report

Transcript Web Services and .NET

Università di Pisa
.Net Overview
Giuseppe Attardi
Università di Pisa
A problem of communication
Applicatio
n
Code and data
structures
Before RPC-style models,
applications were completely
separate entities with little or
no integration…
A problem of communication
…but with RPC or COM,
you still have to write
‘plumbing’ code and can’t
directly interact…
The .NET Approach
… a common language
runtime provides
components a common
substrate. No “plumbing” is
needed and objects can
directly interact.
.NET Framework and Tools
VB
C++
C#
…
J#
Common Language Specification
ASP .NET
Web Forms Web Services
Mobile Internet Toolkit
Windows
Forms
ADO .NET and XML
Base Class Library
Common Language Runtime
Operating System
Common Language Runtime
Common Type System
 Metadata
 Execution Engine

Common Language Runtime
Base Class Library Support
Thread Support
COM Marshaler
Type Checker
Exception Manager
Security Engine
Debug Engine
IL to Native
Compilers (JIT)
Code
Manager
Class Loader
Garbage
Collector
Intermediate Language (IL)
VB
VC
...
Script
IL
Common Language Runtime
JIT
Compiler
Native
Code
Assembly
Language
of CLR
Code is
never
interpreted
Compilation and Execution
Compilation
Source
Code
Language
Compiler
Native
Code
JIT
Compiler
Execution
Code (IL)
Assembly
Metadata
At installation or the
first time each
method is called
.NET Languages










C#
C++
Visual Basic
APL
COBOL
Eiffel
Forth
FORTRAN 95
F#
Haskell










Mercury
Mondrian
Oberon
Pascal
Perl
Python
RPG
S#
Scheme
SML
.NET Framework Class Library
System.Web
Services
Description
Discovery
Protocols
UI
HtmlControls
WebControls
Caching
Configuration
Security
SessionState
System.Windows.Forms
Design
ComponentModel
System.Drawing
Drawing2D
Imaging
System.Data
OleDb
Common
Printingy
Text
System.Xml
SqlClient
SQLTypes
XSLT
XPath
Serialization
System
Collections
Configuration
Diagnostics
Globalization
IO
Net
Reflection
Resources
Security
ServiceProcess
Text
Threading
Runtime
InteropServices
Remoting
Serialization
Simpler Development

Completely eliminates plumbing
– No registration, GUIDs, .IDL files,
HRESULTs, IUnknown, AddRef/Release,
CoCreateInstance, etc.

Object Oriented to the core
– Classes and inheritance fully supported
– Even across languages!

Seamless integration
– Any .NET class can be used as a COM
class with zero extra work
– COM classes can be imported as
.NET classes
Robust And Secure

Automatic lifetime management
–
–
–
–

All .NET objects are garbage collected
No stray pointers, memory leaks
Multi-generational mark-and-compact GC
Self-configuring, dynamically tuning
Exception handling
Robust And Secure

Several compilation models
– Native (e.g. Managed C++)
– CIL (e.g. VB and C#)
– No interpreter: install-time or run-time IL to native
compilation

Code correctness and type-safety
– CIL can be verified to guarantee type-safety
– No unsafe casts, no uninitialized variables,
no out-of-bounds array indexing

Evidence-based security
– Based on origin of code as well as user
– Extensible permissions
Multi-Language Platform

The freedom to choose language
– All features of .NET platform available
to any .NET programming language
– Application components can be
written in multiple languages

Highly leveraged tools
– Debuggers, profilers, code coverage
analyzers, etc. work for all languages
Simpler Deployment And Management

Assemblies
– The unit of deployment, versioning,
and security
– Like DLLs, but self-describing
through manifest


Zero-impact install
Side-by-side execution
– Multiple versions of the same component
can co-exist
.NET Classes

Namespaces and Classes
– Hierarchical, unified, extensible class libraries
– Provide “system” and base functionality and
services
– Everything is an object!

Interfaces
– The .NET (Service) contracts

Types
– Byte, Sbyte, Single, Double, String, Int16, Int32,
Int64, …
– Common Type System
Shared Source CLI (Rotor)





Non-commercial implementation
Available for research, academic and
other non-profit use
Written in C#, on top of PAL
Available for FreeBSD, Linux and
WinXP
http://dotnet.di.unipi.it
Comparison

Java
– One language
– Multiple platforms

.NET
– Multiple languages
– Multiple platforms
•Windows
•FreeBSD (Rotor)
•Linux, GNU (in progress)
•Mono Project (Ximian)