问题描述
我的问题可能很愚蠢,但我正在尝试使用我的Generic类。
我有数据访问层,业务逻辑层和表示层(Windows窗体)。每次我必须检索记录列表时,我必须在Bussiness Logic类中调用一个方法(GetList()),该类在数据访问类中调用SQL查询。每次用户登录时,我都会创建一个新的业务逻辑类实例。因此,每种客户端计算机都有自己的Business Logic类实例。
我在这里尝试实现的是在服务器上一直运行一个Business Logic Class实例,每60秒更新一次最新记录。因此,每当我的表示层从业务类请求数据时,Bussiness Logic类只会将最新记录返回到表示层而不调用数据访问层。有什么方法可以做到吗?
提前谢谢。
Hi,
My question could be silly but this is what I am trying to do here with my Generic class.
I have a Data Access Layer, Business Logic Layer and a presentation Layer(Windows forms). Everytime I have to retrieve a List of records, I have to call a method (GetList()) in Bussiness Logic class which calls SQL query in Data access class. I create a new instance of business Logic class everytime a user LogIn. So in this way each of the client computers have their own instance of Business Logic class.
What Im trying to achieve here is to have a single instance of Business Logic Class running on the server all the time which gets updated with latest records in every 60 seconds. So whenever my presentation layer request data from business class, Bussiness Logic class just return the latest records to presentation layer without calling Data Access layer. Is there any way that I can do it?
Thanks in advance.
推荐答案
这篇关于如何使用通用类作为服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!