Interface IModel

All Known Implementing Classes:
Model

public interface IModel

The interface definition for a PureMVC Model.

In PureMVC, IModel implementors provide access to IProxy objects by named lookup.

An IModel assumes these responsibilities:

  • Maintain a cache of IProxy instances
  • Provide methods for registering, retrieving, and removing IProxy instances
  • Method Summary

    Modifier and Type Method Description
    boolean hasProxy​(java.lang.String proxyName)
    Check if a Proxy is registered
    void registerProxy​(IProxy proxy)
    Register an IProxy instance with the Model.
    IProxy removeProxy​(java.lang.String proxyName)
    Remove an IProxy instance from the Model.
    IProxy retrieveProxy​(java.lang.String proxyName)
    Retrieve an IProxy instance from the Model.
  • Method Details

    • registerProxy

      void registerProxy​(IProxy proxy)

      Register an IProxy instance with the Model.

      Parameters:
      proxy - an object reference to be held by the Model.
    • retrieveProxy

      IProxy retrieveProxy​(java.lang.String proxyName)

      Retrieve an IProxy instance from the Model.

      Parameters:
      proxyName - proxy name
      Returns:
      the IProxy instance previously registered with the given proxyName.
    • removeProxy

      IProxy removeProxy​(java.lang.String proxyName)

      Remove an IProxy instance from the Model.

      Parameters:
      proxyName - name of the IProxy instance to be removed.
      Returns:
      the IProxy that was removed from the Model
    • hasProxy

      boolean hasProxy​(java.lang.String proxyName)

      Check if a Proxy is registered

      Parameters:
      proxyName - proxy name
      Returns:
      whether a Proxy is currently registered with the given proxyName.