首页 | 本学科首页   官方微博 | 高级检索  
     

设计模式在JNDI访问过程中的应用
引用本文:石磊,柳伟. 设计模式在JNDI访问过程中的应用[J]. 中国教育网络, 2007, 0(2): 70-73
作者姓名:石磊  柳伟
作者单位:1. 解放军理工大学指挥自动化学院,江苏,南京,210007
2. 解放军国防科技大学计算机学院,湖南,长沙,410073
摘    要:JNDI是一组在Java应用中访问命名和目录服务的API,它具有统一的接口,可以大大提高开发目录服务客户端应用程序的效率。但是对于开发者而言,使用JNDI编写的代码依然涉及许多细节,缺少抽象性和可扩展性。该文以LDAP目录服务为例,依照面向对象的设计原则,利用两个设计模式对目录服务器的访问过程进行优化。桥接模式避免了客户端直接设置目录服务器具体连接方式的参数,并且可以很好地适应新连接方式的扩展;命令模式把行为以命令对象的形式进行封装,将客户类与具体的请求类进行解耦合,使得客户端可以在不知道操作细节的情况下,发送不同的请求,进一步简化了目录服务器的访问过程。

关 键 词:命名与目录服务  设计模式  桥接模式  命令模式

The Application of Design Pattern in Accessing Process of JNDI
SHI Lei,LIU Wei. The Application of Design Pattern in Accessing Process of JNDI[J]. China Education Network, 2007, 0(2): 70-73
Authors:SHI Lei  LIU Wei
Affiliation:1.lnstitute of Command Automation PLA University of Science and Technology, Nanjing 210007, China; 2.School of Computer Science, Nation University of Defense Technology, Changsha 410073, China
Abstract:The Java Naming and Directory Interface (JNDI) offers application programming interface (API) to access the naming and directory service. It can improve exploitation efficiency. But developers still need to write different codes for different operations. Based on OO design principles, this paper taking LDAP directory service as an example, uses design patterns to contrive an access model of directory server that simplifies the access process. Bridge pattern avoids client to set the accessing parameters directly and adapts well to the new connecting methods; Command pattern encapsulates methods into command objects, then decouples the client class from the Request class.
Keywords:Naming and Directory server  Design pattern  Bridge pattern  Command pattern  
本文献已被 CNKI 维普 万方数据 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号