- LINQ needs to process the complete query, which might have a performance impact in case of complex queries against stored procedures which only need serialize sproc-name and argument data over the network.
- LINQ is generic, whereas stored procedures etc can take full advantage of the complete database features.
- If there has been a change, the assembly needs to be recompiled and redeployed whereas stored procedures are much simpler to update.
- It’s much easier to restrict access to tables in database using stored procedures and ACL’s than through LINQ.
Search This Blog
Wednesday, December 15, 2010
Disadvantages of LINQ over Stored procedures
Disadvantages of LINQ over stored procedures:
Saturday, November 27, 2010
Concept of Early Binding and Late Bindind in C#
Before discussing about the differences, let's know what is meant by Early and Late Binding.
Early Binding:
The name itself describes that compiler knows about what kind of object it is, what are all the methods and properties it contains. As soon as you declared the object, .NET Intellisense will populate its methods and properties on click of the dot button.
Common Examples:
ComboBox cboItems;
ListBox lstItems;
In the above examples, if we type the cboItem and place a dot followed by, it will automatically populate all the methods, events and properties of a combo box, because compiler already know it's an combobox.
Late Binding:
The name itself describes that compiler does not know what kind of object it is, what are all the methods and properties it contains. You have to declare it as an object, later you need get the type of the object, methods that are stored in it. Everything will be known at the run time.
Common Examples:
Object objItems;
objItems = CreateObject("DLL or Assembly name");
Here during the compile time, type of objItems is not determined. We are creating an object of a dll and assigning it to the objItems, so everything is determined at the run time.
Early Binding vs. Late Binding
Both have merits and demerits, it's the developer decision to choose the appropriate binding based on the scenario.
Early Binding:
The name itself describes that compiler knows about what kind of object it is, what are all the methods and properties it contains. As soon as you declared the object, .NET Intellisense will populate its methods and properties on click of the dot button.
ListBox lstItems;
The name itself describes that compiler does not know what kind of object it is, what are all the methods and properties it contains. You have to declare it as an object, later you need get the type of the object, methods that are stored in it. Everything will be known at the run time.
objItems = CreateObject("DLL or Assembly name");
- Application will run faster in Early binding, since no boxing or unboxing are done here.
- Easier to write the code in Early binding, since the intellisense will be automatically populated
- Minimal Errors in Early binding, since the syntax is checked during the compile time itself.
- Late binding would support in all kind of versions, since everything is decided at the run time.
- Minimal Impact of code in future enhancements, if Late Binding is used.
Both have merits and demerits, it's the developer decision to choose the appropriate binding based on the scenario.
Subscribe to:
Posts (Atom)