In the documentation about DAO says:
When the underlying storage is not subject to change from one implementation to another, this strategy can be implemented using the Factory Method pattern to produce a number of DAOs needed by the application. The class diagram for this case is shown in Figure 9.3.
The figure 9.3 itself:
What causes misunderstanding is how we can ever apply factory method to produce the number of DAO
s? As far as I understood in the case the DAO might be look like
public interface DAOFactory{
public DAO1 getDAO1();
public DAO2 getDAO2();
}
But it would be not a factory method. It would be an abstract factory, because we're producing a family of objects rather than a single object. Couldn't you exlain what they meant when said
this strategy can be implemented using the Factory Method pattern to produce a number of DAOs needed by the application. The class diagram for this case is shown in Figure 9.3.