Why doesn't C# support multiple inheritance?

0 comments
There are a number of reasons we don't implement Multiple Implementation Inheritance directly. (As you know, we support Multiple Interface Inheritance).

However, I should point out that it's possible for compilers to create MI for their types inside the CLR. There are a few rough edges if you go down this path: the result is unverifiable, there is no interop with other languages via the CLS, and in V1 and V1.1 you may run into deadlocks with the OS loader lock. (We're fixing that last problem, but the first two problems remain). The technique is to generate some VTables in RVA-based static fields. In order to deposit the addresses of managed methods (which probably haven't been JITted yet), you use the VTFixup construct. This construct is a table of triplets. The triplets consist of a token to a managed method, an address in your image that should be fixed up (in this case, a slot of the VTable you are creating in the RVA-based static), and some flags. The possible flags are described in corhdr.h and they allow you to specify 32- vs. 64-bit pointer sizes, control over virtual behavior, and whether some reverse-PInvoke behavior should be applied in the form of a thunk that eventually dispatches to the managed method. If we are performing an unmanaged->managed transition, you also have some control over which AppDomain should be selected for us to dispatch the call. However, one of these options (COR_VTABLE_FROM_UNMANAGED_RETAIN_APPDOMAIN) doesn't exist in V1. We added it in V1.1.

There are several reasons we haven't provided a baked-in, verifiable, CLS-compliant version of multiple implementation inheritance:

1. Different languages actually have different expectations for how MI works. For example, how conflicts are resolved and whether duplicate bases are merged or redundant. Before we can implement MI in the CLR, we have to do a survey of all the languages, figure out the common concepts, and decide how to express them in a language-neutral manner. We would also have to decide whether MI belongs in the CLS and what this would mean for languages that don't want this concept (presumably VB.NET, for example). Of course, that's the business we are in as a common language runtime, but we haven't got around to doing it for MI yet.

2. The number of places where MI is truly appropriate is actually quite small. In many cases, multiple interface inheritance can get the job done instead. In other cases, you may be able to use encapsulation and delegation. If we were to add a slightly different construct, like mixins, would that actually be more powerful?

3. Multiple implementation inheritance injects a lot of complexity into the implementation. This complexity impacts casting, layout, dispatch, field access, serialization, identity comparisons, verifiability, reflection, generics, and probably lots of other places.

It's not at all clear that this feature would pay for itself. It's something we are often asked about. It's something we haven't done due diligence on. But my gut tells me that, after we've done a deep examination, we'll still decide to leave the feature unimplemented.

...................................................................................................................................


Multple inheritance is coneceptually wrong. It shouldn't be allowed in any language. Inheritance is the strongest relationship that can be expressed in OO languages. It's used to express IS-A relationship. Aggregation is used to express IS CONSTRUCTED IN TERMS OF. If you're using multiple inheritance in C++ then you're design is wrong and you probably want to use aggregation. On the other hand it's plausible to want to use multiple interfaces. For instance you might have a class wheel and a class engine. You could say that your class car inherits from wheel and from engine but that's wrong. In fact car aggregates wheel and engine because it is built in terms of those classes. If wheel is an interface and engine is an interface then car must inherit both of these interfaces since it must implement the functionaity of wheel and engine .On this basis we can see that multiple inheritance for classes should not be allowed because it promotes mis-use of the strong IS-A relationship. C# enforces the correct concepts whilst C++ allows mis-use. multiple interface inheritance is permissible and C# allows this. It's all to do with properly understanding OO concepts.Try reading Exceptional C++ by Herb Sutter to get a good discussion of the correct and incorrect uses of inheritance.

............................................................................................................................................................


As one of my friend has specified that there is pointer concept in C++ and its not possible in C#. Even the pointers can be achieved through putting the same code in UnSafe.

According to me Its not possible because inventors wanted to avoid the name collison in case if the derived class is inheriting two base classes and if the method names are the same would result in collision..

This could be one of the reason I dont admit that this is the primary reason.

but this can be achived thru Interfaces



........................................................................................................................................................


To avoid name collision. Multiple Inheritence can have many classes and methods and its quite possible that they can have save name say a save function in two different classe name can be Save() but implementation can be different . The derived class will have problem accessing the correct function.
 


.........................................................................................................................................................


 
 

What is Normalization?

4 comments


Database normalization is a technique for designing 
relational database tables to minimize duplication of
information and, in so doing, to safeguard the database
against certain types of logical or structural problems,
namely data anomalies.

For example, when multiple instances of a given piece of
information occur in a table, the possibility exists that
these instances will not be kept consistent when the data
within the table is updated, leading to a loss of data
integrity. A table that is sufficiently normalized is less
vulnerable to problems of this kind, because its structure
reflects the basic assumptions for when multiple instances
of the same information should be represented by a single
instance only.
 
1. data is normalized in oltp systems 
( are of different forms :1NF, 2NF, 3NF, BCNF, 4NF,
5NF,DKNF,6NF)
2. when it comes to olap/datawarehouse/dss sytems data is
generally de-normalized. (N1NF, PNF).

there is always a trade-off to consider between data
redundancy vs performance
First normal form : 
· A table is in first normal form when it contains no
repeating groups.
· The repeating column or fields in an un normalized table
are removed from the table and put in to tables of their own.
· Such a table becomes dependent on the parent table from
which it is derived.
· The key to this table is called concatenated key, with the
key of the parent table forming a part it.

Second normal form:
· A table is in second normal form if all its non_key fields
fully dependent on the whole key.
· This means that each field in a table ,must depend on the
entire key.
· Those that do not depend upon the combination key, are
moved to another table on whose key they depend on.
· Structures which do not contain combination keys are
automatically in second normal form.
Third normal form:
· A table is said to be in third normal form , if all the
non key fields of the table are independent of all other non
key fields of the same table.
 
 
.....................................................................
It is possible to start creating 
the database at this point. It's just a question of creating a new table
for every entity identified in the diagram. We'll be using MS-Access to
do that shortly. But how do you code the relationships?

There is
a formal process to do that in database modeling. It's called
normalization. It means applying a set of rules to the data so that you
group the attributes in such a way that the relationships work. It's not
really that complicated but it is a formula approach. If you prefer to
use that approach, get any good book on databases, look-up
"normalization" and follow the steps.

We'll do normalization
using the intuitive approach - work with the data until it "feels" OK.
This could also be called prototyping - create a working model of the
database that is close to what you want and keep improving it until it
works perfectly, then put it into production.

However, whatever
the approach taken, there are some basic rules that have to be adhered
to. The rules apply to any relational database and cannot be broken.
They can't even be stretched. Think of them as the Prime directives. The
rules are:

1. Every table must have a primary key - an
attribute or combination of attributes that uniquely identifies every
occurence in the table.

2. The primary key can never contain
an empty or Null value. That makes sense - if you had 2 that were empty,
they wouldn't be unique anymore.

3. Every attribute of every
occurence in the table can contain only one value. Think of the Employee
table as a grid. Every occurence, or line, represents one employee and
every column is an attribute. So, every employee can only have one ID
and one First-name and one Last-name, and so on.
...............................................................................




The formal classifications describing the level of database normalization in a data model are called Normal Forms (NF) and the process of doing this is Normalization.
First normal form

First normal form (1NF) lays the groundwork for an organised database design:
  • Ensure that each table has a primary key: minimal set of attributes which can uniquely identify a record.
  • Eliminate repeating groups (categories of data which would seem to be required a different number of times on different records) by defining keyed and non-keyed attributes appropriately.
  • Atomicity: Each attribute must contain a single value, not a set of values.
  • 'First normal form' depends on functional dependency formula f(x)=y. For every value of x there is value for y.
Second normal form
Second normal form (2NF) If a table has a composite key, all attributes must be related to the whole key:
  • The database must meet all the requirements of the first normal form.
  • The relational schema should not have any partial functional dependency i.e. No proper subset of the primary key should derive a functional dependency belonging to the same schema. For example, consider functional dependencies FD:{AB->C, A->D, C->D} here AB is the primary key, as A->D this relational schema is not in 2NF.


Third normal form
Third normal form (3NF) requires that data stored in a table be dependent only on the primary key, and not on any other field in the table.
  • The database must meet all the requirements of the first and second normal form.
  • All fields must be directly dependent on the primary key field. Any field which is dependent on a non-key field which is in turn dependent on the Primary Key (ie a transitive dependency) is moved out to a separate database table.


Boyce-Codd normal form
Boyce-Codd normal form (or BCNF) requires that there be no non-trivial functional dependencies of attributes on something other than a superset of a candidate key (called a superkey).




The formal classifications describing the level of database normalization in a data model are called Normal Forms (NF) and the process of doing this is Normalization.
First normal form

First normal form (1NF) lays the groundwork for an organised database design:
  • Ensure that each table has a primary key: minimal set of attributes which can uniquely identify a record.
  • Eliminate repeating groups (categories of data which would seem to be required a different number of times on different records) by defining keyed and non-keyed attributes appropriately.
  • Atomicity: Each attribute must contain a single value, not a set of values.
  • 'First normal form' depends on functional dependency formula f(x)=y. For every value of x there is value for y.


Second normal form
Second normal form (2NF) If a table has a composite key, all attributes must be related to the whole key:
  • The database must meet all the requirements of the first normal form.
  • The relational schema should not have any partial functional dependency i.e. No proper subset of the primary key should derive a functional dependency belonging to the same schema. For example, consider functional dependencies FD:{AB->C, A->D, C->D} here AB is the primary key, as A->D this relational schema is not in 2NF.


Third normal form
Third normal form (3NF) requires that data stored in a table be dependent only on the primary key, and not on any other field in the table.
  • The database must meet all the requirements of the first and second normal form.
  • All fields must be directly dependent on the primary key field. Any field which is dependent on a non-key field which is in turn dependent on the Primary Key (ie a transitive dependency) is moved out to a separate database table.


Boyce-Codd normal form
Boyce-Codd normal form (or BCNF) requires that there be no non-trivial functional dependencies of attributes on something other than a superset of a candidate key (called a superkey).




The formal classifications describing the level of database normalization in a data model are called Normal Forms (NF) and the process of doing this is Normalization.
First normal form

First normal form (1NF) lays the groundwork for an organised database design:
  • Ensure that each table has a primary key: minimal set of attributes which can uniquely identify a record.
  • Eliminate repeating groups (categories of data which would seem to be required a different number of times on different records) by defining keyed and non-keyed attributes appropriately.
  • Atomicity: Each attribute must contain a single value, not a set of values.
  • 'First normal form' depends on functional dependency formula f(x)=y. For every value of x there is value for y.


Second normal form
Second normal form (2NF) If a table has a composite key, all attributes must be related to the whole key:
  • The database must meet all the requirements of the first normal form.
  • The relational schema should not have any partial functional dependency i.e. No proper subset of the primary key should derive a functional dependency belonging to the same schema. For example, consider functional dependencies FD:{AB->C, A->D, C->D} here AB is the primary key, as A->D this relational schema is not in 2NF.


Third normal form
Third normal form (3NF) requires that data stored in a table be dependent only on the primary key, and not on any other field in the table.
  • The database must meet all the requirements of the first and second normal form.
  • All fields must be directly dependent on the primary key field. Any field which is dependent on a non-key field which is in turn dependent on the Primary Key (ie a transitive dependency) is moved out to a separate database table.


Boyce-Codd normal form
Boyce-Codd normal form (or BCNF) requires that there be no non-trivial functional dependencies of attributes on something other than a superset of a candidate key (called a superkey).

Difference between Managed Code and Unmanaged Code?

0 comments
What Is Managed Code?

Managed Code is what Visual Basic .NET and C# compilers create. It compiles to Intermediate Language (IL), not to machine code that could run directly on your computer. The IL is kept in a file called an assembly, along with metadata that describes the classes, methods, and attributes (such as security requirements) of the code you've created. This assembly is the one-stop-shopping unit of deployment in the .NET world. You copy it to another server to deploy the assembly there—and often that copying is the only step required in the deployment.
Managed code runs in the Common Language Runtime. The runtime offers a wide variety of services to your running code. In the usual course of events, it first loads and verifies the assembly to make sure the IL is okay. Then, just in time, as methods are called, the runtime arranges for them to be compiled to machine code suitable for the machine the assembly is running on, and caches this machine code to be used the next time the method is called. (This is called Just In Time, or JIT compiling, or often just Jitting.)
As the assembly runs, the runtime continues to provide services such as security, memory management, threading, and the like. The application is managed by the runtime.
Visual Basic .NET and C# can produce only managed code. If you're working with those applications, you are making managed code. Visual C++ .NET can produce managed code if you like: When you create a project, select one of the application types whose name starts with .Managed., such as .Managed C++ application..

What Is Unmanaged Code?

Unmanaged code is what you use to make before Visual Studio .NET 2002 was released. Visual Basic 6, Visual C++ 6, heck, even that 15-year old C compiler you may still have kicking around on your hard drive all produced unmanaged code. It compiled directly to machine code that ran on the machine where you compiled it—and on other machines as long as they had the same chip, or nearly the same. It didn't get services such as security or memory management from an invisible runtime; it got them from the operating system. And importantly, it got them from the operating system explicitly, by asking for them, usually by calling an API provided in the Windows SDK. More recent unmanaged applications got operating system services through COM calls.
Unlike the other Microsoft languages in Visual Studio, Visual C++ can create unmanaged applications. When you create a project and select an application type whose name starts with MFC, ATL, or Win32, you're creating an unmanaged application.
This can lead to some confusion: When you create a .Managed C++ application., the build product is an assembly of IL with an .exe extension. When you create an MFC application, the build product is a Windows executable file of native code, also with an .exe extension. The internal layout of the two files is utterly different. You can use the Intermediate Language Disassembler, ildasm, to look inside an assembly and see the metadata and IL. Try pointing ildasm at an unmanaged exe and you'll be told it has no valid CLR (Common Language Runtime) header and can't be disassembled—Same extension, completely different files.



........................................................................................................................................................


Definitions for managed code:

1. Code that is executed by the CLR. Managed code provides information (i.e., metadata) to allow the CLR to locate methods encoded in assembly modules, store and retrieve security information, handle exceptions, and walk the program stack. Managed code can access both managed data and unmanaged data. Managed data—Memory that is allocated and released by the CLR using Garbage Collection. Managed data can only be accessed by managed code


2.Code that targets the common language runtime, the foundation of the .NET Framework, is known as managed code; code that does not target the common language runtime is known as unmanaged code. You can think of the runtime as an agent that manages code at execution time, providing core services such as memory management, thread management, and remoting, while also enforcing strict type safety in the code. The concept of code management is a fundamental principle of the runtime.

3.Managed code supplies the metadata necessary for the CLR to provide services such as memory management, cross-language integration, code access security, and automatic lifetime control of objects. All code based on IL executes as managed code.

4.Code that executes under the CLI execution environment. Managed code uses the execution environment for memory management, object lifetime, and the basic type-system, among other fundamental services. 



...............................................................................................................................................




Managed Code..
1.The Code is Understandable by CLR.
2.It is executed under the instructions of CLR.
3.The code which is done by .net compatible language will be compiled two times.In the first compilation, the compiler will generate MSIL code.Which is known as Managed Code.

UnManaged Code..
1.The CLR cannot able to understand the code.
2.The CLR cannot instruct the code.
3.The second time compilation is unmanaged code.It is understood only by the machine not by the user.

...............................................................................................................................................


"Unmanaged code" is a new name for an old concept. Unmanaged code stands for native machine code. Software is typically written in some high-level language such as Pascal, C or C++. These languages are translated into machine code (aka unmanaged code) by the compiler and its companion tools (assembler, linker, librarian, etc). The generated code runs natively on the host processor; that is, the processor directly executes the code generated by the compiler. This approach typically results in fastest code execution, but diagnosing and recovery from errors might be easier in managed code.

Managed code is a new name, but the concept also is pretty old. Today, "managed code" typically stands for the system used by Microsoft .NET, but .NET is just one example of a managed code system. The .NET system takes source code in any of the supported languages (which include C, C++, C#, Pascal, and many others), and translates it into code designed for a virtual machine. The real processor cannot execute this code natively, but it can execute a program which then in turn executes the virtual machine's codes. The program that executes the virtual machine code is known as the virtual machine. While potentially slower than native code execution, the virtual machine can manage code (!) better than real machines. For example, the virtual machine can supervise memory allocation, automatically handle disposal of unused memory, and provide many other services that a native (unmanaged) application typically must explicitly provide. If the virtual machine does its job correctly, all applications using this virtual machine are likely to benefit.

Virtual machines are also known under other names. In the Java system, the tool is called a JVM, a Java Virtual Machine. In the Microsoft .NET system, the intermediate language is called MSIL (Microsoft intermediate language), which are executed through a Just-in Time MSIL compiler (JIT-compiler). Early implementations of Pascal generated an intermediate code called P-code, executed at runtime through some P-code interpreter. Other forms of managed code exist.


............................................................................................................................................................


 

what is namespace

0 comments
Namespace is a group of classes, structures, interfaces, enumerations, and delegates, organized in a logical hierarchy by function, that enable you to access the core functionality you need in your applications.

Namespaces are the way that .NET avoids name clashes between classes. A namespace is no more than a grouping of data types, but it has the effect that the names of all data types within a namespace automatically get prefixed with the name of the namespace. It is also possible to nest namespaces within each other.

..............................................................................................................................................................



Namespace is a group of classes, structures, interfaces, 
enumerations, and delegates, organized in a logical
hierarchy by function, that enable you to access the core
functionality you need in your applications.
Namespaces are the way that .NET avoids name clashes
between classes. A namespace is no more than a grouping of
data types, but it has the effect that the names of all
data types within a namespace automatically get prefixed
with the name of the namespace. It is also possible to nest
namespaces within each other.
 ..............................................................................................................................................................

definition -
In general, a namespace uniquely identifies a set of names so that there is no ambiguity when objects having different origins but the same names are mixed together. Using the Extensible Markup Language (XML), an XML namespace is a collection of element type and attribute names. These element types and attribute names are uniquely identified by the name of the unique XML namespace of which they are a part. In an XML document, any element type or attribute name can thus have a two-part name consisting of the name of its namespace and then its local (functional) name.
For example, suppose the same XML document included the element type of OWNER for owners of motorcycles as well as for owners of automobiles. It might be necessary or desirable to know that an owner name was one of those who owned a motorcyle rather than an automobile. Having different motorcycle and automobile namespaces would make this possible. Effectively, it would make it possible to label motorcycle owners differently than automobile owners without having to create a different element type for each.
In XML, a namespace is commonly given the name of a Uniform Resource Identifier (URI) - such as a Web site's address - both because the namespace may be associated with the site or page of that URI (for example, a company name) and because a URI is conveniently likely to be a unique name. Note that the URI is not necessarily intended to be used other than as a name nor is there any namespace document or XML schema that must be accessed; the URI is simply used as a name (and part of the two-part name of any element type or attribute name so that the names are unique within the document).


Whats DLL Hell ?

0 comments
DLL Hell is where loading one program breaks another program. Basically, any time an application (or service patch) replaces (or loads) an executable used by another application, there is a risk. It doesn't matter if the executable is an exe, vxd, dll, or something else, the risk is the same, and you, the user, have no control over what is happening.
To make matters worse (much worse), when your clients install software that you've written, your software might break other, un-related, applications on the clients machine. This is particularly true if you've used a Microsoft compiler. (mfc42.dll is known to cause this type of problem.) Of course, you and your clients have no control at all over what happens.

Microsoft implies that this is some kind of a generic problem that their new .net initiative will solve. But this was never a problem with DOS or unix. In fact, Microsoft windows is the primary cause of the problem. I find it irritating that Microsoft is taking credit for the solution without admitting that they were wrong all along.

I will use explorer.exe as an example. This application actually displays your desktop, the Start menus, all your icons, the "file manager", and other basic functions. As of Feb 2001, Microsoft admitts to 15 different English versions (to see them, you will need to enter explorer.exe in the Filename field and press enter/submit). However, several of these "versions" come in different sizes. Some variation can be expected between Macintosh (PPC) and PC versions of the same product, but this should also be reflected in the product version number, not just the file size.

A specific feature that I find extremely irritating is the unexpected change from readable menus to scrolling menus. The original Windows 95 operating system provides a multi-column Start menu - Windows 95c, Windows 98, and Windows NT 4 are usually cursed with scrolling menus. If your system has multi-column menus, then loading Internet Explorer, Office 2000, or some other application could change the multi-column menus into scrolling menus. (Notice the hedging words, I've seen several combinations of products and functionality.)

I am not 100% sure about the version numbers, there are 15 in all and I've only been able to test a few, but it appears that systems with explorer.exe version 4.0.x display multi-column menus, those with version 4.72.x or higher display scrolling menus. However, if SHDOC401.DLL is on your machine, then it is possible to change back to multi-column menus.

The problem is that you have no control over which versions of these products are on your machine. explorer.exe is installed by each operating system, most of the OS service releases, Internet Explorer, Office 2000 Developer, Visual Basic, BackOffice, SMS, Visual Studio, and many other supposedly unrelated applications. (In their attempt to control the browser market, Microsoft requires you to install Internet Explorer when you install other products, such as VisualBasic and Office 2000. As a result, explorer.exe, and countless other dll's, are changed without your permission or knowledge.)

In addition, since SHDOC401.DLL is loaded by IE 5, Office 2000 SR1, and a few other apps, some systems will allow you to change the configuration and others won't.

To make matters worse, the version of explorer.exe distributed with some products is not consistent. Even 2 copies of the same explorer.exe version might be different sizes.

Difference Between DLL and EXE in .NET Breafly

0 comments
DLL:
1)it has versioning
2)it is not self executable
3)it runs in application process memory
4)it has no entry point
5)it is reusable
6)Out Process Server

Exe:
1)it is self executable
2)it has no versioning
3)it runs in own memory
4)it have main function(Entry point)
5)it is self executable
6) In Process Server

.............................................................................................................
a) In shortcut .exe is an executable file & DLL (Dynamic Link Library) is not an executable file.
b) DLL is an in-process server while exe is a out-process server it means DLL works within the thread of application, while exe works after creating its own thread.
c) If DLL fails the application became fail if exe fails DLL doesn't fail because it's not work within the thread of application but the part of the exe could not work properly.
d) An EXE is visible to the system as a regular Win32 executable. Its entry point refers to a small loader, which initializes the .NET runtime and tells it to load and execute the assembly contained in the EXE. A DLL is visible to the system as a Win32 DLL but most likely without any entry points. The .NET runtime stores information about the contained assembly in its own header.

Difference Between DLL and EXE in .NET

0 comments
1. Difference between DLL & EXE

DLL - Dynamic-link library. It is Microsoft’s implementation of a shared library. This means that many different programs can use this library to do their tasks making it easier on the programmers so that they do not have to keep reinventing the wheel each time they write software. In simple terms a .DLL file will contain logic that other programs will use.

EXE - Executable. It denotes that a program is executable. This just means that if you double click on the file a program will run, normally with some kind of interface for a user to interact with. The file formats for EXE and DLL actually the same.

2. DLL Hell

"DLL Hell" refers to the set of problems caused when multiple applications attempt to share a common component like a dynamic link library (DLL) or a Component Object Model (COM) class. In the most typical case, one application will install a new version of the shared component that is not backward compatible with the version already on the machine. Although the application that has just been installed works well, existing applications that depended on a previous version of the shared component might no longer work. In some cases, the cause of the problem is even more subtle. In many cases there is a significant delay before a user discovers that an application has stopped working. As a result, it is often difficult to remember when a change was made to the machine that could have affected the application.

How .NET addresses DLL Hell?

Microsoft .Net 1.1, which is integral to the Windows Server 2003 operating systems, supports strong binding. Strong binding means an application or component can bind to a specific version of another component, so you can reuse components or use them in isolation.

.Net 1.1 will provide Windows Server 2003 operating systems with a Global Assembly Cache. This Cache is a repository for all the .Net components that are shared globally on a particular machine. When a .Net component is installed onto the machine, the Global Assembly Cache looks at its version, its public key, its language information and creates a strong name for the component. The component is then registered in the repository and indexed by its strong name, so there is no confusion between different versions of the same component, or DLL.

Windows 2003 Server also uses rules to make sure that an application finds the right component and version. The system will first look for a local version of the component, and will then look in the cache to find an exact match for the strong name of the required component. Failing that, the system will use heuristics to find the next best component, but by default an application will always run against the component that it was built and tested against. Administrators will be able to override these rules for exceptional cases.

Another feature of Windows Server 2003 is that .Net components will have no registration policy. This means it will be easy to take a .Net component on server and copy to another server. Microsoft is calling the feature xcopy deploy, after a command used in DOS to copy capability files, directories and even whole drives from one destination to another. It means you can copy applications instead of reinstalling them and the whole process becomes much simpler.

Also, .NET Framework 1.1 introduced something called side-by-side execution. Side by side is the ability to install and run multiple versions of the same component on the machine concurrently at the same time without interfering with each other. With components that support side-by-side, authors aren't necessarily tied to maintaining strict backward compatibility because different applications are free to use different versions of a shared component.

3. Cookies & Session

Basically these are state management techniques.

cookies are only simple text that is stored on the client with some useful data to identify subsequent requests from the client and help the server to serve the client efficiently. cookies can hold data like books bought during an http session until the session expires. if you could store the nature of these books (e.g. fiction, technology etc.) then this data could be used to know the browsing behaviour of the user.

Sessions are objects (not text files) that store data and regarding a particular session and help the servlets to transfer this data to other servlet invocation so that the WEB SERVER understands (or is made to understand) that these requests have come from the same client. e.g. HttpSession objects are used to store such information.