Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to design an easily-extensible API with the simplicity of Enums?
    primarykey
    data
    text
    <p>Sorry for the vague title; couldn't think of how to word it more clearly. Here are the highlights of the questions:</p> <p><strong>Highlights</strong></p> <ul> <li>Asking an API design question about the <a href="http://www.thebuzzmedia.com/software/exiftool-enhanced-java-integration-for-exiftool/" rel="nofollow noreferrer">ExifTool for Java</a> library.</li> <li>Here is <a href="https://stackoverflow.com/questions/3021420/java-api-to-exiftool/7139392#7139392">an example</a> of what the current API looks like.</li> <li>As a <em>USER</em>, the API is super-simple to use because you just pass in Enums for the image metadata you want back.</li> <li>As a <em>DEV</em>, the API somewhat sucks because you cannot easily extend the base class with more Enum types to support additional metadata that may not be supported directly in the lib.</li> <li>Simply pre-defining and supporting "<em>all the metadata</em>" is <a href="http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/" rel="nofollow noreferrer">non-trivial</a>.</li> </ul> <p><strong>Question</strong></p> <p>Given that setup information, what I am after is trying to find a way to pre-define the 30 or 40 most common metadata flags that people typically want from their images; right now everything is <a href="http://www.thebuzzmedia.com/downloads/software/exiftool/javadoc/com/thebuzzmedia/exiftool/ExifTool.Tag.html" rel="nofollow noreferrer">defined as an Enum</a>, but the class is not extensible this way.</p> <p>If I go the "Class-per-Metadata-flag" route, the extensibility will be simple, but the API will be a lot less friendly to use out of the box.</p> <p>I will consider making v2.0 of this library Java 8+ if closures offer a really beautiful and simple solution, but otherwise I'd obviously prefer to keep it compatible with more systems (Java 6/7) than less.</p> <p><strong>Summary</strong></p> <p>My goals for the library are "simple to use and extend" - I feel I have nailed the "simple to use" aspect with the 1.x release, but the library is not easily extensible and I'd like to correct that in the 2.x series.</p> <p>I have been sitting on the 2.x release for over a year waiting for inspiration to strike and it has eluded me; I am hoping someone can spot my mistake and I can move the lib forward in a really elegant way.</p> <p>Thank you for the time guys!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload