Intro to dot NetIntro to dot Net
Dr. John AbrahamDr. John AbrahamUTPA – Fall 09UTPA – Fall 09
CSCI 3327CSCI 3327
Ref. Chapter 1Ref. Chapter 1• Emphasis – OOP and Event-driven
programming.• Code download:
www.deitel.com/books/vb2008htp
Machine & High Level Machine & High Level LanguagesLanguages
• Machine• Assembly• High• See page 8 for a comparison• BASIC 1960 Profs Kemeny and Kurtz
MilestonesMilestones• Structured Programming
Disciplined approach to creating clear, correct and easy to modify programs. Pascal 1971– Procedural Programming
• Object Technology: Packaging Scheme for creating meaningful software units.
XML (eXtensible Markup XML (eXtensible Markup Language)Language)
• HTML has fixed tags which is a limitation
• XML is definable• Separation of Data from description
of data (data independence)• XML can be used by any software or
language
SOAPSOAP• Simple Object Access Protocol.• SOAP is a communication protocol, for
communication between applications (transmission of objects over the Internet).
• SOAP is a format for sending messages • SOAP is designed to communicate via Internet • SOAP is platform independent • SOAP is language independent • SOAP is based on XML • SOAP is simple and extensible • SOAP allows you to get around firewalls • SOAP will be developed as a W3C standard
What is .Net?What is .Net?.NET is an Internet and Web based
infrastructure .NET delivers software as Web Services
– XML based..NET will run in any browser on any
platform .NET Framework is the infrastructure
for the new Microsoft .NET Platform.
What are Web Services?What are Web Services?• Applications that run on a web server
and communicate with other applications.
• The basic Web services platform is XML + HTTP
• Web services platform elements– SOAP (Simple Object Access Protocol) – UDDI (Universal Description, Discovery
and Integration) – WSDL (Web Services Description
Language) •
UDDIUDDI• Like the yellow pages of Web services• Universal Description, Discovery and
Integration • UDDI is a directory for storing information
about web services • UDDI is a directory of web service
interfaces described by WSDL • UDDI communicates via SOAP • UDDI is built into the Microsoft .NET
platform
WSDLWSDL• Web Services Description Language • WSDL is written in XML • WSDL is an XML document • WSDL is used to describe Web
services • WSDL is also used to locate Web
services
What is .Net built on?What is .Net built on?Windows Servers such as:SQLApplication CenterCommerce ServerMobile Information ServerExchange ServerBizTalk ServerInternet SecurityHost Integration
.Net Framework.Net FrameworkA software platformLanguage-neutralDesigned for cross-language
compatibility.App written in VB.net may reference a
DLL file written in any other language
2 components:Common Language Runtime (CLR)Class Libraries
Common Language RuntimeCommon Language RuntimeExecution Engine of .NETManages the execution of programs
and provides core services:Code compilationMemory allocationThread managementGarbage collection
Common Type System (CTS) enforces safety.
CLR contd.CLR contd.Output of .Net compilation contains a special
type of code called Microsoft Intermediate Language (MSIL); it is not executable.
• MSIL is independent of any specific CPU.• CLR translates MSIL to executable code
when the program is executed• Executable code is produced using JIT (just
in time) compiler. The native code produced by JIT is specific for the CPU.
Class LibrariesClass Librariesdesigned to integrate with the common
language runtime. This library gives the program access to
runtime environment. The class library consists of lots of
prewritten code that all the applications created in VB .NET and Visual Studio .NET will use.
The code for all the elements like forms, and controls actually comes from the class library.
Some reasons why developers Some reasons why developers are building applications using are building applications using
the .NET Framework: the .NET Framework: • Improved Reliability
Increased PerformanceDeveloper ProductivityPowerful SecurityIntegration with existing SystemsEase of DeploymentMobility SupportXML service SupportSupport for over 20 Programming LanguagesFlexible Data Access
Visual Basic .NETVisual Basic .NET • forms designer • in-place menu editor• automatic control anchoring and docking• integrated development environment (IDE)• create Web applications using the shared
Web Forms Designer• full object-oriented constructs -
inheritance, encapsulation, and polymorphism
VB Object Oriented VB Object Oriented approach approach
• Emphasis on data rather than procedure• Programs are divided into Objects• Data is hidden and cannot be accessed by
external functions• Objects can communicate with each other
through functions• New data and functions can be easily
added whenever necessary• Follows bottom-up approach
OOP conceptsOOP concepts• Objects• Classes• Data Abstraction and Encapsulation• Inheritance• Polymorphism
Classes and ObjectsClasses and Objects • Classes are types and Objects are
instances of the Class (like variable types and variables)
• The Syntax for a Class – Public Class Test
----- Variables-----Methods-----Properties-----EventsEnd Class
Creating an object for class Creating an object for class TestTest
• use the new keyword:– Dim obj as new Test(). – Open a Console Application and place
the code shown in next slide
Module Module1Imports System.ConsoleSub Main()Dim obj As New Test()'creating a object obj for Test classobj.disp()'calling the disp method using objRead()End SubEnd Module
Public Class Test'creating a class named TestSub disp()'a method named disp in the classWrite("Welcome to OOP")End SubEnd Class