三层架构各层间的访问过程

来源:互联网 发布:知乎俄罗斯军校 编辑:程序博客网 时间:2024/05/13 16:52
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
.Cot380{display:none;}

1、传入值,将值进行类型转换(为整型)。

2、创建bll层的对象,通过对象访问bll层的方法调用bll层。

3、bll层方法中取得数据访问层的实例,实例化idal层的接口对象,这个对象是由工厂层创建的,然后返回idal层传入值所查找的内容的方法。

4、数据工厂通过web.config配置文件中给定的webdal字串访问sql层,返回一个完整的调用sql层的路径给bll层。

5、到此要调用sql层,sql层完成赋值model层的对象值为空,给定一个参数,调用sql层的sqlhelper的executereader方法,读出每个字段的数据赋值给以定义为空的model层的对象。

6、sqlhelper执行sql命令,返回一个指定连接的数据库记录集,在这里需要饮用参数类型,提供位打开连接命令执行做好准备。

7、返回model层把查询得到的一行记录值赋值给sql层的引入的model层的对象,然后把这个对象返回给bll。

8、回到web层的bll层的方法调用,把得到的对象值赋值给lbl标签,在前台显示给界面。

<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
原创粉丝点击