Author: huxiaodong | Posted on: 9/18/2008 11:00:36 PM | Views : 255

I am on a project which needs to  process several type of messages,for each type message,the process is little different.

following is the sample of Message I defined.

interface IMessage

{

 //

}

class MessageA:IMessage

{

}

class MessageB:IMessage

{

}

following is the process class

interface  ITransformer

{

void Transform(IMessage message);

}

class Transformaer:ITransformer

{

void Transform(IMessage message)

{

  if(message is MessageA)

 {

  //transform messageA

 } ...

Go to the complete details ...