• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

data singelton class

 
Reshma Das
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it nessary to make data class as singleton class?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nah, you don't need to. In the server, the only instance is what is passed to all the client Remote objects. And in local mode, there is only one user and only one instance of Data
Mark
 
Kalichar Rangantittu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont think thats a good idea as then you can only have one instance of Data that accesses a file. Further in the future if they incorporate more databases, your JVM will allow only one instance of that object, which would be a total no-no!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic