[ 
https://issues.apache.org/jira/browse/DMAP-52?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14074846#comment-14074846
 ] 

Reza Naghibi commented on DMAP-52:
----------------------------------

Yes, good point. We should provide a singleton factory which would remove the 
need for an init.

The only problem here is that we run into the issue of the index being created 
on the first access, and that could take multiple seconds. I think there are 
some ways to mitigate, I will research.

> Could DeviceMapClient be created via static factory method
> ----------------------------------------------------------
>
>                 Key: DMAP-52
>                 URL: https://issues.apache.org/jira/browse/DMAP-52
>             Project: DeviceMap
>          Issue Type: Improvement
>          Components: Java API
>            Reporter: Werner Keil
>            Assignee: Reza Naghibi
>              Labels: design, pattern, singleton
>
> The console example refers to initDeviceData() that it should only be called 
> once.
>         //load the device data, do this only once!!!
>         client.initDeviceData(LoaderOption.JAR);
>         
> If there is never or rarely a need to call it again, could the 
> DeviceMapClient class not get a static factory/constructor method like
> DeviceMapClient.of(LoaderOption) or something like that?
> The of() notion is quite popular recently, but any variation like valueOf() 
> or getInstance() might work, too.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to