摘要
许多系统都用到了多个不同类型的数据源,或在不同类型数据源之间进行切换。如果利用原有.NET三层架构,当增加或改变一种不同类型的数据源时,需要修改大量的代码。为此,基于.NET框架,采用简单工厂模式和反射机制对原有的三层架构进行了改进,使系统在不改变界面层和业务逻辑层的情况下,实现了数据源的扩展。运用改进的方法以教学资源库系统为例,以C#语言进行了实现。
Numerous systems use various types of data sources, or they switch between different types of data sources. If using the original .NET three-layer architecture, when adding or changing a different type of data source, considerable codes needs modifying. Therefore, based on .NET framework, simple factory pattern and reflection on the three-layer architecture is applied to improve the original system. The system is adjusted to adapt to the new different data source without changing the interface layer and business logic layer. In this paper, take teaching resource library system using improved method as an example, the C# language is realized.
出处
《计算机时代》
2013年第5期43-44,47,共3页
Computer Era
基金
山东外贸职业学院科研基金项目(ky2012-03)
关键词
NET
简单工厂模式
反射
多数据源
.NET
simple factory pattern
refrection
multi-data source