Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP:Added a module reporting from devonfw #194

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

WIP:Added a module reporting from devonfw #194

wants to merge 3 commits into from

Conversation

vapadwal
Copy link
Member

@vapadwal vapadwal commented Jan 21, 2020

Currently its WIP because there is an thread going on discussion, should we include it in devon4j

see https://www.yammer.com/capgemini.com/#/threads/show?threadId=512250200367104&messageId=512250200367104

@vapadwal vapadwal changed the title WIP : added a module reporting from devonfw WIP : Added a module reporting from devonfw Jan 21, 2020
@vapadwal vapadwal changed the title WIP : Added a module reporting from devonfw WIP: Added a module reporting from devonfw Jan 21, 2020
@vapadwal vapadwal changed the title WIP: Added a module reporting from devonfw Added a module reporting from devonfw Feb 3, 2020
Copy link
Member

@hohwille hohwille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am still in the middle of the review but to not loose my work I already post it now as early feedback.

import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
* This is the entry point for unit tests.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is for Unit tests, why is it in src/main then rather than src/test?


private String templatePath;

private HashMap<String, Object> params;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HashMap is a specific implementation. Use Map instead as "API".

import java.util.List;

/**
* This is the interface for a simple facade to generate a report based on Jasper Reports library.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO this is an API that abstracts from the underlying implementation. Hence Jasper Reports library is "just" the current or default implementation.

* @param file the file where the report must be created.
* @param format - report format
*/
public void generateReport(Report report, File file, String format);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • omit public keyword inside interface
  • use default method delegating to generateReport with OutputStream?
  • is File still the state of the art type of choice or should we support java.nio.Path?

* @param file the file where the report must be created.
* @param format - report format
*/
public void generateSubreport(Report masterReport, List<Report> reports, File file, String format);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who. This is quite a sophisticated API. From the JavaDoc I do not really get what it will do.
I will see if I understand it when reading the implementation but JavaDoc should be more expressive.

* @param file the file where the report must be created.
* @param format - report format
*/
public void concatenateReports(List<Report> reports, File file, String format);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does concat mean in this context? If I concat two PDF files, I will get garbage.
So is the content of the reports concatenated to a single file. Is this a regular use-case. Might be cool in some cases. So I get a table of contents for the entire document similar to what we do with asciidoc and includes... Maybe the JavaDoc can again clarify the questions that obviously came to my mind here...

Comment on lines +57 to +77
@Bean
public JRAbstractExporter getExcelExporter() {

return new JRXlsExporter() {
@Override
public String getExporterKey() {

return ReportingConstants.XLS;
}
};
}

/**
* Returns the {@link JRAbstractExporter} for Xls version
*
* @return
*/
@Bean
public JRAbstractExporter getPdfExporter() {

return new JRPdfExporter() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...
This looks like we turned a plugable concept of jasper into a monolithic approach. Does not seem to be smart to me. Am I missing something...?!? And if Jasper is providing such exporters as plugins like JRXlsExporter and JRPdfExporter, etc. why on earth do we have to override getExporterKey() method from outside. This appears strange to me. However, I am reviewing Jasper now while I actually should review this devon4j module instead...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also interesting that for getPdfExporter we have JavaDoc while for the others we dont. Further again this is the JavaDoc antipattern of

* Returns ...
* @return 

So simply write what the method returns after the @return tag withour the Returns. This is how JavaDoc works. I know that you already know and just took over the code from devon repo. However, I am seeing this a lot in reviews. Maybe we should create a better DoD or do some trainings for all the involved coders to avoid talking about basics in reviews.

@vapadwal vapadwal changed the title Added a module reporting from devonfw WIP:Added a module reporting from devonfw Apr 21, 2020
@hohwille hohwille changed the base branch from develop to master January 7, 2021 15:58
@maybeec maybeec marked this pull request as draft November 8, 2021 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants