检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
作 者:夏龄[1]
机构地区:[1]四川民族学院网络信息中心,四川康定626001
出 处:《计算机应用与软件》2012年第11期165-167,238,共4页Computer Applications and Software
基 金:四川省教育厅科研基金项目(10ZC025)
摘 要:主要利用Java泛型编程将泛型机制与设计模式有机地结合并加以优化和实现,提出一种基于Java泛型类型(generictype)的类型转换方案,在工厂设计模式或其他应用中可有效摆脱类型强制转换或向下类型转换的过程中极容易发生错误的情况。并针对Spring中强制类型转换工厂进行改进,在利用工厂获得某个类的实例时不需要硬编码的方式强制转换实例的类型。该改进提高了软件体系结构的可扩展性,为程序设计者提供了方便。最后,通过实际编程验证了该方案的有效性以及在类型转换中的优越性。In this paper we mainly use Java generic programming to integrate the generic mechanism with design patterns in organic way and realise as well as optimise it.We propose a new class cast scheme which is based on Java generic types,to use the scheme in factory design pattern or other types of applications can effectively get rid of the error situations which are prone to incur in the process of either mandatory class cast or downward class cast.Moreover,we make the improvement in light of the mandatory class cast factory in Spring,when getting a certain instance of class with factory,it does not need the class of mandatory cast instance through hard code manner.The scheme improves the scalability of the software architecture,and provides convenience to programmers.Finally,the actual programming experiment results demonstrate its effectiveness and superiority of the scheme in class cast.
分 类 号:TP311[自动化与计算机技术—计算机软件与理论]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:216.73.216.70