BLL和DAL。 [英] BLL and DAL.

查看:95
本文介绍了BLL和DAL。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我一直试图将我的sqldatasource'转换为

objectdatasource'以利用自定义分页功能

of objectdatasource'的。这些尝试让我陷入了陌生的领域,我开始觉得自己像个新手。什么

让情况变得更糟 - 尽管我付出了最大的努力 - 我正在努力争取
到达任何地方。这里有很多理论我不明白。


1.)我理解(我认为)商业逻辑层的核心概念

和数据访问层。它们是网络前端和数据库后端之间的中间层。但他们有什么不同?对于同样的事情,他们听起来像是不同的名字。


2.)我在网上发现了BLL'和DAL'的例子s显示用VB或C#编写的一些

连接字符串。好。所以BLL'和DAL'只是用VB或C#编写的连接数据库的
函数。这个

与在页面'

代码隐藏中编写相同的代码有什么不同?创建另一个VB文件有什么意义?


3.)为什么它们存储在app_code目录中?这只是简单的

组织,还是有一些编译的东西在这里我要求b
不能得到?


4.)这可以通过问题2来回答,但是创建BLL / DAL的优势是什么?
?它必须是一个相当大的优势,因为他们在objectdatasource的世界中如此显着地突然显示
,但在我看来它只是看起来像是一些会减慢整体速度的东西网络体验

用户。


正如你所看到的,我很困惑。有人可以帮我解决一下吗?

非常感谢!

Recently I''ve been trying to convert over my sqldatasource''s to
objectdatasource''s to take advantage of the custom paging functionality
of objectdatasource''s. These attempts have plunged me knee-deep into
unfamiliar territory and I''m starting to feel like a rank newbie. What
makes it worse is that---despite my best efforts---I''m struggling to
get anywhere. There''s just a lot of theory here I don''t understand.

1.) I understand (I think) the core concepts of Business Logic Layers
and Data Access Layers. They are a middle tier between the web front
end and the database back end. But how are they different? They sound
like different names for the same thing.

2.) The examples I''ve found online of BLL''s and DAL''s show some
connection strings written in VB or C#. Ok. So BLL''s and DAL''s are just
functions written in VB or C# that connect to a database. How is this
any different from simply writing the same code in the page''s
codebehind? What''s the point of creating yet another VB file?

3.) Why are they stored in the app_code directory? Is this just simple
organization or is there some compiling thing going on here that I
don''t get?

4.) This may be answered by question 2, but what''s the advantage of
creating a BLL/DAL? It must be a pretty big advantage since they figure
so prominently in the world of the objectdatasource, but to my eyes it
just looks like something that would slow down the whole web experience
for a user.

As you can see, I''m quite confused. Can someone shed some light for me?
Thanks much!

推荐答案

嘿,儿子,
我会试一试!首先......商业世界中的大多数应用程序

由团队开发。一个负责前端的小组或人员,一个用于DAL,BLL和最后一个的b $ b,但最重要的是,一个用于数据源。你有其他像建筑师,系统设计师等等。所以复杂性是

分为几层,可以单独/分开建造。


这样,应用程序就构建在组件中。最近有比之前更多的炒作,因为某些模式,比如

工厂和其他许多模式。


Archietects发现处理能力相同,因为他们可以将应用程序分解成非常小的对象。这个

将使代码更容易阅读。现在有了C#AND vb.net,他们就会疯狂。


现在,DAL是一个完成所有数据访问的层。在该层中可以找到访问数据的所有代码和

组件。这样,这一层现在可以在其他项目中重复使用并完全分开。


BLL是在将对象传递给DAL之前处理所有逻辑的地方。

示例。假设客户最大信用额度(业务规则或公司

政策)为1000000.00,那么您在BLL中设置此项。这样BLL检查客户对象(例如customer.CreditLimit< 1000000.00)如果他是<

1000000.00母鸡那么它被传递给DAL。


您可以节省数据存储和网络流量的旅行。


希望有所帮助。


"罗伊"写道:
Hey son,
I''ll give it a shot! First off... most application(s) in the commerce world
are developed by teams. One group or person responsible for frontends, one
for the DAL,BLL and last, but not least, one for the datasource. You have
others like the archietects, system designers etc. So the complexity is
divided into layers and can be built individually/separately.

That way the application(s) are built into components. Recently there has
been the hype, more than ever before, because of certain patterns like
Factory and many others.

Archietects have found that processing power is in abaundance same for
memeory, so they can break the application up into very small objects. This
will make the code more easily readable. Now with the C# AND vb.net they are
going crazy.

Now the DAL is a layer where all data access is done. All the codes and
components to access data is found in this layer. That way this layer is now
reusable in other projects and totally separate.

BLL is where all logic is handled before the object is passed to the DAL.
Example. Let''s say customer max credit limit (business rule or company
policy) is 1000000.00 then you set this in the BLL. That way the BLL checks
the customer object ( eg customer.CreditLimit < 1000000.00) If he is <
1000000.00 hen it''s passed to DAL.

You save a trip to datastore and network traffic.

Hope that helps.

"Roy" wrote:
最近我一直试图将我的sqldatasource转换为
objectdatasource'以利用自定义分页功能
objectdatasource'的。这些尝试让我陷入了陌生的领域,我开始觉得自己像个新手。更糟糕的是,尽管我付出了最大的努力,但我正努力到达任何地方。这里有很多理论我不明白。

1.)我理解(我认为)业务逻辑层和数据访问层的核心概念。它们是Web前端和数据库后端之间的中间层。但他们有什么不同?对于同样的事情,它们听起来像不同的名字。

2.)我在网上找到的BLL'和DAL'的例子显示了一些
连接用VB或C#编写的字符串。好。所以BLL'和DAL'只是用VB或C#编写的连接到数据库的函数。这与
代码隐藏中简单编写相同的代码有何不同?创建另一个VB文件有什么意义?

3.)为什么它们存储在app_code目录中?这只是一个简单的组织,还是有一些编译的东西在这里我没有得到?

4.)这可以通过问题2回答,但是创建BLL / DAL的优势是什么?它必须是一个相当大的优势,因为它们在objectdatasource的世界中如此突出,但在我看来它只是看起来像是一个会减慢整个网络体验的东西
用户。

正如你所看到的,我很困惑。有人可以帮我解决一下吗?
非常感谢!
Recently I''ve been trying to convert over my sqldatasource''s to
objectdatasource''s to take advantage of the custom paging functionality
of objectdatasource''s. These attempts have plunged me knee-deep into
unfamiliar territory and I''m starting to feel like a rank newbie. What
makes it worse is that---despite my best efforts---I''m struggling to
get anywhere. There''s just a lot of theory here I don''t understand.

1.) I understand (I think) the core concepts of Business Logic Layers
and Data Access Layers. They are a middle tier between the web front
end and the database back end. But how are they different? They sound
like different names for the same thing.

2.) The examples I''ve found online of BLL''s and DAL''s show some
connection strings written in VB or C#. Ok. So BLL''s and DAL''s are just
functions written in VB or C# that connect to a database. How is this
any different from simply writing the same code in the page''s
codebehind? What''s the point of creating yet another VB file?

3.) Why are they stored in the app_code directory? Is this just simple
organization or is there some compiling thing going on here that I
don''t get?

4.) This may be answered by question 2, but what''s the advantage of
creating a BLL/DAL? It must be a pretty big advantage since they figure
so prominently in the world of the objectdatasource, but to my eyes it
just looks like something that would slow down the whole web experience
for a user.

As you can see, I''m quite confused. Can someone shed some light for me?
Thanks much!



我的意思是......你可以节省数据存储之旅和网络流量,如果他的限额是>

而不是1000000.00。


" Chris"写道:
I meant ...You save a trip to datastore and network traffic if his limit is >
than 1000000.00.

"Chris" wrote:
嘿儿子,
我会试一试!首先......商业世界中的大多数应用程序都是由团队开发的。负责前端的一个团队或人员,一个用于DAL,BLL和最后一个,但并非最不重要的一个用于数据源。你有其他像建筑师,系统设计师等等。所以复杂性分为层,可以单独/分开构建。

这样的应用程序是内置于组件中。最近,由于某些模式,如工厂和许多其他模式,比以往任何时候都更加大肆宣传。

Archietects发现处理能力相同,对于<记忆,所以他们可以将应用程序分解成非常小的对象。这将使代码更易于阅读。现在有了C#和vb.net,它们就会变得疯狂。

现在,DAL是一个完成所有数据访问的层。访问数据的所有代码和组件都可以在此层中找到。这样,这一层现在可以在其他项目中重复使用并完全分开。

BLL是在将对象传递给DAL之前处理所有逻辑的地方。
示例。假设客户最大信用额度(业务规则或公司
政策)为1000000.00,那么您在BLL中设置此项。这样BLL检查客户对象(例如customer.CreditLimit< 1000000.00)如果他<
1000000.00 hen它被传递给DAL。

你节省了数据存储和网络流量之旅。

希望有所帮助。

Roy写道:
Hey son,
I''ll give it a shot! First off... most application(s) in the commerce world
are developed by teams. One group or person responsible for frontends, one
for the DAL,BLL and last, but not least, one for the datasource. You have
others like the archietects, system designers etc. So the complexity is
divided into layers and can be built individually/separately.

That way the application(s) are built into components. Recently there has
been the hype, more than ever before, because of certain patterns like
Factory and many others.

Archietects have found that processing power is in abaundance same for
memeory, so they can break the application up into very small objects. This
will make the code more easily readable. Now with the C# AND vb.net they are
going crazy.

Now the DAL is a layer where all data access is done. All the codes and
components to access data is found in this layer. That way this layer is now
reusable in other projects and totally separate.

BLL is where all logic is handled before the object is passed to the DAL.
Example. Let''s say customer max credit limit (business rule or company
policy) is 1000000.00 then you set this in the BLL. That way the BLL checks
the customer object ( eg customer.CreditLimit < 1000000.00) If he is <
1000000.00 hen it''s passed to DAL.

You save a trip to datastore and network traffic.

Hope that helps.

"Roy" wrote:
最近我一直试图将我的sqldatasource转换为
objectdatasource'以利用自定义分页功能
objectdatasource'的。这些尝试让我陷入了陌生的领域,我开始觉得自己像个新手。更糟糕的是,尽管我付出了最大的努力,但我正努力到达任何地方。这里有很多理论我不明白。

1.)我理解(我认为)业务逻辑层和数据访问层的核心概念。它们是Web前端和数据库后端之间的中间层。但他们有什么不同?对于同样的事情,它们听起来像不同的名字。

2.)我在网上找到的BLL'和DAL'的例子显示了一些
连接用VB或C#编写的字符串。好。所以BLL'和DAL'只是用VB或C#编写的连接到数据库的函数。这与
代码隐藏中简单编写相同的代码有何不同?创建另一个VB文件有什么意义?

3.)为什么它们存储在app_code目录中?这只是一个简单的组织,还是有一些编译的东西在这里我没有得到?

4.)这可以通过问题2回答,但是创建BLL / DAL的优势是什么?它必须是一个相当大的优势,因为它们在objectdatasource的世界中如此突出,但在我看来它只是看起来像是一个会减慢整个网络体验的东西
用户。

正如你所看到的,我很困惑。有人可以为我解释一下吗?
非常感谢!
Recently I''ve been trying to convert over my sqldatasource''s to
objectdatasource''s to take advantage of the custom paging functionality
of objectdatasource''s. These attempts have plunged me knee-deep into
unfamiliar territory and I''m starting to feel like a rank newbie. What
makes it worse is that---despite my best efforts---I''m struggling to
get anywhere. There''s just a lot of theory here I don''t understand.

1.) I understand (I think) the core concepts of Business Logic Layers
and Data Access Layers. They are a middle tier between the web front
end and the database back end. But how are they different? They sound
like different names for the same thing.

2.) The examples I''ve found online of BLL''s and DAL''s show some
connection strings written in VB or C#. Ok. So BLL''s and DAL''s are just
functions written in VB or C# that connect to a database. How is this
any different from simply writing the same code in the page''s
codebehind? What''s the point of creating yet another VB file?

3.) Why are they stored in the app_code directory? Is this just simple
organization or is there some compiling thing going on here that I
don''t get?

4.) This may be answered by question 2, but what''s the advantage of
creating a BLL/DAL? It must be a pretty big advantage since they figure
so prominently in the world of the objectdatasource, but to my eyes it
just looks like something that would slow down the whole web experience
for a user.

As you can see, I''m quite confused. Can someone shed some light for me?
Thanks much!



感谢Chris的回复。 />

一般来说,BLL / DAL'是专为分工和

团队合作而设计的。不一定是速度和效率。是吗?


您在BLL(信用限额等等)下面的描述似乎是一个通常处理过的VB / C#解决方案通过javascript。

基本上,在发生任何回发之前验证数据。真的吗?


深入挖掘:

1.)Objectdatasource'基本上强迫你使用DAL。

2.)不仅如此,实现自定义分页需要两次前往

数据库(一个用于获取总记录数,另一个用于获得
实际获得需要记录的页面。

这两件事看起来效率都很低。这是不好的设计

在asp.net开发团队的部分还是我只是没有得到更深的

逻辑?

克里斯写道:
Thanks for the response Chris.

So generally speaking, BLL/DAL''s are designed for division of labor and
teamwork. Not necessarily speed and efficiency. True?

Your description below of a BLL (credit limit, etc...) seems like a
VB/C# solution to what has typically been handled by javascript.
Basically, validating data before any postback occurs. True?

To dig a little deeper:
1.) Objectdatasource''s essentially force you into using a DAL.
2.) Not only that, to implement custom paging requires TWO trips to the
database (one to get the count of total records and the other to
actually get the page of records needed).
Both of these things seem totally inefficient. Is this just bad design
on the asp.net dev team''s part or am I just not getting the deeper
logic?
Chris wrote:
嘿儿子,
我会试一试!首先......商业世界中的大多数应用程序都是由团队开发的。负责前端的一个团队或人员,一个用于DAL,BLL和最后一个,但并非最不重要的一个用于数据源。你有其他像建筑师,系统设计师等等。所以复杂性分为层,可以单独/分开构建。

这样的应用程序是内置于组件中。最近,由于某些模式,如工厂和许多其他模式,比以往任何时候都更加大肆宣传。

Archietects发现处理能力相同,对于<记忆,所以他们可以将应用程序分解成非常小的对象。这将使代码更易于阅读。现在有了C#和vb.net,它们就会变得疯狂。

现在,DAL是一个完成所有数据访问的层。访问数据的所有代码和组件都可以在此层中找到。这样,这一层现在可以在其他项目中重复使用并完全分开。

BLL是在将对象传递给DAL之前处理所有逻辑的地方。
示例。假设客户最大信用额度(业务规则或公司
政策)为1000000.00,那么您在BLL中设置此项。这样BLL检查客户对象(例如customer.CreditLimit< 1000000.00)如果他<
1000000.00 hen它被传递给DAL。

你节省了数据存储和网络流量之旅。

希望有所帮助。

Roy写道:
Hey son,
I''ll give it a shot! First off... most application(s) in the commerce world
are developed by teams. One group or person responsible for frontends, one
for the DAL,BLL and last, but not least, one for the datasource. You have
others like the archietects, system designers etc. So the complexity is
divided into layers and can be built individually/separately.

That way the application(s) are built into components. Recently there has
been the hype, more than ever before, because of certain patterns like
Factory and many others.

Archietects have found that processing power is in abaundance same for
memeory, so they can break the application up into very small objects. This
will make the code more easily readable. Now with the C# AND vb.net they are
going crazy.

Now the DAL is a layer where all data access is done. All the codes and
components to access data is found in this layer. That way this layer is now
reusable in other projects and totally separate.

BLL is where all logic is handled before the object is passed to the DAL.
Example. Let''s say customer max credit limit (business rule or company
policy) is 1000000.00 then you set this in the BLL. That way the BLL checks
the customer object ( eg customer.CreditLimit < 1000000.00) If he is <
1000000.00 hen it''s passed to DAL.

You save a trip to datastore and network traffic.

Hope that helps.

"Roy" wrote:
最近我一直试图将我的sqldatasource转换为
objectdatasource'以利用自定义分页功能
objectdatasource'的。这些尝试让我陷入了陌生的领域,我开始觉得自己像个新手。更糟糕的是,尽管我付出了最大的努力,但我正努力到达任何地方。这里有很多理论我不明白。

1.)我理解(我认为)业务逻辑层和数据访问层的核心概念。它们是Web前端和数据库后端之间的中间层。但他们有什么不同?对于同样的事情,它们听起来像不同的名字。

2.)我在网上找到的BLL'和DAL'的例子显示了一些
连接用VB或C#编写的字符串。好。所以BLL'和DAL'只是用VB或C#编写的连接到数据库的函数。这与
代码隐藏中简单编写相同的代码有何不同?创建另一个VB文件有什么意义?

3.)为什么它们存储在app_code目录中?这只是一个简单的组织,还是有一些编译的东西在这里我没有得到?

4.)这可以通过问题2回答,但是创建BLL / DAL的优势是什么?它必须是一个相当大的优势,因为它们在objectdatasource的世界中如此突出,但在我看来它只是看起来像是一个会减慢整个网络体验的东西
用户。

正如你所看到的,我很困惑。有人可以为我解释一下吗?
非常感谢!
Recently I''ve been trying to convert over my sqldatasource''s to
objectdatasource''s to take advantage of the custom paging functionality
of objectdatasource''s. These attempts have plunged me knee-deep into
unfamiliar territory and I''m starting to feel like a rank newbie. What
makes it worse is that---despite my best efforts---I''m struggling to
get anywhere. There''s just a lot of theory here I don''t understand.

1.) I understand (I think) the core concepts of Business Logic Layers
and Data Access Layers. They are a middle tier between the web front
end and the database back end. But how are they different? They sound
like different names for the same thing.

2.) The examples I''ve found online of BLL''s and DAL''s show some
connection strings written in VB or C#. Ok. So BLL''s and DAL''s are just
functions written in VB or C# that connect to a database. How is this
any different from simply writing the same code in the page''s
codebehind? What''s the point of creating yet another VB file?

3.) Why are they stored in the app_code directory? Is this just simple
organization or is there some compiling thing going on here that I
don''t get?

4.) This may be answered by question 2, but what''s the advantage of
creating a BLL/DAL? It must be a pretty big advantage since they figure
so prominently in the world of the objectdatasource, but to my eyes it
just looks like something that would slow down the whole web experience
for a user.

As you can see, I''m quite confused. Can someone shed some light for me?
Thanks much!






这篇关于BLL和DAL。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆