Good or Bad Design

The following is the design for a reporting module. Any suggestions on the same would be appreciated.

1)ChartGenerator implements Generator.

Attributes ?

private int ncompID = UNDEF

private int njobId = UNDEF

private String storedproc = ""

private java.util.Date fromdt = null

private java.util.Date todt = null

Methods ?

generateTrendlinevalues(String[] entities2plot)

generatePieChart(String[] entities2plot)

generateBarChart(String[] entities2plot)

generateBarChart(ReportingLabelsAndValues labelvals,

String[]boards)

2)GenerateValues implements Generator.

Attributes ?

private int ncompID = UNDEF;

private int njobId = UNDEF;

private Date fromdt = null;

private Date todt = null;

private double[] values = null;

private String[] labels = null;

Methods ?

public BaseObjectList generateData(String storedproc)

public String[] getLabels()

public double[] getValues()

3)ReportingSource extends baseobject

Attributes ?

String label

Double value1

Methods ?

getSetRepSource()

4)ReportingSourceDAO extends baseobjectDAO

5)Servlet ?responsible for generating the chart

Code in the servlet

GenerateValues gvalues = new GenerateValues(compid, jobId, frmdt,todt);

ChartGenerator obj = new ChartGenerator(compid, jobId, frmdt, todt, storprocname);

String[] boards = req.getParameterValues("boards");

ReportingLabelsAndValues labelvals = obj.generateTrendlinevalues(boards);

XYChart cxy = obj.generateXYChart(labelvals, boards);

PieChart cpie = obj.generatePieChart(boards);

XYChart cbarchart = obj.generateBarChart(labelvals, boards);

[1828 byte] By [ssv45324a] at [2007-10-2 19:40:21]
# 1
what does the Generator interface look like?
georgemca at 2007-7-13 22:18:19 > top of Java-index,Other Topics,Patterns & OO Design...
# 2
This is the generate interface.public abstract void generate()
ssv45324a at 2007-7-13 22:18:19 > top of Java-index,Other Topics,Patterns & OO Design...
# 3
I know this is a screwed up design. I would welcome any suggestions.
ssv45324a at 2007-7-13 22:18:19 > top of Java-index,Other Topics,Patterns & OO Design...
# 4

> The following is the design for a reporting module.

> Any suggestions on the same would be appreciated.

To create reports?

There are certainly commercial libraries that do this and I believe there is at least one open source one as well, so the first suggestion would be to use one of those instead of creating one.

jschella at 2007-7-13 22:18:19 > top of Java-index,Other Topics,Patterns & OO Design...