>> Since the old "umbrella" task was closed So generally I mark tasks as resolved. So you should be able to re-open the task if its not done.
>> A more practical usage for this factory So im just going to change getInstance() to getClient()... sound good? So I was going to name the factory DeviceMapClientFactory, but it seemed kind of long winded, so I trimmed it to DeviceMapFactory. Regardless, im open to changes on this, better to get it right the first time :) ________________________________ From: Werner Keil <[email protected]> To: "[email protected]" <[email protected]>; Reza <[email protected]> Sent: Monday, July 28, 2014 7:03 PM Subject: Re: DeviceMap Java examples 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. >
