The SOLID principles are five programming principles which is considered to be the foundation of every well designed application >> easy to extend and maintain (small well defined classes with clear contracts.)
Thứ Ba, 20 tháng 6, 2017
Thứ Sáu, 24 tháng 2, 2017
Thứ Năm, 23 tháng 2, 2017
Differences between Singleton Pattern and Static Class
Singleton Pattern:
- Singleton is a pattern and not a keyword
- Allow just 1 class persistent instance across the lifetime of an application (a single instance can be passed as a parameter to other methods, and treated as a normal object)
- You can create one instance of the object and reuse it.
Thứ Tư, 22 tháng 2, 2017
Differences between Stack and Heap
Stack and a Heap ?
Stack is used for static memory allocation and Heap for dynamic memory allocation, both stored in the computer's RAM .
Variables allocated on the stack are stored directly to the memory and access to this memory is very fast, and it's allocation is dealt with when the program is compiled. When a function or a method calls another function which in turns calls another function etc., the execution of all those functions remains suspended until the very last function returns its value. The stack is always reserved in a LIFO order, the most recently reserved block is always the next block to be freed. This makes it really simple to keep track of the stack, freeing a block from the stack is nothing more than adjusting one pointer.
Thứ Ba, 21 tháng 2, 2017
Difference between a Value Type and a Reference Type
The Types in .NET Framework are either treated by Value Type or by Reference Type. A Value Type holds the data within its own memory allocation and a Reference Type contains a pointer to another memory location that holds the real data. Reference Type variables are stored in the heap while Value Type variables are stored in the stack.