Difference between array, arraylist, List, Hashtable, Dictionary and SortedList in c#

Basic difference is that arrays are of fixed size. Whereas an ArrayList implements the list data structure and can dynamically grow. While arrays would be more performance that a list, a list would be far more flexible since you don't need to know the required size initially. Array - represents an old-school memory array - kind of like a alias for a normal type[] array. Can enumerate. Can't grow automatically. I would assume very fast insertion, retrieve and speed. ArrayList - automatically growing array. Adds more overhead. Can enum., probably slower than a normal array but still pretty fast. These are used a lot in .NET List - one of my favorites - can be used with generics, so you can have a strongly typed array, e.g. List . Other than that, acts very much like ArrayList. Hashtable - plain old hashtable. O(1) to O(n) worst case. Can enumerate the value and keys properties, and do key/val pairs. Dictionary - same as above only strongly typed via generics, such a...

What is Repository Pattern in ASP.NET MVC?

-Repository pattern is used as a default entity operation that allow the decoupling of the components used for presentation.


-Repository pattern allows easy testing in the form of unit testing and mocking.


-Repository pattern will have the proper infrastructure services to be used in the web applications.


-It uses the mechanism of encapsulating that provides storage, retrieval and query for the implementation of the repository.


-Repository patterns are hard coded in the application that is to be used in ASP.NET MVC architecture


-Repository pattern is useful for decoupling entity operations form presentation, which allows easy mocking and unit testing.


-The Repository will delegate to the appropriate infrastructure services to get the job done. Encapsulating in the mechanisms of storage, retrieval and query is the most basic feature of a Repository implementation.


-Repository pattern is useful for decoupling entity operations form presentation, which allows easy mocking and unit testing.


-Most common queries should also be hard coded to the Repositories as methods. Which MVC.NET to implement repository pattern Controller would have 2 constructors on parameterless for framework to call, and the second one which takes repository as an input:

Comments

  1. Good job in presenting the correct content with the clear explanation. The content looks real with valid information. Good Work

    kajal hot

    ReplyDelete

Post a Comment

Popular posts from this blog

C# Interview Questions on Inheritance

C# Interview Questions on value types and reference types

Why to use UpdatePanel control in AJAX ASP.NET?