Friday, December 14, 2012

HTML vs XML, Array vs ArrayList,Get vs Post Method,Querystring vs Session

HTML vs XML

HTML is an abbreviation for HyperText Markup Language while XML stands for eXtensible Markup Language.

The most salient difference between HTML and XML is that HTML describes presentation and XML describes content.

The differences are as follows:-

1.HTML was designed to display data with focus on how data looks while XML was designed to be a software and hardware independent tool used to transport and store data, with focus on what data is.
4.HTML is case insensitive while XML is case sensitive.

5.HTML is used for designing a web-page to be rendered on the client side while XML is used basically to transport data between the application and the database.

6.HTML has it own predefined tags while what makes XML flexible is that custom tags can be defined and the tags are invented by the author of the XML document.

7.HTML is not strict if the user does not use the closing tags but XML makes it mandatory for the user the close each tag that has been used.

8.HTML does not preserve white space while XML does.

9.HTML is about displaying data,hence static but XML is about carrying information,hence dynamic.

Thus,it can be said that HTML and XML are not competitors but rather complement to each other
and clearly serving altogether different purposes.

Array vs ArrayList

Array ArrayList
Array comes under the System namespace ArrayList comes under the System.Collections namespace.
Array has fixed size. Arraylists size can be increase and decrease.
Array colletion of similar items ArrayList can hold item of different types of items
Array can be multi-dimensional Arraylist can be single-dimensional only
string[] vowel=new string[]; ArrayList arrlist=new ArrayList();

Difference between Get Method and Post Method

Get Post
Data retrieved using this verb is typically cached by the browser Data retrieved using this verb is not cached by the browser
Data is passed through URL that is Data is appended to URL Post we use to send data through body.
Data sent using this verb is visible in URL. Data sent using this verb is not visible
While sending normal data Get is used. While sending Secured and important data Post is used.
There is limit over amount of data that can be sent using Get depends on browsers. There is no limit over amount of data that can be sent using Post.
This is default method for many browsers. This is not default method and have to be explicitly defined.
Get method can carry only text data Post method can carry text as well as binary data.
Get method is faster as compared to Post Post method is slower as compared to Get

Querystring vs Session

Querystring Session
Querystring is client side state management technique. Session is server side state management technique.
Querystring data is page specific i.e. can be accessed in that page only. Session data can be accessed throughout the session.
Querystring data is visible to user and can be seen in browser url. Session data is not visible to user.
Data is not secured and can be altered hence insensitive data is stored in querystring. Data is secured hence sensitive data such as user information is stored.
Querystring has constraint of Maxlength. Session does not have such constraint.

Abstract class vs Interface
Interface Abstract class
Interface is nothing but contract of the system which can be implemented on accounts. Abstract class is special kind of class that can not be instantiated but can be inherited.
Interface is purely abstract in nature. Abstract is not purely abstract in nature.
Class can inherit multiple interface. Class can inherit only one abstract class.
In interface all methods are without implementation In abstract class some methods are without implementation
Members of interface does not have any access modifier. Members of abstract does have an access modifier
An interface can not contain fields, constructor, destructor. An interface can contain fields, Constructor, destructor.
A class implementing an interface has to implement all the methods of the interface A class implementing an abstract class does not need to implement all the methods of the abstract class
If we add new method to interface then we have to implement that method everywhere where we have implemented interface If we add new method to abstract then we don't have to implement that method everywhere where we have implemented abstract

No comments:

Post a Comment