Anda di halaman 1dari 13

Features Of Class Libraries:-

1. The class library is object oriented, providing types from which your own
managed code can derive functionality. This not only makes the .NET
Framework types easy to use, but also reduces the time associated with learning
new features of the .NET Framework.
2. An object-oriented class library, the .NET Framework types enable you to
accomplish a range of common programming tasks, including tasks such as
string management, data collection, database connectivity, and file access. In
addition to these common tasks, the class library includes types that support a
variety of specialized development scenarios. For example, you can use the
.NET Framework to develop the following types of applications and services:

• Console applications.
• Windows GUI applications (Windows Forms).
• ASP.NET applications.
• XML Web services.
• Windows services.

Interoperability:

With the increasing use of distributed systems, interoperability is a major issue to


system developers. The problems of interoperability have been around for many
years, and a number of standards and architectures have been developed to address
some of these issues, with varying degrees of success. For example:

 Representation standards, such as External Data Representation (XDR) and


Network Data Representation (NDR), address the issue of passing data types
between different machines. These standards compensate for such matters as
big-endian and little-endian issues, and different word sizes.
 Architecture standards, such as the Distributed Computing Environment's
(DCE) Remote Procedure Call (RPC), the Object Management Group's
(OMG) Common Object Request Broker Architecture (CORBA), and
Microsoft's Component Object Model (COM), address the issue of calling
methods across language, process, and machine boundaries.
 Language standards such as ANSI C allow the distribution of source code
across compilers and machines.
Abstract Class and Interface

An abstract class is a class in which one or more methods Are declared but not
defined.

There are situations in which you will Want to define a superclass that only
defines a generalized form shared by all subclasses,leaving it to each subclass to
fill in the details.

• The bodies of these methods are are omitted .


• An abstract method cannot be private since a private method cannot be
inherited.
• Any class that contains one one or more Abstract methods must also be
declared abstract.
• All the methods defined as abstract must be inherited.
• Concrete methods are allowed in Abstract class.
• Abstract class cannot be used to instantiate objects they can be
• Used to create object references .

InterFace
An interface defines a contract for behaviour.It defines the members that will be
exposed through the interface,and the parameters and return types of those
members.Any object that implements an interface can interact with any object that
requires that interface.Both classes and structures can implement interfaces
including multiple interfaces.
An interface contains only the signatures of methods, delegates or events. The
implementation of the methods is done in the class that implements the interface

• Define a class that implemens the desired interface.Use the colon(:)to


declare Which interface is being implemented in the class declaration .A
class can implement multiple interfaces.
• Provide an interface for each member of the interface.:
Namespaces in .NET
A Namespace is a group of related classes. It is a good practice to group related
classes into a namespace when you create a class library.

 Namespaces are logical collections of objects. A namespace is usually


contained in a file called an assembly.These files outwardly look just like

dynamically linked libraries (DLLs), and even end in the .dll extension.

 The main difference between .NET and non-.NET DLLs is that .NET
DLLs are not compiled into machine language. Rather, they are

compiled into the Microsoft Intermediate Language (MSIL), which is

understood by the Common Language Runtime (CLR).

A namespace has the following properties:

• They organize large code projects.

• They are delimited with the . operator.

• The using directive means you do not need to specify the name of the
namespace for every class.

• The global namespace is the "root" namespace: global::system will always


refer to the .NET Framework namespace System.

The main advantage of using namespaces is, to avoid conflicts when you have
multiple classes with the same name. For example, .NET comes with a class called
'Form'. Suppose you also write another class called 'Form' in your application and
if you refer to the class 'Form', how does the compiler know which Form you are
refering to ?
Namespaces allow you to avoid name conflicts!
All classes in .NET class library are grouped into namespaces. You can use all the
classes using the fully qualified name, including the namespace also along with the
class name.

• System.Windows.Forms.Form
• System.String
.NET Namespaces
Here is a list of some of the namespaces in .NET class library.
• System
• System.Xml
• System.Data
• System.Data.OleDb
• System.Data.SqlClient
Introduction To .NET

What is .NET?

1.The overall vision of Microsoft .NET is to create a common platform for building
applications that can be delivered as reusable, interoperable services over the
Internet and corporate intranets.

2. .NET is a Microsoft’s next generation revolutionary new platform for Windows


and Internet software development, based on open Internet protocols and
standards.Thus, as already stated, the overall vision of Microsoft .NET is to
create a common platform for building applications that can be delivered
as reusable, interoperable services over the Internet and corporate
intranets.

3. Several software will be developed by Microsoft to achieve this goal. Microsoft


wants every player in the industry, be it a software developer or a device
manufacturer, to adopt .NET so that they are easily integrated. .NET initiative is all
about enabling data transfer between networks, PCs and devices independent of
platforms, architecture and solutions.

4. The developers have broad freedom to write their applications in whatever


programming language they are comfortable with. At present, Microsoft is shipping
four different programming languages: VB, C++, C# and Jscript within Visual
Studio.NET, but there are actually 57+ languages in all that are going to target
the .NET framework.

5. The programming language support of .NET allows easy and consistent access to
any other component, regardless of what programming language it was developed
in. A VB application can call a method in a component written in C++, and can
catch events from an application written in COBOL. And none of these participants
would know each other’s language.Microsoft .NET initiative basically revolves
around the .NET Framework that encompasses the actual language, and execution
platform. It also has extensive class libraries providing rich built-in functionality.
6.The .NET framework embraces XML andSOAP to provide integration of software
over the Internet. There is also a family of server-based products called .NET
Enterprise Servers. These are nothing but next generation of Microsoft BackOffice
and are a part of .NET strategy, however, they are not built on the .NET framework.
They have a major role to play in future software development projects. When
actual .NET framework projects are developed, most of these will depend on the
technologies in the .NET Enterprise Servers for functions like data storage and
messaging

What are Web Services?

1. A Web Service represents a black box functionality that can be reused


without worrying about how the service is implemented. They provide well-
defined interfaces that describe the services provided. Developers can
assemble applications using a combination of remote services, local services
and custom code.
For example,

• a company might assemble an online store


• using Microsoft’s Passport service to authenticate users
• a third party personalization service to adapt web pages to each user’s
preferences, a credit card processing service
• package tracking services from each shipping company, an in-house catalog
service that connects to the company’s internal inventory management
applications, and a bit of custom code to make sure that their store stands
out from the crowd.
2. Web services do not use object-model specific protocols such as DCOM and RMI
that require specific homogenous infrastructures on both client and service
machine. This kind of implementation, which is tightly coupled to specific
component technologies, is acceptable in a controlled environment; but on web,
they become impractical.

3. It becomes difficult to guarantee a single, unified infrastructure to all the


participants in the web application due to rapid technological changes. Web services
have a different approach. They communicate using ever-present web protocols and
data formats such as HTTP and XML. Any system supporting these web standards
will be able to support web services.

4. Services provided by a web service are in terms of messages the web service
accepts and generates rather than how the service is implemented. Thus, by
focusing totally on messages, web services are language, platform and object
agnostic. A web service can be implemented using any programming language,
object model and platform. This service can be consumed by applications written in
any language for any platform.
5. The interfaces provided by the web services are called contracts. This contract
explains the capabilities of the service, message sequences and protocols it
expects. As long as these are honored, a web service can be implemented.

The minimum infrastructure required for implementing web services model is low to
ensure that these can be implemented and accessed from any platform, using any
technology and any programming language.

6. The web service and the web service consumer should rely on standard ways to
represent the data and commands, web service interfaces (contracts) and to figure
out what service does a web service offer.

Such thing is possible by using XML and SOAP. XML (eXtensible Markup Language)
represents a way to describe information so that it is easy to programmatically
extract the information needed. SOAP (Simple Object Access Protocol) is an
industry standard for using XML to represent data and commands in extensible
way.

Ex:-In our shopping cart example, if the credit card company provided a SOAP
interface , you would be able to post to it, a standard request for services, and it
would send back information that will tell which interfaces it provided and how to
structure a request to one of those interfaces. Such interfaces make it easier to
connect and utilize the services that other web sites provide.

This is where Microsoft .NET comes in that uses XML extensively to facilitate data
interchange between different computer systems.

.NET and Web Services

.NET is founded on this principle of web services. Through .NET, Microsoft is


providing the infrastructure to enable the evolution of web services through each of
the pieces of .NET platform.

It allows applications to use straightforward code to access and utilize web-based


services. The web servers can thus easily expose their services to external
applications.

The server that is providing the services or the client applications and web sites
that are utilizing these services do not have to be necessarily written using .NET. It
is just that .NET platform will make a lot easier to develop these applications.

The entire .NET plan of Microsoft is based on XML that helps create a common
format to send and transfer data over a network. Microsoft wants everyone from
software developers to software users to use XML technology for transferring data
over the web.
Program Interfaces

Web Services

Till now, applications are a piece of software that access basic operating system
services such as file system and graphics etc and database services. Web services
are the next step in this direction. In web services, software functionality is
exposed as a service that does not have any concern with the consumer of the
service. In .NET, web services are implemented as a part of ASP.NET that handles
all web interfaces. It allows programs to talk to each other directly over the web.

Stock tickers, weather information, current financial rates, shipping status


and a host of other types of information could be exposed as web services,
ready for integration into any application that needs it.

Describe the .NET Framework?

The goal of the Microsoft .NET Framework is to make it easy to build Web
applications and web services. It covers all the layers of software development from
operating system up. It provides the richest level of integration among presentation
technologies, component technologies and data technologies, particularly on a
Microsoft platform. .NET wraps the operating system, insulating software developed
with .NET from most operating system specifics such as file handling and memory
allocation. Thus, software developed for .NET is portable to a wide variety of
hardware and operating system foundations. Fig. 1.1 shows the Microsoft .NET
Framework architecture.

Built on top of operating system services is a

1.Common Language Runtime (CLR), theheart of the .NET Framework, the


engine that drives the key functionality. It manages the needs of running code
written in any modern programming language. It supplies many services that help
simplify the code development and application deployment. It also does memory
allocation and management and the garbage collection.

2.The framework also includes a set of class libraries that developers can use from
any Programming language.

3.Above that are various programming models that provide components and
services for Developing web sites and web services. It includes user and program
interfaces. Windows Forms and Web Forms provide a powerful user interface for the
web.
System Services includes COM+ services and Windows API:-

a)Common Language Runtime (CLR)

• A runtime is an environment in which programs are executed. Thus, CLR is


the environment in which .NET applications are run that have been compiled
to a common language, called as MicroSoft Intermediate Language (MSIL).
This is also referred as Intermediate Language (IL).
• The runtime loads and runs the code written in any programming language
that is aware of the Common Language Runtime. It enables deep multi-
language integration. Code written in one language can now inherit
implementation from classes written in another language.
• Self-describing components are now possible on .NET Framework, which
simplify the development and deployment. With self-describing components
no other files are needed to use the components.
• Runtime also supplies integrated, pervasive security services to ensure that
unauthorized users cannot access resources on machine and that code
cannot perform unauthorized actions.
b) Services Framework
• This layer includes a base set of class libraries that developers would expect
in a standard language library, such as collections, input/output, string and
numerical classes. It also provides classes to access operating system
services such as graphics, networking, threading, globalization and
cryptography. It also includes a data access class library as well as classes
that can be used by the development tools such as debugging and profiling
services.All languages based on the .NET Framework have these framework
classes available.
• The Base Class Library(BCL) is the portion of the .NET framework that
defines all the basic data types such as System.object,numeric ,String type,
arrays and collections.The way types are implemented in BCL follows the
common type system (CTS) specifications.
For example, for extracting the square root, there is a method called
system.math.sqrt in the framework classes. COBOL as well as Visual Basic can use
the same function for calculating the square root. This makes such base
functionality widely available and highly consistent across languages. All calls to
sqrt look essentially the same (allowing for syntactical differences among
languages) and access the same underlying code.

Data Access Services

• Almost all the web services need to work with the data. The data can be in
simple files, relational Databases or any other type of data stores. Services
framework includes ActiveX Data Objects .NET (ADO.NET) class library to
provide data access. ADO.NET has evolved from ADO and is designed to
provide data access services for scalable web applications and services.
• Using ADO.NET, any data – regardless of how is it stored – can be
manipulated as XML or relational data; whichever is most appropriate for the
application at a given point of time. It provides APIs for connected cursor
style data access as well as disconnected data model.
• ADO.NET contains classes for connecting to, issuing commands against, and
retrieving data from data stores. These classes are implemented by managed
data providers. .NET framework has managed data providers for MS-SQL
Server and any data store that can be accessed via OLE DB. ADO.NET has
introduced Dataset. A Dataset is an in-memory data cache providing a
relational view of the data. The Dataset knows the source of data. It
can be created and populated programmatically or by loading data from a
data store. No matter where the data comes from, it is manipulated using the
same programming model and uses the same underlying cache.
• Managed data providers expose a Dataset Command object for interfacing
between data stores and Datasets. This object uses other objects inside it to
fill datasets from the data stores .A new class called XMLReaders exposes
efficient stream access to XML data. Since all data can be viewed as XML,
developers can take advantage of ADO.NET transformation and validation
services for any data.
4. What is the difference between Web Forms and Win Forms?

User and Program Interfaces

On top of the services framework, .NET provides three ways to render and manage
user interfaces (Windows Forms, Web Forms and Console Applications), and one
way to handle interfaces with remote components (Web Services).

User Interfaces

Win Forms

Win Forms are also called as windows Forms. These are descended from Windows

Foundation Classes (WFC) originally created for J++.Win Forms are actually the
part of the framework classes in the System.Winforms namespace, which them
available to all languages based on .NET framework. The drag and drop designer of
Win Forms can be used to design forms visually with any .NET language.

For writing, client applications for Windows, Win Forms can be used. By doing
this, the developers have an advantage of using al the rich user interfaces features
of Windows, including existing ActiveX controls, new features of Win 2000, such as
transparent,layered and floating windows. The framework security model can safely
execute applications and components on client machines provided they are written
using WinForms or used from a Win Forms application.

Moreover, a win forms based application can easily be installed and updated with a
simple XCOPY deployment and no registration issues like Visual Basic forms.

Web Forms

Web forms are a part of ASP.NET. They provide a web browser based user
interface.These consist of two parts:

• A template containing HTML based layout information for all user interface
elements and
• A component that contains all logic to be hooked to the user interface. They
have a lot of built-in intelligence. Controls on Web Forms run on the server
but make their presence known on the client. These can look and behave like
Win32 interfaces. They can deal with different browsers, optimizing their
output for each particular browser.
Like Win Forms, Web Forms are also available to all the languages of the
.NET framework.Like we have controls in Visual Basic, similarly, the controls in
Web Forms are called server-side controls. They create a proxy on the server
for a user interface element that is on a Web Form or ASP. It communicates with
local logic as necessary and renders its own user interface as HTML as necessary in
any pages that are sent out containing the control.
These controls need intelligence for rendering HTML for different types of
browsers and coordinating events with the client on which the page is
running. Also, these controls can manage their own state. Thus, when
every time the page is refreshed, there is no need to write the code to
reload state information into HTML controls.

What is the role of .NET Enterprise Servers?

Microsoft .NET initiative basically revolves around the .NET Framework that
encompasses the actual language, and execution platform. It also has
extensive class libraries providing rich built-in functionality. The .NET framework
embraces XML and SOAP to provide integration of software over the Internet. There
is also a family of server-based products called .NET Enterprise Servers. These are
nothing but next generation of Microsoft BackOffice and are a part of .NET strategy,
however, they are not built on the .NET framework. They have a major role to play
in future software development projects. When actual .NET framework projects are
developed, most of these will depend on the technologies in the .NET Enterprise
Servers for functions like data storage and messaging.

How does .NET affect the developers?

Common IDE for all languages

Microsoft is combining the Integrated Development Environment (IDE) for all their

languages into one code base. It has opened up the IDE for other languages. Any
third party vendor can license the technology to have the language work within
the .NET framework and place their language in Visual Studio IDE.

How does .NET affect me?

.NET has its implications on all sorts of software professionals: Developers,

Infrastructure Engineers and End Users.

Developers

• The biggest impact of .NET is on developers. The development has been


simplified, new architectural options have been provided and they have also
got a wide range of programming models.
• Today developers can start with ASP and when they become cumbersome
they switch over to component based three-tier development in Visual Basic,
which is a big leap. To become proficient in C++, ATL and related
technologies for system level work, it is another leap. Using .NET has an
advantage over this.
• There exists a gradual transition in programming models from simple to
complex. ASP.NET pages are more structured; Visual Basic has a wider
applicability since building web interfaces with web forms is easier and
advanced object oriented design concepts can also be used. System level
capabilities are more approachable using C#.
• .NET extends the trend of developers spending less time in writing code and
more time on discovering how to do something with the pre-written
functionality.
Infrastructure Engineers

Lives of people responsible for installing and maintaining infrastructures have been
made simpler by .NET. By alleviating DLL hassles and many other deployment
problems, infrastructure workers are relieved from frustrating and tedious
aspects of Microsoft Platform deployment.

End Users

Once the .NET framework is on an end-user’s system, adding new applications is


easier. End users will have access to new web-enabled applications that have the
potential to reach higher levels of functionality and productivity. Applications that
draw together information and processing services from all over the globe and
integrate them into an easy-to-use customized form, can be created.

Benefits of .NET

The major benefits of .NET can be summarized as follows:

• Faster development
• Lots of built-in functionality through rich object model
• Variety of ways to interface and integrate with the outside world
• More reuse
• Easy to integrate different languages into one system
• Easier deployment
• Scalability
• Easy to build sophisticated tools
• Interfaces well to existing software
• Fewer bugs due to use of CLR
.NET – Downsides

• To make the languages compatible with the CLR, adjustments in the


syntaxes have to be made.
• The byte code in Intermediate Language that CLR converts to native machine
code can be disassembled to the source code making it more transparent and
difficult to protect the intellectual property. While disassembling a program in
current environments (processor instructions) produces the assembled code
that is of limited use.

Anda mungkin juga menyukai