English 中文(简体)
难道行动就是代表团模式的一个例子吗?
原标题:Is ActionListener an example of Delegation pattern?

In my college days, I never realized what patterns were there in the Java API. Now at work I came across Delegation pattern in Objective C n Cocoa on iOS where one screen sets itself as a delegate on coming screen so that that screen can pass some message to that delegate and it can take some action when it comes back to the previous screen.

我认识到,我用的是把“这”作为“行动手段”传递给“JButton”时的类似做法,它将自动称为我在这个类别中实施的行动小组,因此我可以改变我的JFrame类别的任何案例数据。

因此,如果我正确的话,“行动”是否是一个代表的例子?

www.un.org/Depts/DGACM/index_spanish.htm EDIT: 如下文正确提到的那样,这是一种观察员模式。 我们添加一句话。 因此,可以有许多名单人参与这一行动。

最佳回答

ActionListener is an example of the observer pattern. You register observers (or listeners) on a component that get called when a specific event occurs.

问题回答

暂无回答




相关问题
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 ...

热门标签