I am looking at the source for the Project Silk project and there is a "handler" pattern that I have not seen before. First - this link from 2009 alludes to it but leaves me hanging
What the sample shows is a one method class where each class represents one method for each method in a related repository class. The classes are named like method names.
public class GetFillupsForVehicle
{
private readonly IFillupRepository _fillupRepository;
public GetFillupsForVehicle(IFillupRepository fillupRepository)
{
_fillupRepository = fillupRepository;
}
public virtual IEnumerable<FillupEntry> Execute(int vehicleId)
{
try
{
var fillups = _fillupRepository
.GetFillups(vehicleId)
.OrderBy(f => f.Date)
.ToList();
return new ReadOnlyCollection<FillupEntry>(fillups);
}
catch (InvalidOperationException ex)
{
throw new BusinessServicesException(Resources.UnableToRetireveFillupsExceptionMessage, ex);
}
}
}
Could someone explain this pattern or point me to something that I could read to learn more?
Thanks, Paul