I added a bit more logic to the console example, so you may also pass a "ua" similar to the forms in the web-based examples. Please see the newly assigned ticket, as DeviceMapFactory mixes up the singleton pattern which in all known cases returnns an instance of ITSELF via getInstance(), of(), etc. not a different object. So a minimal fix would be calling the static methods getClient() instead of getInstance().
A more practical usage for this factory would of course be to have actual (non-static) methods, like getClient(), then one might inject it via Spring, CDI, etc. which won't work with the static approach. The console example is relatively self-descriptive, it can be just called via Maven, using the default unless you passed an argument to the Maven call (that's probably a further room for improvement) Since the old "umbrella" task was closed, there's an Examples epic to hold various bugs or tasks for these examples together. Cheers, Werner On Tue, Jul 29, 2014 at 12:29 AM, Reza <[email protected]> wrote: > So I finished the servlet and Spring example. They actually turned out > different in the fact that the servlet example is as minimal as possible > and the Spring example is normal. > > So the servlet example is 40kb packaged, only has the java client > dependency, loads the data over URL, and uses the DeviceMapFactory to > initialize the client (singleton): > > http://svn.apache.org/viewvc/incubator/devicemap/trunk/examples/servlet/ > > > Spring example has several dependencies, puts the client into a bean, > logging, mvc pattern, etc: > > http://svn.apache.org/viewvc/incubator/devicemap/trunk/examples/spring/ > > > They are deployed on the vm: > > http://devicemap-vm.apache.org/dmap-servlet/ > > http://devicemap-vm.apache.org/dmap-spring/ > > > So my next steps are going to be to start writing some documentation and > javadoc. >
