khurram
03-28-2006, 01:44 PM
I have a class which inherits from the base class; the instance of my class is returned from the factory class; the user interface layer is bound to the base class.
public class HelpdeskFunctionality {
public virtual List<HelpdeskCase> GetOpenedCases() { return null; }
//..Few more
}
internal class HelpdeskImplementation : HelpdeskFunctionality {
public override List<HelpdeskCase> GetOpenedCases() {
//..Implementation
}
//..Few more
}
I am trying to weave few aspects; using this
public class HelpdeskFactory {
public HelpdeskFunctionality GetHelpdeskFunctionality() {
Spring.Aop.Framework.ProxyFactory pf = new ProxyFactory(new HelpdeskImplementation());
pf.AddAdvice(new Aspects.LoggingAspect());
pf.AddAdvice(new Aspects.ExceptionAspect());
return (HelpdeskFunctionality)pf.GetProxy(); //Not casting
}
}
Problem is; the base class gets changed; and the user interface is not binding/working as expected; that is with the above code; I am breaking the things. Need suggestions/guidelines.
public class HelpdeskFunctionality {
public virtual List<HelpdeskCase> GetOpenedCases() { return null; }
//..Few more
}
internal class HelpdeskImplementation : HelpdeskFunctionality {
public override List<HelpdeskCase> GetOpenedCases() {
//..Implementation
}
//..Few more
}
I am trying to weave few aspects; using this
public class HelpdeskFactory {
public HelpdeskFunctionality GetHelpdeskFunctionality() {
Spring.Aop.Framework.ProxyFactory pf = new ProxyFactory(new HelpdeskImplementation());
pf.AddAdvice(new Aspects.LoggingAspect());
pf.AddAdvice(new Aspects.ExceptionAspect());
return (HelpdeskFunctionality)pf.GetProxy(); //Not casting
}
}
Problem is; the base class gets changed; and the user interface is not binding/working as expected; that is with the above code; I am breaking the things. Need suggestions/guidelines.