package leigh.elements.sdk;

import java.util.UUID;

/**
 * Classes implementing this interface represent as single processing context for an elements application. The context
 * is owned by a specific user, and can generally be thought of in terms of a session. A user can have multiple
 * contexts at any one time. A context is related to a single application, so a client dealing with multiple
 * applications at one time will have multiple contexts.
 * <p>
 * In terms of client/server operation, all of the operations that a remote client can perform are encompassed
 * by this interface. Therefore, implementing remoting is a matter of providing a network transport for
 * these methods.
 *
 * @author Alex Leigh
 */
public interface AppContext {
    /**
     * Open a new screen with the given id. If no such screen exists within the application,
     * <code>null</code> is returned. This method returns the screen graph for the initial screen state.
     */
    AppScreenInstance createNewScreen(UUID id) throws Exception;

    AppInstance getInstance();
}
