Académique Documents
Professionnel Documents
Culture Documents
The Need for .NET What Is The Microsoft Application Platform? The .NET Framework The Windows Server System Building Block Services Clients for the .NET Framework
This lesson introduces the components that make up the Microsoft application platform, which is designed to simplify development.
.NET and the Microsoft application platform were designed to facilitate working with the Internet by integrating Internet standards and supporting Web services. The .NET Framework also makes it easier to access your data and write Web applications that run on a wide variety of browsers and devices. The .NET runtime supports simplified and reliable installation and upgrades for ease of use and increased reliability.
companies can expose their services as Web services. A travel agent can use these services to find the best combination of prices and services for customers.
The Microsoft application platform consists of the following core technologies: Microsoft Visual Studio .NET Framework Windows Server System Microsoft Office System Building block services
Microsoft Visual Studio provides a high-level development environment for building applications on the .NET Framework. It provides key enabling technologies to simplify the creation, deployment, and ongoing evolution of secure, scalable, highly available Web applications and Web services. These applications can be deployed on several platforms, including the Windows Server System, and can use available .NET building block services as well as functionality from the Microsoft Office System.
AD ET: Data&X L O.N a ta M .N Fram w cla libra ET Fra e ork class ss ry m Com onLan geRuntim m ngua e gua
The .NET Framework is a language-neutral component library and execution environment. It enables you to build integrated, service-oriented applications that meet the needs of todays Internet businesses by gathering information from and interacting with a wide variety of sources, regardless of the platforms or languages in use. The .NET Framework consists of the following components: Common Language Runtime .NET Framework class library Microsoft ADO.NET (data and XML) Microsoft ASP.NET
disparate frameworks that Microsoft previously provided. developers no longer need to understand multiple frameworks.
As
result,
In addition, by creating a common set of application programming interfaces (APIs) across all programming languages, the .NET Framework enables crosslanguage inheritance, error handling, and debugging. Therefore, all programming languages, from JScript to Microsoft Visual C++, become equals, and developers are free to choose the language that they want to use.
ASP.NET
ASP.NET builds on the programming classes of the .NET Framework, providing a Web application model in the form of a set of controls and infrastructure that makes it easy to build Web applications. Developers have access to a set of ASP.NET Web controls that encapsulate common Hypertext Markup Language (HTML) user interface features such as text boxes and dropdown menus. These controls run on the Web server and project their user interface as HTML to a browser. On the server, the controls expose an object-oriented programming model that brings the power of object-oriented programming to the Web developer. ASP.NET also provides infrastructure services, such as session state management and process recycling, which further reduces the amount of code that a developer must write and increases application reliability. ASP.NET also uses these same concepts to enable developers to deliver software as a service. By using Web services, developers can simply write their business logic and let the ASP.NET infrastructure deliver the service through SOAP.
The Windows Server System is the comprehensive Microsoft family of server applications for building, deploying, and managing scalable, integrated, Webbased solutions. Designed with mission-critical performance in mind, the Windows Server System provides scalability, reliability, and manageability for the global, Web-enabled enterprise. These products are built specifically for interoperability by using open Web standards such as XML. By using XML standards, Microsoft is providing a new development platform infrastructure that will help developers quickly create and deploy distributed applications on Internet time.
Windows Server 2003: This is the most secure and reliable server platform Microsoft has ever released. As the foundation for the Windows Server System, the server platform provides a unifying layer of common services across the IT, application, and information worker infrastructures. Windows Server 2003 builds on the strengths of Microsoft Windows 2000 technology, integrating standards-based directory, Web application, communication, file, and print services with high reliability, efficient management, and
Application Center: This enables Web applications built on Windows Server 2003 to achieve mission-critical availability (99.999 percent uptime) through software scaling while reducing operational complexity and costs.
Microsoft
BizTalk Server: This is a standards-based platform for developing and managing application integration within and between organizations by using XML as the common document format.
Microsoft
Commerce Server: This is the comprehensive system for quickly building scalable, personalized business-to-consumer (B2C) and businessto- business (B2B) ecommerce solutions on Windows 2003. Microsoft Content Management Server: This dramatically reduces the time required to build and deploy content-driven Web sites that deliver high scalability, reliability, and performance. Content Management Server empowers content providers to manage their own content and provides site users with a targeted and personalized experience tailored to their individual profiles and browsing devices.
Microsoft
Exchange Server: This complete messaging and collaboration application offers unmatched interoperability, ease of use, and low-cost administration to organizations of all sizes.
Microsoft
Host Integration Server: This comprehensive integration platform provides the best way to quickly embrace Internet, intranet, and client/server technologies while maximizing investments in existing legacy systems.
Microsoft
Internet Security and Acceleration Server: This provides you with secure and easily managed Internet connectivity and expedites delivery of Web content through a scalable, reliable Web cache.
Microsoft
Operations Manager: This delivers enterprise-class operations management by providing comprehensive event management, proactive monitoring and alerting, reporting, and trend analysis. It helps reduce the day-today support costs associated with running applications and services in a Windows-based IT environment.
Microsoft
Project Server: This provides an extensible technology infrastructure to securely develop and deploy best practices for project management across your organization.
Microsoft
SharePoint This is the flexible portal offering that enables information workers to easily and quickly find, share, and publish information. Together, Office SharePoint Portal Server and Windows SharePoint Services give users the ability to organize information, readily access that information, manage documents, and enable efficient collaboration, all in a familiar, browser-based and Microsoft Office integrated environment.
Microsoft
SQL Server: This brings improved decision-making abilities to all levels of your enterprise with scalable business solutions, powerful data warehousing, and integration with Microsoft Office.
Microsoft
Systems Management Server: This delivers cost-effective, scalable change and configuration management for desktops and servers based on Windows and helps administrators to distribute security updates for all Microsoft products throughout the enterprise. Built on industrystandard management protocols, Systems Management Server is compatible with complementary management tools from Microsoft and other companies.
The building block services are a set of Web services that move control of user data from applications to users. These services enable personalization and consistency across applications, services, and devices. Microsoft has developed private and secure services built around identity, notification, and storage that can act as building blocks for other Web services and .NET experiences. Microsoft Passport is the.NET initiative that makes it easy to integrate various applications.
Microsoft Passport
Passport is a core component of the .NET initiative that allows businesses to develop and offer distributed Web services across a wide range of applications, devices, and complementary services, all based on a common Internet experience. The Microsoft Passport single sign-in (SSI) service helps your business to deliver a fast, convenient way for consumers to sign in and make transactions securely on your site, by allowing them to use one sign-in name and password at all participating Web sites. In addition, because Passport sign-in names are assigned to individuals and not to computers, members can access Passport sites at any time from a wide range of devices. Implementing Passport on your site enables you to do the following:
Increase
Improve
customer retention by delivering personalized content based on core Passport profile data.
Increase
by
simplifying
the
To support the .NET Framework, Microsoft is building device software that will enable consumers to use a family of complementary devices instead of only a single device or client. Microsoft is building software for everything from telephones and PDAs to other sets of devices and clients, such as laptop computers, workstations, handheld computers, smart mobile phones, game consoles (Microsoft Xbox), and the Tablet PC. Microsoft is currently working on the following software products for these devices: Embedded Windows XP, Windows CE 4.0, the .NET Framework, and the .NET Compact Framework.
Smart devices
All of these devices are known as smart devices because they remember who the user is and use the Web rather than the server as a platform for computing. Smart devices enable you to access, analyze, and act on data anywhere, anytime. They use the network intelligently and are responsive to bandwidth constraints, provide support for both online and offline use of applications, and recognize which services are available. Smart devices are programmable and customizable, with automatic updates and zero administration. Smart devices present and gather information in the most appropriate form for that device, such as converting text to speech on a mobile phone or recognizing handwriting on a Tablet PC. Smart devices can consume Web services and discover which services are available because they use XML, SOAP, and Universal Description, Discovery, and Integration (UDDI).
Growth of smart devices will increase even more during the next few years as these devices become integrated with the ultimate smart Internet device, the PC.
ADO.NET ASP.NET
Runtimes are not new to programming. Many other programming languages have used runtimes, including Visual Basic (VBRUN through version 4.0 and then MSVBVM through version 6.0), Visual C++ (MSVCRT), Microsoft Visual FoxPro, and JScript, in addition to third-party languages such as SmallTalk, Perl, and Java. The critical role of the .NET Framework, and what really sets it apart from other runtimes, is that it provides a unified environment across all programming languages. This environment is also referred to as a managed environment.
Globally
unique identifiers (GUIDs) are not needed because classes are organized by using a hierarchical naming scheme with humanreadable names.
Interface
Definition Language (IDL) files are no longer required because the system and languages use the same representations.
HRESULTs
are no longer used because the CLR uses structured exception handling.
IUnknown
and releasing object references is no longer necessary because the CLR knows which objects are being used and can clean up unused objects whenever necessary.
The
Runtim e
Service rviceProce Process ss Te xt Threa ing ad ding Int rop rvice e Se s Re ot m ing Seria tion rializaion Se lizat
The .NET Framework class library is a collection of reusable classes, or types, that tightly integrate with the CLR. The library is made up of several namespaces. As an example, examine the System namespace.
System namespace
The System.IO namespace is found below the System namespace and contains input/output (I/O) services. The System.Collections namespace provides sorted lists, hash tables, and other ways to group data. The System.Net namespace provides Transmission Control Protocol/Internet Protocol (TCP/IP) and sockets support. The design goals of the .NET Framework class library were to:
Enable
Implement
application models.
Increase
cross-language add
inheritance or modify
and .NET
debugging.
Make
Allow
Functionality
The .NET Framework class library provides a vast amount of functionality, including the following:
Managing Providing Drawing
to the screen
Providing
ADO.NET Namespaces
ADO.NET implements the following namespaces: System.Data namespace System.Xml namespace
The .NET Framework provides a new set of ADO.NET classes to handle data. ADO.NET provides improved support for the disconnected programming model. It also provides rich XML support.
System.Data namespace
The System.Data namespace consists of classes that constitute the ADO.NET object model. At a high level, the ADO.NET object model is divided into two layers: the connected layer and the disconnected layer. The System.Data namespace includes the DataSet class, which represents multiple tables and their relations. These datasets are completely self-contained data structures that can be populated from a variety of data sources. One data source could be XML, another could be OLE Database (OLEDB), another could be Oracle, and a fourth data source could be SQL Server.
System.Xml namespace
The System.Xml namespace provides support for XML. It includes an XML parser and a writer, both of which are compliant with World Wide Web Consortium (W3C) standards. The System.Xml.Xsl namespace provides support for Extensible Stylesheet Language Transformations (XSLT). Implementation of the XML Path Language (XPath) allows data graph navigation in XML. The System.Xml.Serialization namespace provides the entire core infrastructure for Web services, including features such as moving back and forth from objects to an XML representation, and support for SOAP.
ASP.NET Namespaces
Syste .W b m eb e Se rvice s Services
D script escripion t Discove iscovery ry Prot ocols
U I
Htm t t lCon rols mlCont
Wb e rols W Contro ls
The Internet is quickly evolving, from Web sites that deliver simple user interface (UI) pages to browsers, to the emerging generation of programmable Web sites that directly link organizations, applications, services, and devices. ASP.NET is a programming framework built on the CLR that you can use on a server to build powerful Web applications. ASP.NET Web Forms provide an easy way to build dynamic Web UIs. Web services, created by using ASP.NET, provide the building blocks for constructing distributed Web-based applications. Web services are based on open Internet standards, such as HTTP and XML. The CLR provides built-in support for creating and exposing Web services by using a programming abstraction that is consistent and familiar to both ASP and Visual Basic developers. The resulting model is both scalable and extensible. This model is based on open Internet standards (HTTP, XML, SOAP, SDL) so that it can be accessed and interpreted by any client or Internetenabled device. Some of the more common ASP.NET namespaces are described in the following section.
System.Web
The System.Web namespace implements lower-level services such as caching, security, configuration, and other services that are shared between Web services and Web UI.
System.Web.Services
The System.Web.Services namespace includes classes that handle XML Web services such as protocols and discovery.
System.Web.UI
The System.Web.UI namespace provides two classes of controls: HtmlControls and WebControls. The HtmlControls give you direct mapping of HTML tags, such as input. WebControls enable you to structure controls with templates (for example, a grid control).
*****************************
In Visual Studio, a single-user interface supports multiple languages. In this lesson, you will learn about the benefits of the language-neutrality features of the .NET Framework. You will also look at criteria for selecting the language that is most suitable for creating .NET-based applications.
The language neutrality of the .NET Framework provides many benefits to developers. Some of the most powerful benefits are described in this topic.
Implementation inheritance
Inheritance means that if you make a change to a class, that change is reflected in all subclasses. This automatic update saves you time and effort. A class or component written in one language can be extended in another language.
Selecting a Language
Base onProgra mingExpe nce sed ram ing erie Ba d onProg mm Exp rience
V a Ba V isu l sic, BScrip t Visu l J+ , Jav , JScrip isua + va, t V a J+ , Ja a JScript C, C+ + C, C+ + V alBasic20 5 isu l sic 00 Visua Ba 2 05 J# J# C# C#
Choosing a programming language depends on your language experience and the scope of the application you are building. Whereas small applications are often created using only one language, it is not uncommon to develop large applications using multiple languages. All languages that support the .NET Framework provide similar functionality. In all of these languages, objects derive from the System.Object class. All of these languages support attributes, events, methods, and properties.
Selecting a language
By default, simple value types, enums, and structs are passed by value in all languages. Similarly, arrays, classes, and interfaces are passed by reference. Furthermore, because all languages compile to the same MSIL code, they are all capable of providing roughly the same level of performance. Consider the following guidelines when selecting the .NET language that will work best for you:
If
you are a Visual Basic or Microsoft Visual Basic Scripting Edition (VBScript) developer, transitioning to Visual Basic 2005 would be easiest for you. The Visual Basic Upgrade Wizard makes it particularly easy to migrate existing code from Visual Basic 6.0 to Visual Basic 2005 Applications created by using earlier versions of Visual Basic must be
you are a J++, JScript, or Java developer, transitioning to Visual J# 2005 or C# would be easiest for you. Existing JScript applications can be migrated to JScript 2 Existing Java or Visual J++ applications can be migrated to J#. For new applications, C# might be a better choice because some project types are not available for J#, for example, Smart Device Projects.
If
you are a C or C++ developer, transitioning to C# or Managed C++ would be easiest for you. For new or .NET applications, C# might be a better choice because some project types are not available for Managed C++, for example, Smart Device Projects. For specialized applications, such as device drivers, C++ is the best choice.
Visual J# .NET
Visual J# supports most of the features of Visual J++ 6.0, including Microsoft extensions. It also has the ability to convert some Java binaries to run in the CLR. The Visual J# Binary Converter Tool transforms Java bytecode into MSIL code. It works for most Java Development Kit (JDK) 1.1.4level libraries and applications, but not all. The preferred method of porting is to recompile the Java-language source as Visual J#. Visual J# is designed to provide class library support functionality equivalent to most of the JDK level 1.1.4 packages that were included in Visual J++ 6.0. Visual J# also supports the Windows Foundation Classes (WFC) libraries and the following com.ms. packages: com.ms.lang, com.ms.dll, com.ms.com, com.ms.win32, com.ms.util, and com.ms.jdbc.odbc.
The .NET Framework maximizes programmer efficiency by providing new functionality that reduces programming errors.
Garbage collection
The .NET Framework eliminates concern over memory management because garbage collection takes care of this for you. The CLR checks at regular intervals for objects that are no longer used and puts them in the recycle bin. The CLR does not use reference counting to govern object lifetime. Instead, a background garbage collection task traces object references and identifies objects that can no longer be reached by running code. With garbage collection, you no longer have to worry about circular references. If objects in a group contain references to each other, but all references outside the group have been set to null or Nothing, garbage collection automatically reclaims the memory. Therefore, you do not need to be concerned about memory leaks. An additional advantage of traced garbage collection is that allocation of new objects in memory is extremely fast. Performance is further improved by the elimination of the COM AddRef and Release mechanisms, and objects require less memory.
Variable initialization
Variables can now be initialized during declaration. This results in simplified, compact code.
Syntax checking
Visual Studio, the shared development environment, provides excellent support for writing programs. It uses IntelliSense extensively to help programmers write valid code. IntelliSense displays syntax tips for statements as you type them and provides code completion on keywords.
Type checking
Type checking, performed at compile time, catches statements that use an improper data type before they can cause subtle execution errors at run time.
Type conversion
The process of changing a value from one type to another type is called type conversion. Type conversions can be either widening or narrowing. Widening conversions never fail and can be accomplished with no loss of information. Narrowing conversions might fail and always involve some kind of information loss.
Namespaces
Namespaces prevent naming conflicts by organizing classes, interfaces, and methods into hierarchies.
Using the try...catch...finally statement, you can protect blocks of code that have the potential to raise errors. You can nest exception handlers, and the variables declared in each block will have local scope.
The base unit of a .NET-based application is called an assembly. An assembly is the unit of versioning and deployment. Typically, you compile your source code into an .exe file or a DLL. (However, you can also create modules, which can later be linked to an .exe file or a DLL.) These are the simplest forms of assemblies. Compilers generate assemblies containing MSIL code. However, apart from the MSIL code, the compiler inserts metadata into the assembly. Metadata is a collection of information that describes all of the types, classes, methods, fields, and events contained within the assembly. This is similar to the idea of a type library. However, unlike a COM server that may or may not have a type library resource embedded in it, an assembly and its metadata are inseparable. This means that the assembly is self-describing.
Visual Studio 2005 includes tighter integration with Microsoft SQL Server 2005 as well as productivity improvements and extended support for Web services. Future versions will include support for the next version of the Windows operating system, new UI tools, and additional language enhancements.
Edit and Continue Enhanced IntelliSense and Auto-correct Microsoft Office integration Improved language features
Visual Studio 2005 includes a number of significant enhancements over Visual Studio .NET 2003, including support for.NET Framework 2.0, support for edit and continue debugging, improved IntelliSense and Auto-correct, and tighter integration with Microsoft Office, as well as a number of language-specific improvements.
which enable developers to build flexible, reusable code. You can build classes, methods, structures, and interfaces by specifying generic type parameters. The .NET Framework uses generics to enable strongly typed collections in the System.Collections.Generic namespace.
An
enhanced ADO.NET, which includes support for features such as userdefined types, bulk copy operations, asynchronous processing, and a provider-independent API.
An
improved ASP.NET, which includes many new controls, caching improvements, and tools
for quickly building robust Web sites such as Master Pages, Themes, and Skins.
C# improvements
C# improvements include:
Refactoring Anonymous
types
My namespace operators
The next version of Microsoft Visual Studio, codename Orcas, will include modifications of Windows Vista, support for a set of managed APIs known collectively as WinFX, and new language enhancements.
WinFX
WinFX is the name of the managed successor to the Microsoft Win32 API and will be introduced with Windows Vista. (The WinFX runtime components will also be installable in Windows XP and Windows Server 2003.) WinFX has three principal components:
Windows
Presentation Foundation (WPF) adds vector graphics to Windows Forms. With WPF, programmers will be able to build forms declaratively by using a new XML-based language, the Extensible Application Markup Language (XAML).
Windows
Communication Foundation (WCF) offers a unified programming model for communications between applications either on a single machine or across multiple machines. WCF places various communication technologies under a unified API, includiong Web services, remoting, message queuing, and distributed transactions, for building robust and extensible Service-Oriented Architectures.
Windows
Workflow Foundation (WWF) is a new technology for running and managing workflows. Workflows can be defined declaratively using XAML or programmatically using any .NET language.
Query expressions
Language Integrated Query (LINQ) expressions, will be built into the language (both Visual Basic and C#) for querying relational data as well as XML data without embedding SQL into the code.