-
1. Re: Consistent use of Java 5 features (enum, generics etc)
jesper.pedersen Jul 22, 2013 1:59 PM (in response to twogee)I hate enum's So keep the current approach.
We could switch to Java 7 as baseline, but the code shouldn't be changed "just because" - only in cases where it becomes clearer to the reader.
Extending AbstractReport isn't a valid requirement, as companies can implement their own report hierarchy which doesn't extend the TTALE classes. So the Report interface is the requirement.
-
2. Re: Consistent use of Java 5 features (enum, generics etc)
twogee Jul 23, 2013 7:24 AM (in response to jesper.pedersen)The beauty is in the eye of the beholder...
What's wrong with enums? They give you built-in bound checks.
Currently, as I said before, Main in master repository does not require anything of any reports.
Thanks for pointing it out, I corrected the code in my repository so that custom reports need only implement Report.
I hope you do not object that built-in reports must extend AbstractReport that eg provides methods guaranteeing uniform look of HTML.
-
3. Re: Consistent use of Java 5 features (enum, generics etc)
jesper.pedersen Jul 23, 2013 3:16 PM (in response to twogee)enum's are close to impossible to extend, and although they buy something over an int it isn't enough IMHO.
Main should require that all reports implements the Report interface. Something the developer guide should discuss if it doesn't already... TTALE native reports should extend AbstractReport.
-
4. Re: Consistent use of Java 5 features (enum, generics etc)
twogee Jul 25, 2013 7:50 AM (in response to jesper.pedersen)enum is a set of values, not extensible by design; why would you need to extend an ArchiveType, or ReportStatus, or ReportSeverity?
I read the dev guide, it is quite specific about Report, but a bit vague about AbstractReport. I believe I got it right now, anyway.
-
5. Re: Consistent use of Java 5 features (enum, generics etc)
jesper.pedersen Jul 25, 2013 11:40 AM (in response to twogee)Because custom reports may take advantage of that - do one custom report that uses Report, and another that uses AbstractReport - both has to work without being part of the TTALE distribution.
-
6. Re: Consistent use of Java 5 features (enum, generics etc)
twogee Jul 26, 2013 7:25 AM (in response to jesper.pedersen)I understand your reluctance to change Report interface, but it is Main that checks Status and it can be "undecided" when Status is arbitrary - custom extensions do not tell about semantics of their Status values.
How can you use "failOnError", "failOnWarning" etc then? It looks like YAGNI for me. So I'd rather put Status and Severity into Report as inner enums