So , I am working on an app which requires a local db connection and uses some web services to send and receive data back-forth as well.
Whenever I need and database operation then I create an object of my
DbConnection
class (this is the name of class I am using to get my database) and perform operations on the same.Similarly for connecting with internet I use
DefaultHttpClient
and create astatic
object of the same, and whenever need to get connection and call a webservice I createHttpResponse
object and get response data.
1) Am I using the right approach or pattern ?
2) Also one more thing focusing on point number 2 does static and singleton work the same way ?