[
https://issues.apache.org/jira/browse/AVRO-1137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13431391#comment-13431391
]
Ajo Fod commented on AVRO-1137:
-------------------------------
I went through some of the tests. I find those examples hard to use in simple
examples. I feel they are geared towards testing out the codebase.
For samples, I'd recommend a new package that have a classes with a main method
and help on how to invoke them with different CLI options (e.g: switch between
Reflect/Specific/Generic API where appropriate).
https://github.com/wpm/AvroExample/blob/master/src/main/java/wpmcn/AvroExample.java
The above is a simple example of code that switches between Generic and
Specific API. It would be useful if examples such as these lived in package
called samples (... or something). They would then be updated with changes to
the codebase.
When I write code for my projects I keep examples such as those around in a
separate package to help me get my bearings. I find the ability to play with
examples very useful when one has to deal with multiple packages.
I spent some time with tests and you are right they were a bit too complicated
and also hard to play with i.e. manipulate slightly to see the effects of a
small change.
P.S.
One example to add to the Reflect API would be the inheritance/interfaces to
imply unions (my interpretation of what is happening in one of the tests).
> Could we have a folder with examples/samples in the source code
> ---------------------------------------------------------------
>
> Key: AVRO-1137
> URL: https://issues.apache.org/jira/browse/AVRO-1137
> Project: Avro
> Issue Type: Improvement
> Environment: all
> Reporter: Ajo Fod
>
> I don't know if there are a collection of examples of usages of Avro anywhere
> (something like jfreechart has). I've recently posted on stack overflow an
> example of a problem I ran into:
> http://stackoverflow.com/questions/11866466/using-apache-avro-reflect
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira