English 中文(简体)
效仿订阅服务所需的模式
原标题:Pattern needed to emulate subscription service

出版一些B、C和D物体有兴趣知道,因为E、F和G不关心。

如果说只有B,C,D应当获得这种“工资”。

什么设计模式有助于最好地效仿?

** How do i use Tibco, without using Tibco?

最佳回答

如果J2SE的正常应用,如果事件的出版商和事件的订户是同一过程空间的物体,则属于观察员模式。

登记员通常会告知出版商,他们希望通过采用特殊方法,如添加Listener(Lstener)和采用具体接口来听取活动。

因此,在你的例子中,我们要说,我们创建了一个接口号码EventListener,在NumberEvent(序号)上有一个方法。

你们的听众都会在你们的出版对象上执行“数字生活”和“附加生活”。

过滤可以在出版商或听众方面进行。 因此,为了执行你,你可以增加Listener(NumberEventListener)听器(NumberEventListener, int min, int max)和你的听器,只有在数量在最高和最高之间才能使用。 然而,这并不是一个典型的执行,因为它使出版商的守则更加复杂,而且你实际上能够灵活。

举例来说,通常听众会接受所有相关活动,抛弃他们不感兴趣的活动。 然而,这几乎取决于实际生活情况。

听众是否同时或依次得到通知,取决于听众是否依次或由活动出版商分别援引。

问题回答

什么是 Publish——描述信息交流模式?

Also referred to as Publish / Subscribe Channel in Enterprise Integration Patterns: http://www.eaipatterns.com/PublishSubscribeChannel.html

在 Java,JMS通常提供这种信息服务。

观察员模式。

或者,由于你提到某些物体根据电文内容做了一些事情,可适用“过滤链”模式。 它像一个过滤链对我来说是健全的。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签