What are the disadvantages of using Java for report data preparation?

Some reports have complex data preparation actions that cannot simply be written in SQL, so Java is often used to prepare the report data. This is flexible but has obvious disadvantages as well. In terms of implementation difficulty, Java lacks a class library specifically for structured data computation, and it is not improved significantly even with Stream. So programmers have to write long code even for simple computations, let alone complex calculations. And Java's interfaces for accessing various data sources are very primitive, which makes the code much more complicated. In terms of operation and maintenance, Java is a compiled language, so the application needs to be restarted if the report data source is modified, which is very inconvenient. In terms of application framework, Java code needs to be deployed together with the main program, which is not conducive to the separate maintenance of report module.

 

These problems can be solved by using esProc SPL, an open-source data processing engine specializes in structured data computation and has a rich library of computation classes to satisfy complex report data preparations. Meanwhile, esProc naturally supports multiple data sources (RDB, NoSQL, JSON, CSV, Webservice, etc.) and can also realize mixed calculations across data sources.

 

esProc can perform calculations in multiple steps like Java, and the interpreted execution of SPL, the script of esProc, supports hot switching. SPL's agile syntax allows operations hard to implement in Java to be done just in a few lines in SPL. For example:

 

Query the growth amount and sales of each first month over the same month of the previous quarter (some months may have no data) according to the monthly sales table. The SPL is as follows:


A

1

=db.query(“select * from sales”).align@1([1,4,7,10],smonth)

2

=A1.new(#:month,amount,amount-amount[-1]:growth)

 

Moreover, esProc can be used as an embedded JDBC driver integrated into the reporting tools, which access the SPL calculations via JDBC in the same way as accessing a database.

undefined 

After the integration of esProc in the reporting application, the report module can be operated and maintained separately from the main program. Therefore, even if the report module consumes so many resources and leads to crash, the main application will not be affected, further safeguarding the system security.