namespace Components.Reports.QueryHandlers
{
public abstract class ReportQueryHandler
{
protected ReportQueryHandler _reportHandlerSuccessor;
protected ReportType _reportRequest;
public ReportQueryHandler(ReportType reportType)
{
_reportRequest = reportType;
}
protected string LoadQuery(string queryFilePath)
{
if (!string.IsNullOrEmpty(queryFilePath))
return File.ReadAllText(queryFilePath);
else
throw new ArgumentNullException(queryFilePath);
}
public virtual void HandleReportRequest()
{
if (_reportHandlerSuccessor != null)
_reportHandlerSuccessor.HandleReportRequest();
}
}
}
15.11.08
Chain of responsibility
This chain of resposibility is from a system that handles a variety of reporting requests. The inheriting handlers are Russian dolled(each handler knows its successor).
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment