poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes Kinscher <Johannes.Kinsc...@gmx.de>
Subject XSSF/HSSF contribution/suggestion
Date Thu, 23 Jan 2014 17:40:24 GMT
Hello POI developers,

first of all I would like to thank you for the effort of making a great 
library that makes developing Office files much easier that automating 
(Microsoft) Office via COM will ever be. It's nice to have such a stable 
and grown library around.
The reason I'm writing is that I'm using POI now for more than two years 
and I'd like to make some improvements to the API regarding spreadsheets 
(XSSF/HSSF). The problem in most cases is, that the API contains 
non-intuitive ways of doing things regarding to the current default 
usage of APIs (>=Java 1.5). In short the problems contain: inconsistent 
usage of Enums, irritating constants and mostly a lot of lines that are 
needed to achieve something small. I suggest some changes that aim to 
make the usage of XSSF/HSSF much easier and avoid a lot of search in the 
help which is necessary because of unintutional API style. The major 
changes would be e.g.

- convert short parameters to int to remove bulky short casts
- create enums for constants (e.g. BorderStyle) and change parameter 
types for methods to use it
- convert fields to real enums (e.g. Row.CREATE_NULL_AS_BLANK which 
should be Cell.CREATE_NULL_AS_BLANK anyhow)
- advance interfaces (e.g. Color with no methods) to simplify HSSF/XSSF 
usage
- create ease methods, e.g. cellStyle.setBorderTop(BorderStyle, Color), 
cellStyle.setBorders(BorderStyle, Color), 
cellStyle.setBorder(BorderSide, BorderStyle), 
cellStyle.setBorder(BorderSide, BorderStyle, Color)
- unify naming, e.g. cellStyle.setLeftBorderColor vs. 
cellStyle.setBorderLeft
- create ease "constructors", e.g. workbook.createFont(Font cloneFont)
- create range operations, e.g. cellRangeAddress.forEach(CellMethod)

All these changes would leave the default behaviour as-is and would not 
break any existing code. Nevertheless, some things should be marked as 
deprecated afterwards to indicate the new unified "valid" behavior.

I'd like to ask about your opinion of these changes and the future plans 
of the XSSF/HSSF support (if they already include and/or conflict with 
some of these changes).

Regards,
Johannes

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message