001/*
002 * GWTEventService
003 * Copyright (c) 2011 and beyond, strawbill UG (haftungsbeschr?nkt)
004 *
005 * This is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU Lesser General Public License as
007 * published by the Free Software Foundation; either version 3 of
008 * the License, or (at your option) any later version.
009 * Other licensing for GWTEventService may also be possible on request.
010 * Please view the license.txt of the project for more information.
011 *
012 * This software is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * You should have received a copy of the GNU Lesser General Public
018 * License along with this software; if not, write to the Free
019 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021 */
022package de.novanic.eventservice.client.event.domain;
023
024import java.io.Serializable;
025
026/**
027 * Domains/contexts are used to specify the range where events should occur and listened. That supports the reuse of
028 * events ({@link de.novanic.eventservice.client.event.Event} and listeners ({@link de.novanic.eventservice.client.event.listener.RemoteEventListener}.
029 * <br>
030 * <br>Example:
031 * <br>Your application is a multiplayer online game with a conversation system. You defined the following events and
032 * listeners.
033 *   <br>
034 *   <br>Events: NewUserEvent
035 *   <br>Listeners: ConversationListener, ConversationChannelListener, PlayerListListener
036 *   <br>
037 * <br>It makes sense to divide your elements into different domains, to ensure that a NewUserEvent affects only the right
038 * context/domain. For example one conversation domain and one game domain. ConversationListener and
039 * ConversationChannelListener should be added to the conversation domain and the PlayerListListener should be added to
040 * the game domain. Now you can distinguish the context of the NewUserEvent. If a user joined a conversation (NewUserEvent
041 * added to conversation domain), the two conversation listeners will recognize it and the PlayerListListener won't be
042 * informed about the NewUserEvent in the conversation context/domain.
043 *
044 * @author sstrohschein
045 * <br>Date: 15.08.2008
046 * <br>Time: 22:42:10
047 */
048public interface Domain extends Serializable, Comparable<Domain>
049{
050    /**
051     * Return the name of the domain.
052     * @return domain name
053     */
054    String getName();
055}