哪些应用层负责对外提供服务集成能力?
What application layer is responsible for providing external service integration capabilities?
我有一个 Spring 带有表示、业务逻辑、数据访问逻辑层的启动 Web 应用程序。将外部接口调用(REST、WS)描述为数据访问层在概念上是否正确? IE。也是数据库访问所在的位置。从概念上讲,这对我来说很有意义。
此外,与外部服务的交互应该称为 DAO 还是 "clients"?我认为例如Spring 引导教程将 RestTemplates 称为 REST "clients",因此一种可能性是拥有一个 DAO,然后使用 RestTemplate "client" 实际进行 REST 调用。这有意义吗?
Is it conceptually correct to describe external interface calls (REST,
WS) to be in the Data Access Layer
数据访问对象用于抽象和封装对数据源的访问。数据源可以是持久存储、外部服务、存储库等。
one possibility would be to have a DAO, which then uses the RestTemplate "client" to actually make the REST call
DAO 实现了使用数据源所需的访问机制。 DAO 有责任为应用程序提供抽象 API,但实现可以是任意的。使用 RestTemplate
在 DAO 中进行 REST 调用完全没问题。
文章“Core J2EE Patterns - Data Access Object”可能对阅读有用
我有一个 Spring 带有表示、业务逻辑、数据访问逻辑层的启动 Web 应用程序。将外部接口调用(REST、WS)描述为数据访问层在概念上是否正确? IE。也是数据库访问所在的位置。从概念上讲,这对我来说很有意义。
此外,与外部服务的交互应该称为 DAO 还是 "clients"?我认为例如Spring 引导教程将 RestTemplates 称为 REST "clients",因此一种可能性是拥有一个 DAO,然后使用 RestTemplate "client" 实际进行 REST 调用。这有意义吗?
Is it conceptually correct to describe external interface calls (REST, WS) to be in the Data Access Layer
数据访问对象用于抽象和封装对数据源的访问。数据源可以是持久存储、外部服务、存储库等。
one possibility would be to have a DAO, which then uses the RestTemplate "client" to actually make the REST call
DAO 实现了使用数据源所需的访问机制。 DAO 有责任为应用程序提供抽象 API,但实现可以是任意的。使用 RestTemplate
在 DAO 中进行 REST 调用完全没问题。
文章“Core J2EE Patterns - Data Access Object”可能对阅读有用