Question: I have been trying to implement a form without using the form element but no success yet. I have two .php files, **file1.php** and **file2.php**

I tried to implement it using the **onclick** of a button in **file1.php**, but I can't seem to understand how it works:

```
    function submitData(){
    var http = new XMLHttpRequest();
    var url = "file2.php";
    var params = "lorem=ipsum&name=binny";
    http.open("POST", url, true);

    //Send the proper header information along with the request
    http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

    http.onreadystatechange = function() {//Call a function when the state changes.
        if(http.readyState == 4 && http.status == 200) {
            alert(http.responseText);
        }
    }
    http.send(params);
}

```

The function works well, upon the button click it returns the the whole text of **file2.php**. But this is not what I am trying to achieve. I want this button click to get me to **file2.php** and from there I can get the parameters and use them further. When I use the form eleement upon clicking the submit button it will get me to **file2.php** but the above code does not seem to do that. I know I am missing something very obvious here :/ ?

Answer: 
There is no noticeable performance impact when you call `doStuff`.

At runtime, the type of object you are calling `doStuff` on is known *for sure*. At compile time you'd need a giant switch statement because you don't know the type. CLR sees that you are trying to call `doStuff` on `Subclass0679`, goes into that class, and invokes the method. Simple as that. 

Think about it this way. `ToString()` is declared in `Object` and *all* classes inherit `Object`. When you call `ToString()` on something, is it really slow? No.
The number of derived classes can have some impact.

In particular, with ten thousand derived classes and only 100 objects, chances are pretty good that each call to `doStuff` will actually be to a unique function, separate from the others. That means your cache won't be very effective.

This is a fairly unrealistic scenario though. A collection that could be any one of ten thousand different derived classes is unlikely to ever arise in actual practice.

To put this in perspective, .NET (in its entirety) consists of about nine thousand nine hundred classes. A decent sized application could easily add the hundred or so more needed to get to ten thousand--but you're talking about a collection that could include *anything* in .NET, plus anything in your application. I find it difficult to imagine a situation in which this is likely to make sense.