I'm developing an app that needs to establish a connection with a DB. To operate through this connection I'm using DAO pattern. My question is related with the organization of the code and the name of interfaces and implementations. The current package structure is the next one:
- mainpackage
- mainpackage.model -> Models of each table to create objects with data fetched from DB
- mainpackage.persistence -> ConnectionManager
- mainpackage.persistence.dao -> Interfaces and implementations
About the naming of interfaces I thought that would be a good idea to use something like ClassDAO and DefaultClassDAO for the implementation as long I don't know how to name it. What do you think? Is there any convention for this?
I would use the convention described in "Domain driven design".
You could even put the DB classes in a different sub-project. I think it's important to not put the DB at the center of your design and just considered it as an implementation detail.