design patterns - Passing config data to concrete implementation of a DAO in Java -
I'm trying to implement a Data Access Object pattern with abstract factory to multiple data sources from the client code Access I refer to the link below.
My question is - I can make your client code configuration data (such as how the solid performance of data or file path) pass my DAO?
The link I pasted above, for example 9.2, is an example of a concrete implementation, where they are using hard-coded DBRLL and drivers. What would happen if both of these have to be passed from the client code shown in 9, 6?
Plus Add a Knekshnparaj object parameter DAOFactory.getDAOFactory function (for example, where the connection URL, User, the store, etc.) and then can pass the constructor of your Deforintik Filusn use Knekshnparm to make your DAOFactory connection then.
The connection method should not be set in this connection.
Connectionpam object can be like this: `
public class connection form {private string URL; Private string pass; Private string file; / * Getters and setters * /}
`
If you DAOFactory required to file arguments to apply, they can use the File field other You can use the URL and pass.
The second solution is a common property file or system. The required parameters are obtained from the properties.
Comments
Post a Comment