Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Code Block
In ILinkableComponent:

	/*
	Discuss: why not have a method and an enumeration for the operation
	mode of the linkable component. The enumeration can specify PUSH,
	PULL, and FREE mode, and in the future other types. It can be set 
	by one of the IArguments in initialize(), or with a fixed parameter
	to initialize(). OperationMode.PULL is the default behaviour. 
	Making it specific helps to clarify and document it already in the
	source code.
	*/
	
    public enum OperationMode {
        
        /**
         * The component will actively 'pull' other components for values.
         */
	PULL,
        
        /**
         * The component will actively 'push' values to other components.
         */
	PUSH,
        
        /**
         * Flow of values is free, i.e. not controlled by the component.
         */
	FREE 
    }

    /**
     * @return The collection of supported OperationModes.
     */
    public Collection<OperationMode> supportedOperationModes();

    /**
     * Requests a component to initialise itself for computation, based on
     * the specified OperationMode and additional arguments. Unsupported
     * modes or invalid/missing arguments should result in an exception.
     * 
     * @param mode OperationMode the component should use
     * @param arguments for the initialisation
     */
    public void initialize(OperationMode mode, IArgument[] arguments);

    /**
     * Requests updating of the component for the specified output items
     * (which should belong to the component). How update works depends on
     * the OperationMode the component was initialised to. In pull-mode the
     * update method can call the update method of connected components in
     * order to get required input data. In push-mode the update method will
     * write data to connected components. In free-mode there should be no
     * side-effects, control of the flow of values is handled externally.
     * 
     * @param requiredOutputItems to update for
     * @return False when update failed
     */
    public boolean update(IOutputItem[] requiredOutputItems);

    public String validate();

    public void finish();