Dynamic Binding<br />Dynamic binding postponed the process of resolving types, members, and<br />Operations from compile time to runtime. <br />Dynamic binding is useful when you are interoperating with COM or dynamic language [e.g. Iron Ruby ], otherwise you can do it by yourself instead of compiler using reflection .<br />Dynamic<br />Static<br />* varkeyword is static binding but its Let the compiler figure out the type <br />*Search on web for the following points to expand your knowledge in dynamic binding:<br /><ul><li> Custom Binding and IDynamicMetaObjectProviderinterface
Optional parameter:<br />Declaration<br />Using<br />Rules<br /><ul><li> Optional parameters cannot be marked with ref or out.
Optional parameters must be after all mandatory parameters [params arguments still always come last].</li></li></ul><li>Named parameters <br />Rather than identifying an argument by position, now you can identify it by name, this is useful to increase code readability and simplify calling methods that have long arguments list.<br />Example<br />
When you treat a generic interface or delegate of one type as a generic interface of a derived type will give you an exception .<br />Example<br />
In order to solve this issue add the in or out modifiers to your generic interface definition.<br />Covariance <out T><br />Contravariance <in T><br />Only be used for interfaces that contain<br />methods that return the generic type<br />Only be used for delegates or interfaces that contain methods that accept the type as a parameter, is the complement to covariance<br />And can be combined <br />
Ahmad R. ABU ARJA<br />Project Lead / Senior Software Engineer<br />MCSD, MCPD, MCITP<br />email: firstname.lastname@example.org<br />www.twitter.com/abuarja<br />www.linkedin.com/in/abuarja<br />