Tuesday 27 January 2009

DDD South West – Saturday 23rd May 2009

Are you a .NET Developer in the South West of the UK?

Do you want to attend a FREE one day event, covering all that is new and great in .NET?

The DeveloperDeveloperDeveloper (DDD) South West meeting is where you need to be, this event is held on a Saturday so you do not need to worry about taking time from your busy work schedule to attend.  For those of you who know the DDD events, which happen in Reading yearly, this event will follow the same high standards for speakers and topics covered. 

As we are aware that the South West has lacked this kind of event for a very long time we will be holding the event in Taunton at the Queens College.

The exact agenda for the day is still being finalised but rest assured as soon as it is you will know well in advance, to show you how we have organised ourselves our timeline for the run up to the meeting is as follows;

  • Tuesday 27th January - Website goes public, Call For New Speakers opens
  • Tuesday 3rd March - Registration goes live
  • Tuesday 31st March - Call For New Speakers closes
  • Tuesday 7th April - Vote for favourite sessions opens
  • Thursday 30th April - Vote for favourite sessions closes
  • Saturday 23rd May – DDD South West

To stay in touch with the latest news about the event or find more information about the venue and the team running it please visit the official website @ http://www.dddsouthwest.com

Tuesday 13 January 2009

Web Client Software Factory (WCSF) Event Broker

To get the EventBroker to work with version 2.0 of the Web Client Software Factory read this blog.

Although the code change in the above blog entry allows the Event Broker to work you may still come across some problems, the one I recently encountered was related to generic method overloads.

Before generics you could not overload a method without changing its signature, but with generics you can alter the method signature with a type T return for example;

string Get(sting value1)

overload to;

T Get<T>(sting value1)

Now to the compiler the two methods are different, however when you use reflection to find methods and you use the Type.GetMethod, supplying the method name ‘Get’ with the correct types you will receive a ‘System.Reflection.AmbiguousMatchException’ exception. You receive this exception because to find the generic method you supply ‘Get’ and not ‘Get<T>’ which is also how you return the non-generic ‘Get’ method.

Due to the issue above when the Event Broker runs its sanity check by reflecting all your method the ‘System.Reflection.AmbiguousMatchException’ exception is raised when you have a generic overload to overcome this replace;

EventBrokerSanityCheck.cs, ln 147

interfaceInfo = @interface.GetMethod(subscribingMethodInfo.Name, types.ToArray());

With;

MethodInfo interfaceInfo=null;
try
{
    interfaceInfo = @interface.GetMethod(subscribingMethodInfo.Name, types.ToArray());
}
catch (System.Reflection.AmbiguousMatchException)
{
    //Bug fix for generic overloads
    interfaceInfo = @interface.GetMethods().Where(w =>
            w.Name == subscribingMethodInfo.Name
            && w.IsGenericMethod == subscribingMethodInfo.IsGenericMethod).First<MethodInfo>();

    ParameterInfo[] parametersInterface = interfaceInfo.GetParameters();

    if (types.ToArray().Length == parametersInterface.Length)
    {
        for (int i = 0; i < parameters.Length; i++)
        {
            if (parametersInterface[i].ParameterType != types[i])
            {
                interfaceInfo = null; //clear the interface info as we did not find the method
                break;
            }
        }
    }
    else
    {
        interfaceInfo = null; //clear the interface info as we did not find the method
    }
}

[Disclamer : I give no warranty to the correctness of this solution or that there is not a better way to do it, I just hope I help you out of a hole as it did with me]

Tuesday 6 January 2009

Patterns & Practices - Pocket Guides

The Patterns & Practices team at Microsoft spend their time looking at the best methodologies to design and build software and as part of this they produce many frameworks to build software with and guidance documents which outline their proposed best approaches to designing certain software.

Some of these guidance documents have been made available in pdf format covering the following architecture topics;

  • Web Applications
  • RIA Clients
  • Services

Each guide gives practical guidance on what you need to consider when creating software for each environment, these should be your first stop when stating the creation of your software.

To download each guide go here