I understand that a delegate is used to decouple client and business layer. A client invokes a business service through delegate object. My question is that is it good to have interface of delegate exposed to client (Design by contract principle OR DIP) not the actual delegate object. Or is it just fine to have a delegate object accessed by the client directly.
Share
I would opt for the interface, because that would allow me to separate what’s done from the how. I might find it advantageous to made the delegate a proxy or decorate it with an aspect; both are easy with an interface.