In a typical web application communication between the browser and the web server follows the request and reply pattern.Browser makes the request to the web server which sends the response in return.So the communication needs to be initiated by the web browser.This works well for most of the web applications. Sometimes we need to implement […]
Archives for October 2015
Use and Example of Singleton Pattern in C#
Name Singleton Type Creational Pattern Many times we need to restrict a class to only a single instance.Singleton pattern restricts the clients of the class from creating multiple instances of the class.There is a global access point ,such as a method,which returns the same object every time it is invoked.Singleton pattern is a creational pattern since […]
Use and Example of Decorator Pattern in C#
Name: Decorator Type: Structural Pattern Decorator pattern allows to add state and behavior to an object at runtime.It’s natural to compare this pattern with inheritance.State and behaviour can also be added through inheritance. Here we will see the use and example of Decorator Pattern in C#. Suppose we have an existing class and we […]
Events in AngularJS
Events and Event handlers Event handling is an important feature of most applications.Event is an action performed by an end user or some application component to notify the application.Common example of events are: User clicking a button on the User Interface or pressing a shortcut key. Notification by a database component when a new record is inserted […]
Compare List elements in C# using LINQ
LINQ extension methods are used to perform queries on the lists and collections.We can use C# for the LINQ queries rather using any other language such as SQL. We can Compare List elements in C# using LINQ ,by using the extension methods. To compare lists using LINQ there is a SequenceEqual extension method provided by the framework.If […]