【发布时间】:2013-03-23 10:59:40
【问题描述】:
我想在我的下一个项目中使用 SOA 架构。另外,我想将 WCF 数据服务用于数据访问层。例如,用户想要接收某个日期的文档。我们调用WCF服务(Service Layer)来检索文档
public ActionResult GetDocumentByDate(DateTime date)
{
var request = // here create request object;
var documentsDto = _documentService.GetDocument(request);
...
}
在 WCF 服务中我们称之为业务层(BL):
public class DocumentService:IDocumentService
{
public IEnumerable<DocumentDto> GetDocumentsByDate(DocumentsByDateRequest request)
{
// call GetDocumentsByDate from DocumentLogic
}
}
public class DocumentLogic
{
public IEnumerable<Document> GetDocumentsByDate(DateTime date)
{
// call DAL
}
}
我想使用 WCF 数据服务来获取数据。我没有使用过这项技术。
最好将 WCF 数据服务隐藏在服务层之后,否则它们应该可用,只是 SL 通过 WCF 数据服务访问数据?
在这种情况下,外界会看到WCF服务和WCF数据服务。
按照例子,哪里做验证比较好?
最后是一般性问题,您对 WCF 数据服务的印象如何?
【问题讨论】:
标签: c# asp.net-mvc wcf architecture soa