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();
  • No labels

1 Comment

  1. Hi all,

    When reading this proposal, which seems an elegant solution to me. Apologize if I have misunderstood it, but I have two questions.

    1) I have the impression that this proposal assumes that the LinkableComponent can offer all capabilities and just needs to know how it should operate. I wonder if this requirement (accomodate all operationmodes) will prevent components becoming OpenMi complaint because they only are fit for one or the other option.

    Should the proposed operationMode not be a property of the LC with which the component can indicate its capabilities (to my possibly incorrect understanding, this is not yet part of the proposal). Once the LC has made its capabilities available, one can use the proposed initailize method to set it in the right mode.

    2) With regard to the modes itself, I miss the specification that the LC can be pulled by another component, even if this is a default required capabiity.