What are the main advantages of binary serialization?
An object is stored in a file, a database or even in the memory. However, data to be transferred over a network needs to be in a linear form for which serialization and deserialization are used.
Advantage of serialization is the ability of an object to be serialized into a persistent or a non-persistent storage media and then reconstructing the same object later by de-serializing the object.
Also Binary Serialization is faster, supports complex objects too with read only properties and even circular references.
.NET interview: What are the main advantages of binary serialization
An object is stored in a file, a database or even in the memory. However, data to be transferred over a network needs to be in a linear form for which serialization and deserialization are used.
Advantage of serialization is the ability of an object to be serialized into a persistent or a non-persistent storage media and then reconstructing the same object later by de-serializing the object.
Also Binary Serialization is faster, supports complex objects too with read only properties and even circular references.
asp.net interview questions: cache
(1) what is the difference between Cache object and application object?
The main difference between the Cache and Application objects is that the Cache object provides cache-specific features, such as dependencies and expiration policies.
(2) What are dependencies in cache and types of dependencies?
When you add an item to the cache, you can define dependency relationships that can force that item to be removed from the cache under specific activities of dependencies. Example if the cache object is dependent on file and when the file data changes you want the cache object to be update. Following are the supported dependency:-
. File dependency: - Allows you to invalidate a specific cache item when a disk based file or files change.
. Time-based expiration: - Allows you to invalidate a specific cache item depending on predefined time.
. Key dependency:- Allows you to invalidate a specific cache item depending when another cached item changes.
(3) How can get access to cache object?
The Cache object is defined in the 'System.Web.Caching' namespace. You can get a reference to the Cache object by using the Cache property of the Http Context class in the 'System.Web' namespace or by using the Cache property of the Page object.
What is Web.config?
In classic ASP all Web site related information was stored in the metadata of IIS. This had the disadvantage that remote Web developers couldn't easily make Web-site configuration changes. For example, if you want to add a custom 404 error page, a setting needs to be made through the IIS admin tool, and you're Web host will likely charge you a flat fee to do this for you. With ASP.NET, however, these settings are moved into an XML-formatted text file (Web.config) that resides in the Web site's root directory. Through Web.config you can specify settings like custom 404 error pages, authentication and authorization settings for the Web sitempilation options for the ASP.NET Web pages, if tracing should be enabled, etc.
The Web.config file is an XML-formatted file. At the root level is the tag. Inside this tag you can add a number of other tags, the most common and useful one being the system.web tag, where you will specify most of the Web site configuration parameters. However, to specify application-wide settings you use the tag.
For example, if we wanted to add a database connection string parameter we could have a Web.config file like so.
Asp.net Interview Question: What are dependencies in cache and types of dependencies?
When you add an item to the cache, you can define dependency relationships that can force that item to be removed from the cache under specific activities of dependencies. Example if the cache object is dependent on file and when the file data changes you want the cache object to be update. Following are the supported dependency:-
-
File dependency: - Allows you to invalidate a specific cache item when a disk based file or files change.
-
Time-based expiration: - Allows you to invalidate a specific cache item depending on predefined time.
-
Key dependency:- Allows you to invalidate a specific cache item depending when another cached item changes.