Example:
public class BusinessTransactionFactory where T : IBusinessTransaction
{
readonly Func _createTransactio
@Steven's answer is very well thought out; personally I find limited use of Func<T>
arguments readable.
What I don't understand is the value of BusinessTransactionFactory<T>
and IBusinessTransactionFactory<T>
. These are just wrappers around the delegate. Presumably you're injecting IBusinessTransactionFactory<T>
somewhere else. Why not just inject the delegate there?
I think of Func<T>
(and Func<T, TResult>
, etc.) as factories. To me you have a factory class implementing a factory interface wrapping a factory delegate, and that seems redundant.