Friday, April 17, 2015

Kendo arrayForEach vs Traditional jquery $.each loop

We have many options to run loop in javascript. But here if we compare the  ko.utils.arrayForEach and  Traditional jquery $.each loop.

Here are the reasons you can consider while selected between these two

1.  Traditional $.each loop is much faster than ko.utils.arrayForEach
2. Traditional $.each loop provides you the flexibility for Exit at any point of time while  ko.utils.arrayForEach doesn't support return


Example 

 ko.utils.arrayForEach(myCollection(), function (item) {
           if (!item.isAvailable)
                return false; // it will not work and the loop will run for whole collection

            });



$.each(myCollection(), function (index,item) {
           if (!item.isAvailable)
                return false; // it will work and it will quit from loop once the item is not available
         });

Thursday, April 9, 2015

Kendo if (ko if) vs data-bind if

It's very small thing but it may be the point of ignorance somewhere.  Sometime we don't consider some small points during implementation. And here it is :

If we have requirement to draw controls/table rows based on any condition then we should use  <!-- ko if : <condition> --> instead of data-bind="if: <condition> ".

Because data-bind="if: <condition>" doesn't restrict to creates the control/table row in actual but only controls the behaviour visible show/hide.  While the  <!-- ko if : <condition> -->  restricts the program to create control/row until condition satisfied.


It’s just an information and could be considered during implementation based on your requirement. 

Tuesday, September 9, 2014

Consider 7 simple points before adopting the WCF



There are so many things you need to consider before opting any specific framework and technology for your system.  Here I am trying to highlight some basic points before adopting WCF:
1.       Don’t rebuild existing application just for the sake of using WCF.
2.       Do develop a detailed version of how one’s software should identically be constricted that take into the account.
3.       Do consider how to integrate one’s existing system with new services.
4.       Do specify base addresses of the services that are not hosted within IIS.
5.       Do specify base address and uses for all the transport protocols.
6.       Do specify endpoint addresses that are relative to the base addresses.
7.       Don’t use absolute addresses for endpoints.
In addition of these WSDL makes the integration tightly coupled.

Please share your experiences to make this discussion more healthy and fruitful for others where you realized and used WCF over Web API or ASMX.


Thursday, December 26, 2013

Visual Studio Tips #2 NuGet ( Auto update package and missing package)


In previous post Update Package Manager we tried to explain how to update the NuGet Package Manager.

These days we add many packages directly from NuGet in our application. Although all of these are not used and sometime we manage this situation and keep the used reference assemblies in different folder. Now instead of refer it from default package folder we add the reference from that assemblies folder.

It makes easy to manage the used assemblies for the project. But it cause the problem while we do integrate the code in our repository and forgot to add the assembly in referenced folder. Once the another team member took the update .. oops... it doesn't work and we need to check and manage assembly by our own.

But now integrated mode of IDE makes it more easy. You can enable or disable the facility to validate download and add the missing assemblies automatically at the time of compiling every time.


You can enable IDE to add the missing package automatically with the following setting steps:

    1. Right click on the Project in Solution Explorer > Select the Manage NuGet Packages as highlighted in screenshot below.


2. Select the Setting option


3. Go to the General Option of Package Manager option and Enable/Disable the option to download missing packages.


If the option is enabled your Visual Studio will check the missing packages and download it automatically to make your project work without worry of package assemblies in the project.

But if the referenced packages and assemblies are not in targeted default folder and you are following your own structure to keep the references then its better to disable and add the package manually to keep the assemblies at desire location.