In the Input class, we have a number of methods such as the following (with
their Javadoc):

- fromChannel(ReadableByteChannel c): Build a Source from a channel.
- fromFile(File f): Build a Source from a file.
- fromJaxb(Object jaxbObject): Build a Source from a Jaxb-Object.
- fromURI(URI uri): Build a Source from an URI.

These are all intuitive enough. Their names match the name of the class
that they take as input. And then we have these two:

- fromMemory(byte[] b): Build a Source from an array of bytes.
- fromMemory(String s): Build a Source from a string.

Unlike all of the other methods, the names of these two do not match the
names of the classes that they take as inputs. This is rather unintuitive
and I've seen it cause problems "in the field". My coworker was frustrated
that there was no Input.fromString() method and wound up doing a workaround
by writing the string to the file system and then doing Input.fromFile().
It never occurred to him to look at fromMemory()

I would like to suggest that we rename these methods to
fromByteArray(byte[] b) and fromString(String s) respectively. This will
make the names more intuitive by matching the name of the input class and
being consistent with the other methods in this class.

I realize that this may have implications elsewhere, so if others agree,
I'll go ahead and make the changes and create a pull request for it. I'm
guessing that I would need to deprecate the old methods while I'm at it?

Thanks,
-Will Herrmann
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Xmlunit-general mailing list
Xmlunit-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xmlunit-general

Reply via email to