All Articles

Using Extension Methods in C#

Extension methods are a way to add methods to a class without changing its source code or adding it into a derived class. Creating extension methods example Define extension method – public static class StringExtensions     {         public static string Reduce(this String str, int numOfWords)         {             if (numOfWords <= 0)                 return str;             var numWords = str.Split(‘ ‘);             if (numOfWords >= numWords.Length)                 return str;             return String.Join(” “, numWords.Take(numOfWords));         }     } Shorten is an extension class on the String class. Adding as above, we were able…

All Articles

C# Events and Delegates

We use events and delegates to extend applications and to implement loose coupling. Rather than adding various method calls within an implementation and then recompiling the class, we publish the need to call a set of methods as an event from the class that will invoke those methods (publisher). The publisher will thus define the delegate which will act…

All Articles

Using C# Delegates

  Delegates is a way to support addition of multiple features (eg: methods) to a framework without the need to recompile the core class that uses these methods. Delegate is a reference to a function/s and is itself an object (derived from MulticastDelegate) that knows how to call a method or group of methods. The…

All Articles

What is the backbone of SOA connectivity?

This is a core question that we need to ask when we talk about SOA (Service oriented architecture). SOA connects enterprise components within and outside by easy integration, coordination and loosely coupled processes that can be coupled easily. The main theme that comes up when the number of interacting components increases is the complex messaging…

All Articles

Which REST framework should I use

There are multiple Java based REST frameworks that is use today. Some of the top players are as below –                 1. Reslet – http://www.restlet.org/                 2. Apache CXF – http://cxf.apache.org/ ,  http://cxf.apache.org/docs/jax-rs.html, http://jax-ws.java.net/2.2.7/docs/                 3. JAX-RS Reference implementation – Jersey – http://jersey.java.net/                 All of the above frameworks supports J2EE resident Webservice API for…