Hi guys,
I have got a design issue.
I am Developing application for "application log" - which will be transformed into web reports or will be stored into Database.
Report is an interface.
- boolean validateLogStatement(
String statement)
- addLogStatement(String statement)
- setWriter(ReportWriter writer)
ReportExecutor will get a file and a Report reference as a constructor parameter. and execute line by line on Report.
it must be clear that i'll be having different
implementation Report classes.
i.e. PingLogReport
these
implementation report class is implementing visitor
pattern. So they have visit method.
& i am having different visitor interfaces for different
implementation report classes, i.e. PingReportVisitor and it's implementation visitor classes i.e. PingReportSummaryVisitor.
Now, is there anyway i can generalized(declare) this visitors into Report interface, (Abstract class can also work, i don't have any problem).???
I did it, but i have to cast it into Visitor implementation. Which i don't want to do.
And please comment on design also.
Regards,
Nachiket