Interview Tips Interview Tips, Interview Questions and Answers

18Aug/100

Define Trace Switches

Define Trace Switches.

Trace switches are used to configure tracing behavior.
There are two kinds of trace switches: BooleanSwitch and TraceSwitch.
BooleanSwitch: It is either on or off.
TraceSwitch : It has property to determine trace behaviour.
Trace switches can be configured through application's .config file even after the application is compiled.

What are Trace switches?

Trace switches are used to enable, disable and filter the tracing output. They are objects can be configured through the .config file.

Explain how to implement properties.

You can either use fields or property procedure to add properties.

It is convenient to use fields when the values associated with the properties are less in number. eg: boolean which can have only two values associated with it.

If property procedure has to be used to add a property, then three steps need to be followed:

- Declare a private variable to store the value of the property
- Write a get procedure to retrieve the value of the variable and
- Write a set procedure to set the value of the variable.