We pretty much use the same throughout our enterprise apps, with two additions, viz 1) for transactional services, an additional List<> property containing a list of "Validation Results", each of which models a single business rule or validation rule violation, which can then be reported back to the client (user or service consumer) with as much context information as possible, and 2) for data services we add paging information, indicating how much total data is available to the client (given that we only allow a finite number of rows to be returned). This allows the client to tie into a pagination strategy.
The only complaint thus far is for Service Consumers - when we exposed service methods returning the typed generic across the enterprise (ESB / SOA), is that the WSDL / naming of the generics can be cumbersome (e.g. ReturnResultOfPOUpdateRequestJQ3KogUE). This isn't of much concern to .NET clients if we share the Entities on both client and service, but for other clients such as Java, Mobile etc can be problematic, and sometimes we need to provide an alternative facade for such clients without the generics.
发布评论
评论(1)
我们在整个企业应用程序中几乎使用相同的内容,但添加了两个内容,即 1) 用于事务服务,一个附加的 List<> 。包含“验证结果”列表的属性,每个结果都对单个业务规则或验证规则违规进行建模,然后可以使用尽可能多的上下文信息将其报告回客户端(用户或服务使用者),以及 2)数据服务我们添加分页信息,指示客户端可用的总数据量(假设我们只允许返回有限数量的行)。这允许客户端结合分页策略。
到目前为止,唯一的抱怨是服务使用者 - 当我们公开在整个企业(ESB / SOA)中返回类型化泛型的服务方法时,泛型的 WSDL / 命名可能很麻烦(例如 ReturnResultOfPOUpdateRequestJQ3KogUE)。如果我们在客户端和服务上共享实体,这对于 .NET 客户端来说并不是太重要,但对于其他客户端(例如 Java、Mobile 等)可能会出现问题,有时我们需要为此类客户端提供替代外观,而不需要仿制药。
We pretty much use the same throughout our enterprise apps, with two additions, viz 1) for transactional services, an additional List<> property containing a list of "Validation Results", each of which models a single business rule or validation rule violation, which can then be reported back to the client (user or service consumer) with as much context information as possible, and 2) for data services we add paging information, indicating how much total data is available to the client (given that we only allow a finite number of rows to be returned). This allows the client to tie into a pagination strategy.
The only complaint thus far is for Service Consumers - when we exposed service methods returning the typed generic across the enterprise (ESB / SOA), is that the WSDL / naming of the generics can be cumbersome (e.g. ReturnResultOfPOUpdateRequestJQ3KogUE). This isn't of much concern to .NET clients if we share the Entities on both client and service, but for other clients such as Java, Mobile etc can be problematic, and sometimes we need to provide an alternative facade for such clients without the generics.