Many types of content and behaviors are required to render a rich webpage, from images and stylesheets, to scripts. Some of that content might be data or AJAX requests that have the ability to pull down additional payload to the browser. To prevent such requests from getting maliciously hijacked along the way, the CORS recommendation was incorporated into the recommended standards by the W3C (World Wide Web Consortium) to help establish trust between the client and the server Read More →
An app can control the version of the .NET Framework on which it runs, but a component cannot. Components and class libraries are loaded in the context of a particular app, and therefore automatically run on the version of the .NET Framework that the app runs on.
In CLR 4
- If a project contains reference of higher CLR (.NET 3.5(console app) referencing .NET 4.0(assembly)), then project won’t compile.
- If a project contains the reference of lower CLR (.NET 4.0(console app) referencing .NET 3.5(assembly)), then the project will compile.
- The Same concept is applied for .NET versions. The Higher version can always reference, assemblies of lower version but not vice versa.
But is it different In CLR 2
- If a project contains a reference of higher CLR (.NET 2.0(console app) referencing .NET 3.5(assembly)), then the project will compile.
- If a project contains a reference of lower CLR (.NET 3.5(console app) referencing .NET 2.0(assembly)), then the project will compile.
- The Same concept is applied for .NET versions. The Higher version can always reference, assemblies of lower version and vice versa.
We can plug and unplug any electrical appliances in sockets. Even though nothing is plugged in, the wall doesn’t explode
Usually, we don’t wire electrical appliances together by attaching the cable directly to the wall. Instead, we use plugs and sockets. A socket defines a shape that the plug must match. In an analogy to software design, the socket is an interface.
If you ever stayed in cheap hotel, you will see hair drier directly attached into the wall outlet.
Now couple of problems here.
- What if your hair drier stopped working?
- What if hotel management decided to switch to new model which consumes less power?
The term Inversion of Control (IoC) is a computer programming technique wherein the flow of the control of an application is inverted. Rather than a caller deciding how to use an object, in this technique the object called decides when and how to answer the caller, so the caller is not in charge of controlling the main flow of the application. Read More →
Often, String objects are used to contain sensitive data such as a user’s password or creditcard information. Unfortunately, String objects contain an array of characters in memory, and if some unsafe or unmanaged code is allowed to execute, the unsafe/unmanaged code could snoop around the process’s address space, locate the string containing the sensitive information, and use this data in an unauthorized way. Even if the String object is used for just a short time and then garbage collected, the CLR might not immediately reuse the String object’s memory (especially if the String object was in an older generation), leaving the String’s characters in the process’s memory, where the information could be compromised. In addition, since strings are immutable, as you manipulate them, the old copies linger in memory and you end up with different versions of the string scattered all over memory.
Read More →