English 中文(简体)
层楼建筑中的共同事务
原标题:common services in layered architecture

我在许多书籍中读到,在一个层楼层结构中,一层只能使用以下各层提供的服务。 通常使用的等级为:

  1. Presentation
  2. Business
  3. Persistence

这意味着,商业层面的服务(包含商业逻辑)只能获得持续存在层提供的服务。

我有一个向用户发送信息的电传服务。 每当物体状况发生重大变化时,必须通知所有相关用户这一变化。 这意味着,确定变革的工商部门必须发出电传服务,发出信息。 但是,电传服务本身处于商业层面,因此,同一层的其他服务不应进入。

因此,我们如何使用电传服务而不违反守则的结构?

问题回答

投放层(或高层)并不仅仅指电离层,而是消耗系统服务的任何东西。 比如,表列的工作岗位可以排在上层(也许你不想把它称作表层)。 在您的案例中,我觉得“电传服务”应当处于顶级,因为它消耗了该系统的其他服务。 例如,如果你书写网络服务,就应当放在服务层之上,但你可能希望以不同的名称命名。





相关问题
Multiple Hibernate instances using C3P0

I am facing a weird problem and it seems to be c3p0 related. I am starting two instances of an app in the same java vm which interact with each other. After some operations "APPARENT DEADLOCK" ...

Hibernate vs Ibatis caching

We can speed up a hibernate app easyly with 2nd level cache using infinispan or ehcache/terracotta,... but ibatis only have a simple interface to implement for caching. And hibernate knows more ...

Using annotations to implement a static join in hibernate

I m relatively new to hibernate and was wondering if someone could help me out. While I have no issues implementing a normal join on multiple columns in hibernate using the @JoinColumns tag, I m ...

Hibernate query with fetch question

I have a 2 entities in a One-To-Many relationship: OfficeView.java: public class OfficeView implements java.io.Serializable { private Integer officeId; private String addr1; private ...

hibernate interceptors : afterTransactionCompletion

I wrote a Hibernate interceptor : public class MyInterceptor extends EmptyInterceptor { private boolean isCanal=false; public boolean onSave(Object entity, Serializable arg1, Object[] arg2, String[]...

How to prevent JPA from rolling back transaction?

Methods invoked: 1. Struts Action 2. Service class method (annotated by @Transactional) 3. Xfire webservice call Everything including struts (DelegatingActionProxy) and transactions is configured ...

Hibernate/GORM: collection was not processed by flush()

I have an integration test in my Grails application that fails when I try to save an entity of type Member invitingMember.save(flush: true) This raises the following exception org.hibernate....

Hibernate Criteria API equivalent for "elements()"

Is it possible to implement the following query using Criteria API? select order from ORDER as order,ITEM as item where item.itemID like ITM_01 and item in elements(order.items)

热门标签