数据层架构 [英] Data Layer architecture

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

问题描述

嘿伙计们,


我刚刚介绍了数据映射器(DTO mapper)。所以现在我使用DTOMapper使用了一个SqlHelper,然后当需要将对象持久保存到数据库或加载它们时,使用DTOMapper将业务层用于


回来了。到目前为止,一切都很顺利。我的问题是,是否可以

练习使用DTOMapper rfom表示层?例如,如果

我想以HTML格式呈现我的数据库中的条目列表,

我应该从演示文稿中使用DTOmapper,还是使用条目

收集方法,内部使用DTOMapper。


第二个选项听起来更清洁,更分离。只想要

看看你们的想法...


谢谢!


Laimis

Hey guys,

I just recently got introduced to data mappers (DTO mapper). So now I
have a SqlHelper being used by DTOMapper and then business layer is
using DTOMapper when it needs to persist object to database or load them
back. Everything is working nicely so far. My question is, is it OK
practice to use DTOMapper rfom the presentation layer? For instance, if
I want to present in HTML format the list of entries in my database,
should I use DTOmapper from the presentation, or instead use Entries
collection method which internally uses DTOMapper.

THe second option sounds more cleaner and more seperated. Just want to
see what you guys think...

Thanks!

Laimis

推荐答案

集合


" laimis" < SI ***** @ iit.edu>在消息中写道

新闻:uE ************** @ TK2MSFTNGP12.phx.gbl ...
collection

"laimis" <si*****@iit.edu> wrote in message
news:uE**************@TK2MSFTNGP12.phx.gbl...
嘿伙计们,

我刚刚介绍了数据映射器(DTO mapper)。所以现在我有了DTOMapper使用的SqlHelper,然后业务层在需要将对象持久化到数据库或加载它们时使用了DTOMapper。
到目前为止,一切都运行良好。我的问题是,使用DTOMapper rfom表示层是否可以练习?例如,如果我想以HTML格式呈现我的数据库中的条目列表,我应该使用演示文稿中的DTOmapper,还是使用Entries集合方法
,它在内部使用DTOMapper。

第二种选择听起来更清洁,更分离。只是想看看你们的想法......

谢谢!

Laimis
Hey guys,

I just recently got introduced to data mappers (DTO mapper). So now I have
a SqlHelper being used by DTOMapper and then business layer is using
DTOMapper when it needs to persist object to database or load them back.
Everything is working nicely so far. My question is, is it OK practice to
use DTOMapper rfom the presentation layer? For instance, if I want to
present in HTML format the list of entries in my database, should I use
DTOmapper from the presentation, or instead use Entries collection method
which internally uses DTOMapper.

THe second option sounds more cleaner and more seperated. Just want to see
what you guys think...

Thanks!

Laimis



collection


" laimis" < SI ***** @ iit.edu>在消息中写道

新闻:uE ************** @ TK2MSFTNGP12.phx.gbl ...
collection

"laimis" <si*****@iit.edu> wrote in message
news:uE**************@TK2MSFTNGP12.phx.gbl...
嘿伙计们,

我刚刚介绍了数据映射器(DTO mapper)。所以现在我有了DTOMapper使用的SqlHelper,然后业务层在需要将对象持久化到数据库或加载它们时使用了DTOMapper。
到目前为止,一切都运行良好。我的问题是,使用DTOMapper rfom表示层是否可以练习?例如,如果我想以HTML格式呈现我的数据库中的条目列表,我应该使用演示文稿中的DTOmapper,还是使用Entries集合方法
,它在内部使用DTOMapper。

第二种选择听起来更清洁,更分离。只是想看看你们的想法......

谢谢!

Laimis
Hey guys,

I just recently got introduced to data mappers (DTO mapper). So now I have
a SqlHelper being used by DTOMapper and then business layer is using
DTOMapper when it needs to persist object to database or load them back.
Everything is working nicely so far. My question is, is it OK practice to
use DTOMapper rfom the presentation layer? For instance, if I want to
present in HTML format the list of entries in my database, should I use
DTOmapper from the presentation, or instead use Entries collection method
which internally uses DTOMapper.

THe second option sounds more cleaner and more seperated. Just want to see
what you guys think...

Thanks!

Laimis






当然发送选项是最好的。我认为架构应该是

看起来像:


演示层

|

业务逻辑层

|

数据访问层

查看MS'的PetShop示例,您的想法会更清晰。

laimis < SI ***** @ iit.edu> ???新闻:uE ************** @ TK2MSFTNGP12.phx.gbl

??? ...
Hi,

Of course the send option is the best. I thinkd the architecture should
looks like:

presentation layer
|
business logic layer
|
data access layer
Check MS''s PetShop sample, you will get your idea clearer.
"laimis" <si*****@iit.edu> ??? news:uE**************@TK2MSFTNGP12.phx.gbl
???...
嘿伙计们,

我刚刚介绍了数据映射器(DTO mapper)。所以现在我有了DTOMapper使用的SqlHelper,然后当需要将对象持久化到数据库或加载它们时,业务层使用DTOMapper。到目前为止,一切都很顺利。我的问题是,是否可以实践使用DTOMapper rfom表示层?例如,如果我想以HTML格式呈现我的数据库中的条目列表,那么我应该从演示文稿中使用DTOmapper,还是使用Entries
收集方法,该方法在内部使用DTOMapper。

第二种选择听起来更清洁,更分离。只是想看看你们的想法......

谢谢!

Laimis
Hey guys,

I just recently got introduced to data mappers (DTO mapper). So now I
have a SqlHelper being used by DTOMapper and then business layer is
using DTOMapper when it needs to persist object to database or load them
back. Everything is working nicely so far. My question is, is it OK
practice to use DTOMapper rfom the presentation layer? For instance, if
I want to present in HTML format the list of entries in my database,
should I use DTOmapper from the presentation, or instead use Entries
collection method which internally uses DTOMapper.

THe second option sounds more cleaner and more seperated. Just want to
see what you guys think...

Thanks!

Laimis


Edwinyeah的NUnitPartner
自动生成NUnit测试用例!
http://www.freewebs.com/edwinyeah/
Edwinyeah''s NUnitPartner
Automatic NUnit test case generation!
http://www.freewebs.com/edwinyeah/



这篇关于数据层架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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