Design pattern

What Are Design Patterns and Do I Need Them? Software professionals may be familiar with the term “Design Patterns,” but many have no idea of where they come from and what they truly are. Consequently, some do not see the value and benefits design patterns bring to the software development process, especially in the areas of maintenance and code reuse.… Read more →

Delegate and constructor

Delegate is a reference type that holds the reference of a class method. Any method which has the same signature as delegate can be assigned to delegate. It is very similar to the function pointer but with a difference that delegates are a type-safe. We can say that it is the object-oriented implementation of function pointers. There are three steps… Read more →

Sealed,static and abstract class difference.

Sealed Class A sealed class cannot be used as a base class. Sealed classes are primarily used to prevent derivation. Because they can never be used as a base class, some run-time optimizations can make calling sealed class members slightly faster.   We can also use the sealed modifier on a method or property that overrides a virtual method or… Read more →

Constant,readonly and static discussion

Constant 1)      It is assigned a value at time of declaration but not modified at any time. By default constant is static, hence cannot define as static.const field is a compile time constant. It is fully evaluated at compile time.const keyword to built-in value types (byte, short, int, char, float, decimal etc.), enum, string or reference types which can be… Read more →

Debug and Trace discussion

Debug is used during debugging. Trace is writing to the log file. It is kind of like logging. Both are very similar, but do tracing for long term retention, debugging for real time debugging. When we monitor application execution and performance in development stage is termed as “Debugging” and when you do in deployed environment it’s termed as ‘Tracing’. Debug… Read more →

Table variable , CTE and Temporary table scope

When to Use CTE: It stands for Common table expression.it was introduced on sql server 2005. Below is details for using a CTE: This is used to store result of a complex sub query for further use. It is  also used to create a recursive query. When to use Temporary Table: It is created at Run-time and behave same as… Read more →

Reflection in .Net

The classes in the System. Reflection namespace, together with System.Type, enable to obtain information about loaded assemblies and the types defined within them, such as classes, interfaces, and value types. We can also use reflection to create type instances at run time, and to invoke and access them. For topics about specific aspects of reflection. Assemblies contain modules, modules contain… Read more →

Difference between Convert,Explicit type,Tryparse and Parse c#

(int)Something; int.Parse(Something); Convert.ToInt32(Something); 1) that is a cast 2) Parsing taking in a string and attempts to convert it to a type. —when string is null refence,it will throw ArgumentNullException.if string is other than integer value ,it will throw FormatException.if reperesents a number less than Min or maxvalue than will throw overflowexception. string s1 = “1234”; string s2 = “1234.65”;… Read more →