What is the difference between all-static-methods and applying a singleton pattern?
- by shahensha
I am making a database to store information about the users of my website (I am using stuts2 and hence Java EE technology). For the database I'll be making a DBManager. Should I apply singleton pattern here or rather make all it's methods static?
I will be using this DBManager for basic things like adding, deleting and updating User profiles. Along with it, I'll use for all other querying purposes, for instance to find out whether a username already exists and to get all users for administrative purposes and stuff like that.
My questions
What is the benefit of singleton pattern?
Which thing is most apt here? All static methods or a singleton pattern?
Please compare both of them.
regards
shahensha
P.S. The database is bigger than this. Here I am talking only about the tables which I'll be using for storing User Information.