Geeks With Blogs
Prasanna's Blog BizTalk, WCF, C# and Software Factories
The strategy pattern is typically used when your programmer's algorithm should be interchangeable with different variations of the algorithm. For example, if you have code that sorts array, under certain circumstances, you might want to create QuickSort and under other circumstances, you might want to create Merge Sort. The strategy pattern is usually ......

since i have already posted basic ContraVariance in delegate, i am not going to go thru the same again, those of you who had missed my earlier post can refer here here is an example of using generics with contravariance namespace ContravarianceWithGenerics { public interface IEquity { string ToString(); string Save(); } //base class abstract class Equity ......

A generic class that uses parameterized types, like MyBase<T>, is called an open-constructed generic. A generic class that uses no parameterized types, like MyBase<int>, is called a closed-constructed generic. You may derive from a closed-constructed generic; that is, you may inherit a class named MyDerived from another class named MyBase, ......

A generic class allows you to write your class without committing to any type, yet allows the user of your class, later on, to indicate the specific type to be used. While this gives greater flexibility by placing some constraints on the types that may be used for the parameterized type, you gain some control in writing your class. Let's look at an ......

Delegate inference allows you to make a direct assignment of a method name to a delegate variable, without wrapping it first with a delegate object. The oldwayclass shows implementation in C# 1.1 class OldWayClass { delegate void notifyDelegate(); public void InvokeMethod() { notifyDelegate del = new notifyDelegate(SomeMethod); del(); } void SomeMethod() ......

Covariance and contravariance provide a degree of flexibility when you match method signatures with delegate types. Covariance permits a method to have a more derived return type than what is defined in the delegate. Contravariance permits a method with parameter types that are less derived than in the delegate type. contravariance example: This example ......

When we generate (WCF) service proxy class for a service by using svcutil.exe, it creates a proxy that derives from System.ServiceModel.ClientB... The proxy implements IDisposable and the client code can be wraped inside using statement and guaranteed clean-up in the face of exceptions. However, the System.ServiceModel.ClientB... ......

i just finished writing Windows service host for my WCF services, there were no crash or exceptions thrown either by client or server, I was just browing event log to check things were fine, then noticed at end of each call to WCF service, there was a log message with the following exception System.ServiceModel.Communi... occurred Message="The ......

I guess most of us know what a static class is, you can't instiantiate, cannot have any instancing members etc. This might sound funny but the truth is Static class are "Abstract and Sealed", never understood why ? If you dont agree with me, use reflector or ILDASM and view your static Class . Happy Programming !!! ---- ......

Copyright © Prasanna Krishnan | Powered by: GeeksWithBlogs.net