Yoon Joong Kim Department of computer Engineering
Hanbat National University
Yoon joong Kim
Contents
1. Microsoft .NET History
2. What is Microsoft .NET
- Goal/.NET Platform/issues and ideas
3. The Microsoft .NET Framework
4. Common Language Runtime
- Goal/Concepts/Compilation and execution/Services/Multiple Language
Support
5. Windows Form/Web Form/C#/ VB.NET
6. Web Programming
7. Web Services
8. Ex.1 An Simple Web Services Example
Page 2
Yoon joong Kim
1. History of .NET Framework(cont.)
Microsoft started development of the .NET Framework in the
late 1990s, originally under the name of Next Generation
Windows Services (NGWS). By late 2000 the first beta
versions of .NET 1.0 were released.
Version 1.0 of the .NET Framework was released in
February 2002 with visual studio .NET.
Version 3.0 is included with Windows Server 2008 and
Windows Vista.
Version 3.5 with Windows 7 and Windows Server 2008 R2.]
Version 4.0 alongside Visual Studio 2010.
Version 4.5 alongside Visual Studio 2012 for Windows Vista
or later. Support metro style apps for Windows 8.
Page 3
Yoon joong Kim
1. History of .NET Framework(cont.)
Goal
- .NET is a network platform whose goal is as follow:
the users(application or terminal device) that are connected to each
others on the network regardless of wire or wireless
communicate and transfer their information in the form of XML
from any device, anytime, anywhere. .
- Make it incredibly easy to build powerful web applications and web
services
The .NET Compact Framework added
- a reduced version of the framework
- Available on the Windows CE platforms including Windows Mobile
devices such as smartphones.
- for mobile or embedded device use.
- The .NET Micro Framework that is targeted at severely resource-
constrained devices.
Page 4
Yoon joong Kim
1. History of .NET Framework(cont.)
Generation Version number Release date Development tool Distributed with
1.0 1.0.3705.0 02002-02-1313 February 2002 Visual Studio .NET N/A
1.1 1.1.4322.573 02003-04-2424 April 2003 Visual Studio .NET 2003 Windows Server 2003
2.0 2.0.50727.42 02005-11-077 November 2005 Visual Studio 2005 Windows Server 2003 R2
3.0 3.0.4506.30 02006-11-066 November 2006 Expression Blend Windows Vista, Windows
Server 2008
3.5 3.5.21022.8 02007-11-1919 November 2007 Visual Studio 2008 Windows 7, Windows
Server 2008 R2
4.0 4.0.30319.1 02010-04-1212 April 2010 Visual Studio 2010 N/A
4.5 4.5.50709.17929 02012-08-1515 August 2012 Visual Studio 2012 Windows 8, Windows
Server 2012
4.5.1 4.5.50938.18408 2013-10-17 Visual Studio 2013 Windows 8.1, Windows
Server 2012 R2
4.5.2 2014.5.5
Page 5
Yoon joong Kim
1. History of .NET Framework(cont.)
WPF(Windows Presentation Foundation)
- a new user interface subsystem and API based on
XML and vector graphics,
WCF(Windows Communication Foundation - a service-oriented messaging system which allows
programs to interoperate locally or remotely similar to
web services.
WF(Windows Workflow Foundation) - allows for building of task automation and integrated
transactions using workflows.
Windows CardSpace, - a software component which securely stores a person's
digital identities and provides a unified interface for
choosing the identity for a particular transaction, such
as logging in to a website
LINQ(Language Integrated Query) - can be used to conveniently extract and process data
from arrays, enumerable classes, XML documents,
relational databases, and third party data sources.
TPL(Task Parallel Library)
Page 6
Yoon joong Kim
2. What is Microsoft .NET(cont.)
Visual Studio .NET
.NET Enterprise
Servers
SQL Server 2005
Win Server 2003
Exchange 2010
.NET Framework
CLR, C#, ASP.NET,
etc.
.NET Services
e.g. Microsoft
Passport(Windows
Live ID)
Operating System e.g. Windows XP, Windows 2000, Linux
Page 7
The Microsoft .NET Platform
Yoon joong Kim
2. What is Microsoft .NET(cont.)
A platform
- The .NET Framework
- Visual Studio.NET
- .NET Enterprise Servers
- Database, messaging, integration, commerce, proxy, security, mobility,
orchestration, content management
- .NET Building Block Services
- Passport
- .NET My Services(“Hailstorm”)
Page 8
} The focus of
this program
Yoon joong Kim
2. What is Microsoft .NET(cont.)
that new language C# Microsoft putting XML into
everything
the next version of Visual
Basic the next version of ASP
the next version of
Visual Studio Microsoft trying to kill
Java
being able to run everything
across the Net
it’s a good thing
Page 9
Yoon joong Kim
2. What is Microsoft .NET(cont.)
Initially announced as the latest release of everything Microsoft - ASP.NET, VB.NET, C#.NET, VisualStudio.NET
With some big ideas - the new language C#, Object-Orient Language
- got rid of VB at last
- the Common Language Runtime (CLR) - platform independent c.f. JRE
- language integration - shared libraries ->language independent
- ability to develop and use software components over the web - XML based Web Services
- simplified deployment of Windows software - Simple copy of assembly EXE or DLL without any register editing
=> the end of DLL hell - http://en.wikipedia.org/wiki/DLL_Hell
- Assembly format includes its information(self-description)
Page 10
Yoon joong Kim
2. What is Microsoft .NET(cont.)
With some big ideas(cont.) - no more mixing HTML and script code in ASP
- Representation page and business logic page
- Data Access - work with RDBMS through the ADO.NET.
- Support XML and interoperate in any platform besides Windows
- http://cafe.naver.com/makkolli/209
- Web Services - Web Component
- Easy to create and use it
- NET depends on - four internet standards : HTTP, XML, SOAP, UDDI.
Page 11
Yoon joong Kim
2. What is Microsoft .NET(cont.)
A set of technologies for developing and using components to create: - web forms
- web services
- windows applications
Supports the software lifecycle - development
- debugging
- deployment
- maintenance
Page 12
Yoon joong Kim
3. The Microsoft .NET Framework
Page 13
http://en.wikipedia.org/wiki/.NET_Framework
Library classes for accessing data and XML
(ADO.NET, SQL, XML, XSLT, LINQ)
XML based
Web Services
Web Forms
ASP.NET
Windows
Forms
Library Framework Base classes
(IO, string, collections, security)
Common Language Runtime
.NET Framework Component Stack
.NET Framework
Yoon joong Kim
3. The Microsoft .NET Framework
Page 14
http://en.wikipedia.org/wiki/.NET_Framework
1. A software framework developed by Microsoft that runs primarily on Microsoft
Windows.
2. Framework Class Library (FCL)
3. Language interoperability
1. each language can use code written in other languages
2. across several programming languages.
4. Common Language Runtime (CLR)
1. An application virtual machine
2. provides services such as security, memory management, and exception
handling. FCL and CLR together constitute .NET Framework.
Yoon joong Kim
Library classes for accessing data and XML
(ADO.NET, SQL, XML, XSLT, LINQ)
XML based
Web Services
Web Forms
ASP.NET
Windows
Forms
Library Framework Base classes
(IO, string, collections, security)
Common Language Runtime
The Microsoft .NET Framework
The .NET Framework and Visual Studio.NET
Page 15
VB C++ C# JScript …
Common Language Specification Vis
ual S
tud
io.N
ET
Yoon joong Kim
The Microsoft .NET Framework .NET Framework Classes
System.Data
Design
OLEDB
SQLTypes
SQL
System
Globalization
Diagnostics
Configuration
Collections
Resources
Reflection
Net
IO
Threading
Text
ServiceProcess
Security Runtime InteropServices
Remoting
Serialization
System.Xml
XPath
XSLT Serialization
System.Web
Configuration SessionState
Caching Security
Services Description
Discovery
Protocols
UI HtmlControls
WebControls
System.Drawing
Imaging
Drawing2D
Text
Printing
System.Windows.Forms
Form Button
MessageBox ListControl
Page 16
Yoon joong Kim
The Microsoft .NET Framework .NET Framework Classes
Page 17
A set of standard class libraries
• Included in .NET Framework, organized in a hierarchy of namespaces.
• The built-in APIs are part of ether System.* or Microsoft.* namespaces.
• Implements all functions of file reading and writing, graphic rendering,
database interaction, and XML document manipulation, among others.
• available to all CLI compliant languages.
• Framework Class Library (FCL).
• a small subset of the entire class library and is the core set of classes
that serve as the basic API of CLR.[12]
• Parts of FCL are in Classes in mscorlib.dll,System.dll,System.core.dll
• are available in .NET Framework and also in .NET Compact Framework,
Microsoft Silverlight and Mono.
• Base Class Library (BCL)
• a superset of FCL and refers to the entire class library that ships
with .NET Framework.
• Also includes the expanded libraries for Windows Forms, ADO.NET, ASP.NET,
Language Integrated Query (LINQ), Windows Presentation Foundation (WPF),
Windows Communication Foundation (WCF) and Workflow Foundation (WF).
Yoon joong Kim
The Microsoft .NET Framework
.NET Core - .NET Core is a free and open-source partial implementation of the .NET
Framework.
- It consists of CoreCLR and CoreFX, which are partial forks of CLR and BCL
respectively.[13] NET Core comes with an improved JIT compiler, called
RyuJIT.[14]
Page 18
Yoon joong Kim
The Microsoft .NET Framework
. Assemblies
- Compiled CIL code is stored in CLI assemblies.
- Portable Executable (PE) file format, common on Windows platform for
all DLL and EXE files.
- Each assembly consists of one or more files, one of which must
contain a manifest bearing the metadata for the assembly.
- The complete name of an assembly contains its simple text name,
version number, culture, and public key token. Assemblies are
considered equivalent if they SHARE the same complete name,
excluding the revision of the version number. A private key can also be
used by the creator of the assembly for strong naming. The public key
token identifies which private key an assembly is signed with. Only the
creator of the keypair (typically .NET developer signing the assembly)
can sign assemblies that have the same strong name as a previous
version assembly, since the creator is in possession of the private key.
Strong naming is required to add assemblies to Global Assembly
Cache. Page 19
Yoon joong Kim
The Microsoft .NET Framework
. Design issues
- Interoperabilities
- Access to COM components is provided in System.Runtime.InteropServices
and System.EnterpriseServices namespaces of the framework;
- access to other functionality is achieved using the P/Invoke feature.
- Language independence
- .NET Framework introduces a Common Type System (CTS) and Common
Language Infrastructure(CLI).
- .NET Framework supports the exchange of types and object instances
between libraries and applications written using any conforming .NET
language.
- Security
- .NET Framework has its own security mechanism with two general features:
Code Access Security (CAS), and validation and verification.
Page 20
Yoon joong Kim
The Microsoft .NET Framework
. Design issues
- Portability
- cross-platform implementations are available for other operating systems
(see Silverlight and § Alternative implementations).
- Microsoft submitted the specifications for CLI (which includes the core class
libraries, CTS, and CIL),[16][17][18] C#,[19] and C++/CLI[20] to both ECMA
and ISO, making them available as official standards.
- This makes it possible for third parties to create compatible implementations
of the framework and its languages on other platforms.
- Memory management
- Garbage collector and this is more efficient than the java.
- Simplified deployment
- .NET Framework includes design features and tools which help manage the
installation of computer software to ensure that it does not interfere with
previously INSTALLED SOFTWARE, and that it conforms to security
requirements.
Page 21
Yoon joong Kim
Common Language Runtime Goal
Development services
- Deep cross-language interoperability
- Increased productivity
Deployment services
- Simple, reliable deployment – assembly format
- Fewer versioning problems – NO MORE ‘DLL HELL’
Run-trim services
- Performance
- Scalability
- Availability
- Reliability
- Security
- safety
Page 22
Yoon joong Kim
Common Language Runtime
Programs can run on any platform for which the CLR has been implemented - just like the JVM
CLR gives language integration - a class written in one language can be used by a class written in
another
- share exactly the same libraries
The CLR is no longer only available for Microsoft operating systems - CLR for the .NET framework
- Mono Project for the Linux and BSD-based OS and MAC OS X.
- Portable.NET
Page 23
Yoon joong Kim
Source Code
C++, C#, VB or any
.NET language
csc.exe or vbc.exe
Compiler
Assembly
DLL or EXE
Common Language Runtime Compilation
Page 24
Yoon joong Kim
Common Language Runtime Execution Model
Page 25
CLR
VB Source
code Compiler
C++ C#
Assembly Assembly Assembly
Operating System Services
MSIL
Common Language Runtime JIT Compiler
Compiler Compiler
Native
code Managed
Code
Managed
Code
Managed
Code
Unmanaged
Code
CLR Services:Loads and executes code, garbage collects etc
Ngen
like Java bytecode
(.exe or .dll)
Yoon joong Kim
Common Language Runtime Services
Code management
Conversion of MSIL to native code
Loading and execution of
managed code
Creation and management of
metadata
Verification of type safety
Insertion and execution of security
checks
Memory management and
isolation
Garbage collection
Handling exceptions across
languages
Interoperation between .NET
Framework objects, COM objects
and Win32 DLLs
Automation of object layout for late
binding
Developer services (profiling,
debugging, etc.)
Page 26
Yoon joong Kim
Common Language Runtime Multiple Language Support
Common Type System(CTS)
- Superset of the data types used by most modern programming
languages
Common Language Specification(CLS)
- Subset of CTS that allows code written in different languages to
interoperate
What languages?
- Microsoft – C#, C++, VB.NET, Jscript
- Third party
- Perl, Ada, Cobol, Java, Fortran, Delphi
- Eiffel, Smalltalk, Scheme, Oberon, Haskell, Python, …
- Only practical if the language supports some sort of encapsulation
Page 27
Yoon joong Kim
Common Language Runtime Multiple Language Support
Common Language
Infrastructure(CLI)
- The purpose of CLI is to provide
language-neutral platform
- The CLI code is housed in CLI
assemblies(dll, exe)
- the CLI specification describes
the following four aspects:
- CTS(Common Type System)
- Metadata ( code in CIL)
- CLS(Common Language
Specification)
- VLS(Virtual Execution System)
Page 28
Yoon joong Kim
Common Language Runtime Multiple Language Support
CLI Language
- CLI language is language that conforms the CLI specifications
- Common Intermediate Language(CIL)
- Is a target language to be compiled by CIL language
- Assembly
CLI implementation
- Such as CLR(Common Language Run), MONO, Portable NET
- Can execute CIL languages
Common CLI languages
- A#(Ada), Boo(Python), C#, Java, Delphi, C++, Corba, Component
Pascal, Eiffel, F#, IronPhython, IronRuby, IronLips, J#, Jscript,
P#(Prolog), VB.NET…
- http://en.wikipedia.org/wiki/List_of_CLI_languages
Page 29
Yoon joong Kim
Windows Forms
Framework for building
“rich clients”
Built upon .NET Framework,
languages
Rapid Application
Development (RAD)
Visual inheritance
Anchoring and docking
Rich set of controls
Extensible controls
Data-aware
Easily hooked into
Web Services
ActiveX support
Licensing support
Printing support
Advanced graphics
Page 30
Yoon joong Kim
Web Forms
Built with ASP.NET
- Logical evolution of ASP
New programming model
- Event-driven/server-side controls
- Rich controls(e.g. data grid, validation)
- Data binding
- Controls generate browser-specific code
- Simplified handling of page state
Page 31
Yoon joong Kim
Web Forms
Allows separation of UI and code
- Separation of concerns is a good thing
- Cleaner, more maintainable code
Uses .NET languages
- C#
- Not just scripting
Components
- Is easy to create and use
XCOPY/FTP deployment
Page 32
Yoon joong Kim
Web Forms
Caching(pages, fragments, custom)
Scalable session state management
Tracing support
ASP.NET is extensible
Page 33
Yoon joong Kim
Language C#
New language created for .NET
Safe, productive evolution of C++
- No the pointers
Key concepts
- Component-oriented
- Everything is an object
- Robust and durable code
- Preserving your investment
- Whatever that means
Standard language
- Approved as standard by ECMA(ECMA-344) and ISO(ISO/IEC 23270.2006)
Page 34
Yoon joong Kim
Languaes Visual Basic.NET
Modernizes and simplifies Visual Basic
- A modernized version of Visual Basic
Now provides
- Inheritance
- Threading
- Exception handling
- Support for late biding
- Whatever that is
Page 35
Yoon joong Kim
The Web Programming Server-Client and 3 Tier architecture
Web Server)
(Apache, IIS)
(ASP,JSP,PHP)
Web Server
Browser
(IE, FireFox,
Opera)
(HTML)
Client
(PC or MAC)
Database
Database
Server
SQL HTTP
vision
touch
voice
Presentation Layer
Application Layer
Persistence Layer
Client Server
Web
Network
Page 36
Yoon joong Kim
Programming the Web Server-Side Code
What is server-side code? - Software that runs on the server, not on the client
- Receives input from
- URL parameters
- HTML form data
- Cookies
- HTTP headers
- Can access server-side databases, e-mail servers, files, mainframes, etc.
- Dynamically builds a customized HTML document response for a client
Page 37
Yoon joong Kim
Programming the Web Server-Side Code
Why server-side code? - Availability
- You can reach the Internet from any browser, any device, any time, anywhere
- Manageability
- Does not require distribution of application code
- Easy to change code
- Security
- Source code is not exposed
- Once user is authenticated, can only allow certain actions
- Scalability
- Web-based 3-tier architecture can scale out
Page 38
Yoon joong Kim
Programming the Web Server-Side Technologies
Common Gateway Interface (CGI) (Script) - not language specific - http://en.wikipedia.org/wiki/Common_Gateway_Interface
Internet Server API (ISAPI) - MS IIS’s API, Apache’s API m_isapi - Netscape Server API (NSAPI)
Active Server Pages (ASP) - now obsolete
Java Server Pages (JSP)
PHP Hypertext Processor (PHP)
ColdFusion Markup Language(CFML) - Scripting Language for the JVM, the .NET framework, Google App
Engine.
- http://en.wikipedia.org/wiki/CFML
ASP.NET
Page 39
Yoon joong Kim
Programming the Web Active Server Pages(ASP)
Technology to easily create server-side applications - A complete rip-off of the good work of Rasmus Lerdorf
ASP pages are written in a scripting language
- usually VBScript but also Jscript or PerlScript
An ASP page contains static HTML
ASP script is (was) commonly used to access and update a database. - 3-tier systems
UI page and Code page in ASP.NET
Page 40
Yoon joong Kim
Programming the Web in ASP.NET
HTTP request (form data, HTTP
header data)
HTTP response HTML, XML
ASP page (static HTML +
server-side logic)
ASP page in .NET
UI Page (static HTML ) +
Code Page
(server-side logic)
Page 41
Yoon joong Kim
Web Services
A programmable application software component - allow remote access to software components
- via standard web protocols HTTP, XML, SOAP, UDDI, WSDL
- exposes functionality over the Web
Using ASP.NET framework - can create Web Services that others can use
- can write a program that uses the Web Services
With some properties - The idea of Web Services is not exclusive to Microsoft
- Standard technology
- The center of the .NET architecture
Page 42
Yoon joong Kim
Web Services Evolution of the Web
Generation 2
Web Applications
HTML
Generation 1
Static HTML
HTML
HTML, XML
Generation 3
Web Services
XML
Page 43
Yoon joong Kim
An simple Web Services
Ex1. An simple Web Services - HelloWorld
- 1.1 Generation of Web Service : int Add(int a, int b) using ASP.NET
- 1.2 Web Service Client using objects of HttpRequest
- 1.3 Web Service Client with proxy using .NET
Environment
- OS : Window 7
- Framework : .NET 3.5
- Tool : Visual Studio 2010
- Language : C#
- Browser : Internet Explorer 9
Page 44
Yoon joong Kim
More Resources
.NET - http://www.microsoft.com/net/
- http://msdn.microsoft.com/net/
- http://en.wikipedia.org/wiki/Microsoft_.NET
- http://www.asp.net/
XML - http://www.w3.org/XML/
Page 45