de.novanic.eventservice.client.event.domain
Interface Domain

All Superinterfaces:
java.lang.Comparable<Domain>, java.io.Serializable
All Known Implementing Classes:
DefaultDomain

public interface Domain
extends java.io.Serializable, java.lang.Comparable<Domain>

Domains/contexts are used to specify the range where events should occur and listened. That supports the reuse of events (Event and listeners (RemoteEventListener.

Example:
Your application is a multiplayer online game with a conversation system. You defined the following events and listeners.

Events: NewUserEvent
Listeners: ConversationListener, ConversationChannelListener, PlayerListListener

It makes sense to divide your elements into different domains, to ensure that a NewUserEvent affects only the right context/domain. For example one conversation domain and one game domain. ConversationListener and ConversationChannelListener should be added to the conversation domain and the PlayerListListener should be added to the game domain. Now you can distinguish the context of the NewUserEvent. If a user joined a conversation (NewUserEvent added to conversation domain), the two conversation listeners will recognize it and the PlayerListListener won't be informed about the NewUserEvent in the conversation context/domain.

Author:
sstrohschein
Date: 15.08.2008
Time: 22:42:10

Method Summary
 java.lang.String getName()
          Return the name of the domain.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getName

java.lang.String getName()
Return the name of the domain.

Returns:
domain name