摘要
在基于J2EE项目的开发过程中,数据持久层的设计是一项重要的工作,它为业务逻辑层提供了操作数据的接口,持久层性能的优劣直接影响到业务逻辑层和表示层的效果。在分析目前主流持久层解决方案的基础上,提出了一种对JDBC的轻量级封装并应用DAO模式实现对数据库的透明访问、降低耦合性的方法,该方法运用Java语言的反射和代理机制,遵循软件工程中成熟的分层结构设计规范,同时兼顾框架设计中可靠、安全和可扩展的要求。给出该框架的设计和实现过程,通过实例论证了采用这种框架的技术优势。
The data persistence layer' s design plays an important role in the J2EE development environment. It provides business logic layer with the operation data interface,the performance of date persistence layer influences the performance of business logic layer and presentation layer directly. Based on the research of several current mainstream .solutions of data persistence, presents the methcd of lightweight encapsulation JDBC and applies the DAO pattern to achieve transpea'ent access to database, redues coupling degree. The method uses the method of reflection and proxy mechanism of the Java language, follows the mature software engineering hierarchical structure design specifications, takes into account the reliable, safe and scalability requirements during framework design. Then gives the design and implementation process of the framework. Finally, according to a real example, it shows the advantages of applying this framework.
出处
《计算机技术与发展》
2008年第6期94-96,100,共4页
Computer Technology and Development