Currently existing data access object (DAO) patterns have several limitations. First, the interface of the patterns and business objects is tightly-coupled, which affects seriously the dynamic extensibility of softw...Currently existing data access object (DAO) patterns have several limitations. First, the interface of the patterns and business objects is tightly-coupled, which affects seriously the dynamic extensibility of software systems. Second, the patterns have duplicated implementation codes, which add to difficulties of system maintenance. To solve these problems, a new DAO pattern with stronger independency and dynamic extensibility is proposed in this paper. An example is given to illustrate the using process of the new DAO pattern. The greatest advantages of the new DAO pattern are as follows. If any business object is needed to add to the system, we do not have to modify any codes of the class DAO Factory. All we need to do is to modify the mapping file. Furthermore, because we have only one DAO implementation class to accomplish all the data access to business objects, if some SQL statements are needed to be modified, all we need to do is to modify the DAO implementation class but not need to modify any business objects.展开更多
文摘Currently existing data access object (DAO) patterns have several limitations. First, the interface of the patterns and business objects is tightly-coupled, which affects seriously the dynamic extensibility of software systems. Second, the patterns have duplicated implementation codes, which add to difficulties of system maintenance. To solve these problems, a new DAO pattern with stronger independency and dynamic extensibility is proposed in this paper. An example is given to illustrate the using process of the new DAO pattern. The greatest advantages of the new DAO pattern are as follows. If any business object is needed to add to the system, we do not have to modify any codes of the class DAO Factory. All we need to do is to modify the mapping file. Furthermore, because we have only one DAO implementation class to accomplish all the data access to business objects, if some SQL statements are needed to be modified, all we need to do is to modify the DAO implementation class but not need to modify any business objects.