BLL& DAL:他们有什么不同? [英] BLL & DAL: How are they different?

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

问题描述

首先,以防万一,BLL =业务逻辑层和DAL =数据访问

层。


我想这真是一个关于架构的问题。我相信

这里有很多建筑师。


软件架构对我来说很新。我搜索了一下,然后确实

找到了这个:

http://www.velocityreviews.com/forum...l-and-dal.html


它帮助我了解了它们之间的差异以及分离它们的优势。现在我确实有一个简单的

问题:


我怎么知道BLL需要什么,以及需要去哪些

DAL?


我的猜测是:任何需要执行类似

connection.Open()并使用Sql命令的方法(包括存储过程)

应该进入DAL,对吗?或者这是一个过于天真的原则吗?


感谢您分享您对这个问题的见解。

First, just in case, BLL = Business Logic Layer and DAL = Data Access
Layer.

I guess this is really a question about architecture. I believe there
are many architect here.

Software architecture is sorta new to me. I searched a little and did
find this:

http://www.velocityreviews.com/forum...l-and-dal.html

It helped me understand a little bit about their differences and the
advantages of separating them. And now I do have one simple
question:

How do I know what needs to go to the BLL and what needs to go to the
DAL?

My guess is this: Any method that needs to do something like
connection.Open() and use a Sql command (including stored procedure)
should go into the DAL, right? Or is this a principle too naive in
software architecture?

Thanks for sharing your insights into this question.

推荐答案

" gnewsgroup" < gn ******** @ gmail.com写信息

新闻:b3 ********************** ************ @ e23g2000 prf.googlegroups.com ...
"gnewsgroup" <gn********@gmail.comwrote in message
news:b3**********************************@e23g2000 prf.googlegroups.com...

首先,以防万一,BLL =业务逻辑层和DAL =数据访问

图层。


我想这真的是一个关于架构的问题。我相信

这里有很多建筑师。


软件架构对我来说很新。我搜索了一下,然后确实

找到了这个:

http://www.velocityreviews.com/forum...l-and-dal.html


它帮助我了解了它们之间的差异以及分离它们的优势。现在我确实有一个简单的

问题:


我怎么知道BLL需要什么,以及需要去哪些

DAL?


我的猜测是:任何需要执行类似

connection.Open()并使用Sql命令的方法(包括存储过程)

应该进入DAL,对吗?或者这是一个在/ b $ b软件架构中过于天真的原则吗?
First, just in case, BLL = Business Logic Layer and DAL = Data Access
Layer.

I guess this is really a question about architecture. I believe there
are many architect here.

Software architecture is sorta new to me. I searched a little and did
find this:

http://www.velocityreviews.com/forum...l-and-dal.html

It helped me understand a little bit about their differences and the
advantages of separating them. And now I do have one simple
question:

How do I know what needs to go to the BLL and what needs to go to the
DAL?

My guess is this: Any method that needs to do something like
connection.Open() and use a Sql command (including stored procedure)
should go into the DAL, right? Or is this a principle too naive in
software architecture?



不是真的,虽然存储过程不会在DAL中,因为它们是

RDBMS对象......


这是一个简单的(虽然可能过于简单化)的思考方式。


项目A,项目B和项目C都是完全的不同,但他们都使用SQL Server作为他们的RDBMS。因此,它们都会有不同的BLL

但可以共享相同的DAL。


另一方面,项目D支持多个RDBMS。因此,它可能

与项目A,B和B具有相同的DAL。 C,加上额外的DAL,它们支持Oracle,MySQL,Postgre等。或者,它可能只有一个DAL

,它通过工厂模式支持多个后端RDBMS。 />

基本上,BLL和DAL应完全独立于

,您可以更改其中一个而无需更改

其他......

-

Mark Rae

ASP.NET MVP
http://www.markrae.net

Not really, though stored procedures won''t be in the DAL because they are
RDBMS objects...

Here''s an easy (though perhaps over-simplistic) way to think of it.

Project A, Project B and Project C are all totally different, but they all
use SQL Server as their RDBMS. Therefore, they will all have different BLL
but can share the same DAL.

Project D, on the other hand, supports multiple RDBMS. Therefore, it might
have the same DAL as the Projects A, B & C, plus additional DALs which
support Oracle, MySQL, Postgre etc. Alternatively, it may have a single DAL
which supports multiple backend RDBMS through a factory pattern.

Essentially, the BLL and DAL should be completely independent to the extent
that you are able to change one of them without needing to change the
other...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net


1月28日上午9:39,Mark Rae [MVP]" < m ... @ markNOSPAMrae.netwrote:
On Jan 28, 9:39 am, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:

" gnewsgroup" < gnewsgr ... @ gmail.com写信息


新闻:b3 *********************** *********** @ e23g2000 prf.googlegroups.com ...
"gnewsgroup" <gnewsgr...@gmail.comwrote in message

news:b3**********************************@e23g2000 prf.googlegroups.com...

首先,以防万一,BLL =业务逻辑层和DAL =数据访问

图层。
First, just in case, BLL = Business Logic Layer and DAL = Data Access
Layer.


我想这真的是一个关于架构的问题。我相信

在这里有很多建筑师。
I guess this is really a question about architecture. I believe there
are many architect here.


软件架构对我来说很新。我搜索了一下并做了

找到这个:
Software architecture is sorta new to me. I searched a little and did
find this:

http://www.velocityreviews.com/forum...l-and-dal.html


它帮助我了解了它们之间的差异以及分离它们的优点。现在我确实有一个简单的问题:
It helped me understand a little bit about their differences and the
advantages of separating them. And now I do have one simple
question:


我怎么知道BLL需要什么以及什么需要去

DAL?
How do I know what needs to go to the BLL and what needs to go to the
DAL?


我的猜测是:任何需要做某些事情的方法,比如

connection.Open()并使用Sql命令(包括存储过程)

应该进入DAL,对吗?或者这是一个在/ b $ b软件架构中过于天真的原则吗?
My guess is this: Any method that needs to do something like
connection.Open() and use a Sql command (including stored procedure)
should go into the DAL, right? Or is this a principle too naive in
software architecture?



不是真的,虽然存储过程不会在DAL中,因为它们是b
$ b RDBMS对象......


这是一个简单的(虽然可能过于简单化)的思考方式。


项目A,项目B和项目C都是完全的不同,但他们都使用SQL Server作为他们的RDBMS。因此,它们都会有不同的BLL

但可以共享相同的DAL。


另一方面,项目D支持多个RDBMS。因此,它可能

与项目A,B和B具有相同的DAL。 C,加上额外的DAL,它们支持Oracle,MySQL,Postgre等。或者,它可能只有一个DAL

,它通过工厂模式支持多个后端RDBMS。 />

基本上,BLL和DAL应完全独立于

,您可以更改其中一个而无需更改

其他......


-

Mark Rae

ASP.NET MVPhttp://www.markrae。 net


Not really, though stored procedures won''t be in the DAL because they are
RDBMS objects...

Here''s an easy (though perhaps over-simplistic) way to think of it.

Project A, Project B and Project C are all totally different, but they all
use SQL Server as their RDBMS. Therefore, they will all have different BLL
but can share the same DAL.

Project D, on the other hand, supports multiple RDBMS. Therefore, it might
have the same DAL as the Projects A, B & C, plus additional DALs which
support Oracle, MySQL, Postgre etc. Alternatively, it may have a single DAL
which supports multiple backend RDBMS through a factory pattern.

Essentially, the BLL and DAL should be completely independent to the extent
that you are able to change one of them without needing to change the
other...

--
Mark Rae
ASP.NET MVPhttp://www.markrae.net



1月28日上午9:39,Mark Rae [MVP]" < m ... @ markNOSPAMrae.netwrote:

On Jan 28, 9:39 am, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:


" gnewsgroup" < gnewsgr ... @ gmail.com写信息


新闻:b3 *********************** *********** @ e23g2000 prf.googlegroups.com ...
"gnewsgroup" <gnewsgr...@gmail.comwrote in message

news:b3**********************************@e23g2000 prf.googlegroups.com...

首先,以防万一,BLL =业务逻辑层和DAL =数据访问

图层。
First, just in case, BLL = Business Logic Layer and DAL = Data Access
Layer.


我想这真的是一个关于架构的问题。我相信

在这里有很多建筑师。
I guess this is really a question about architecture. I believe there
are many architect here.


软件架构对我来说很新。我搜索了一下并做了

找到这个:
Software architecture is sorta new to me. I searched a little and did
find this:

http://www.velocityreviews.com/forum...l-and-dal.html


它帮助我了解了它们之间的差异以及分离它们的优点。现在我确实有一个简单的问题:
It helped me understand a little bit about their differences and the
advantages of separating them. And now I do have one simple
question:


我怎么知道BLL需要什么以及什么需要去

DAL?
How do I know what needs to go to the BLL and what needs to go to the
DAL?


我的猜测是:任何需要做某些事情的方法,比如

connection.Open()并使用Sql命令(包括存储过程)

应该进入DAL,对吗?或者这是一个在/ b $ b软件架构中过于天真的原则吗?
My guess is this: Any method that needs to do something like
connection.Open() and use a Sql command (including stored procedure)
should go into the DAL, right? Or is this a principle too naive in
software architecture?



不是真的,虽然存储过程不会在DAL中,因为它们是b
$ b RDBMS对象......


这是一个简单的(虽然可能过于简单化)的思考方式。


项目A,项目B和项目C都是完全的不同,但他们都使用SQL Server作为他们的RDBMS。因此,它们都会有不同的BLL

但可以共享相同的DAL。


另一方面,项目D支持多个RDBMS。因此,它可能

与项目A,B和B具有相同的DAL。 C,加上额外的DAL,它们支持Oracle,MySQL,Postgre等。或者,它可能只有一个DAL

,它通过工厂模式支持多个后端RDBMS。 />

基本上,BLL和DAL应完全独立于

,您可以更改其中一个而无需更改

其他......


-

Mark Rae

ASP.NET MVPhttp://www.markrae。 net


Not really, though stored procedures won''t be in the DAL because they are
RDBMS objects...

Here''s an easy (though perhaps over-simplistic) way to think of it.

Project A, Project B and Project C are all totally different, but they all
use SQL Server as their RDBMS. Therefore, they will all have different BLL
but can share the same DAL.

Project D, on the other hand, supports multiple RDBMS. Therefore, it might
have the same DAL as the Projects A, B & C, plus additional DALs which
support Oracle, MySQL, Postgre etc. Alternatively, it may have a single DAL
which supports multiple backend RDBMS through a factory pattern.

Essentially, the BLL and DAL should be completely independent to the extent
that you are able to change one of them without needing to change the
other...

--
Mark Rae
ASP.NET MVPhttp://www.markrae.net



谢谢。我知道

将它们分开有很多优点。但是我仍然不确定进入BLL的是什么,以及进入DAL的
。听起来像两个层都可以*正确地*

访问数据库?任何提示?谢谢。

Thank you. I understand that there are a lot of advantages of
separating them. But I am still not sure what goes into the BLL, and
what goes into the DAL. Sounds like both layers can *rightfully*
access the database? Any hint? Thanks.


请参阅:


http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!139 .entry

我有一个2.0版本的博客条目/代码。

http://sholliday.spaces.live.com/Blog/

我的经验法则是DAL返回:

1.数据集

2. IDataReaders

3.标量

4.空洞/无数


你可以在博客上阅读原因。

PS

阅读鸟的眼睛查看MS文章我也提供了一个URL。


" gnewsgroup" < gn ******** @ gmail.com写信息

新闻:b3 ********************** ************ @ e23g2000 prf.googlegroups.com ...
See:

http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!139.entry
I have a 2.0 version of the blog entry/code as well.

http://sholliday.spaces.live.com/Blog/
My rule of thumb is that the DAL returns:
1. DataSets
2. IDataReaders
3. Scalars
4. Voids/Nothings

You can read the why at the blog.

PS
Read the "bird''s eye" view MS article I provide a URL to as well.


"gnewsgroup" <gn********@gmail.comwrote in message
news:b3**********************************@e23g2000 prf.googlegroups.com...

首先,以防万一,BLL =业务逻辑层和DAL =数据访问

图层。


我想这真的是一个关于架构的问题。我相信

这里有很多建筑师。


软件架构对我来说很新。我搜索了一下,然后确实

找到了这个:

http://www.velocityreviews.com/forum...l-and-dal.html


它帮助我了解了它们之间的差异以及分离它们的优势。现在我确实有一个简单的

问题:


我怎么知道BLL需要什么,以及需要去哪些

DAL?


我的猜测是:任何需要执行类似

connection.Open()并使用Sql命令的方法(包括存储过程)

应该进入DAL,对吗?或者这是一个过于天真的原则?

软件架构?


感谢您分享您对此问题的见解。
First, just in case, BLL = Business Logic Layer and DAL = Data Access
Layer.

I guess this is really a question about architecture. I believe there
are many architect here.

Software architecture is sorta new to me. I searched a little and did
find this:

http://www.velocityreviews.com/forum...l-and-dal.html

It helped me understand a little bit about their differences and the
advantages of separating them. And now I do have one simple
question:

How do I know what needs to go to the BLL and what needs to go to the
DAL?

My guess is this: Any method that needs to do something like
connection.Open() and use a Sql command (including stored procedure)
should go into the DAL, right? Or is this a principle too naive in
software architecture?

Thanks for sharing your insights into this question.



这篇关于BLL&amp; DAL:他们有什么不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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