Often in our application development we need to acquire and release some resources. That unmanaged resources could be files that we want to use from time to time, database connections, fonts etc. The important thing is to release resources once we have done with it. Since the CLR uses Garbage Collection to manage lifecycle of objects […]
The principles basically are the guidelines for a better software. They are the MAGIC 5, that keeps protecting you while you design the architercture of the application, they are the 5 SOLID ancient golems, if you will. They helps you fight the code smells, due to refactoring. So, let’s check ‘em out:
Garbage collection servers an automatic memory manager. It occurs when one of the following conditions is true: – The system has low physical memory. – The memory that is used by allocated objects on the managed heap surpasses an acceptable threshold. This threshold is continuously adjusted as the process runs. – The GC.Collect method is […]
The difference between abstract class and interface can be described in following table: Interface Abstract class Interface support multiple inheritance Abstract class does not support multiple inheritance Interface doesn’t Contains Data Member Abstract class contains Data Member Interface doesn’t contains Constructors Abstract class contains Constructors An interface Contains only incomplete member (Events, properties, methods, indexers) […]
Inheritance, together with encapsulation and polymorphism, is one of the three primary characteristics (or pillars) of object-oriented programming. Inheritance enables you to create new classes that reuse, extend, and modify the behavior that is defined in other classes. The class whose members are inherited is called the base class, and the class that inherits those […]
In order to refresh and consolidate main paradigms of OOP let’s talk about encapsulation first: Encapsulation, in object oriented programming methodology, prevents access to implementation details. It enables a group of properties, methods and other members to be considered a single unit or object.
Nullable types are instances of the System.Nullable struct. They are value types, though we can assign null to them. For example int? is a Nullable<Int32>. All nullable types have two values: The value of the data type. A boolean value that tells if value has been set(HasValue property). DateTime also is value type, btw