Components:
Product Line Architecture Merge

Product Line Architecture Merge

As a deployed system evolves overtime new features may be added, obsolete features may be removed and existing features may be upgraded.  As a result, in an evolving product line architecture, an architect may wish to capture changes made to different components and then propagate them to others.  The PLADiff component can be used to capture changes between two architectures or between two different versions of the same architecture.  PLADiff outputs a PLA diff document that describes the captured changes.  This document is used by PLAMerge in order to move features from one variant of a product line architecture to another variant or propagating changes across different versions (or branches of development).  The PLAMerge component is able to merge the captured differences to an architecture in terms of architectural elements (as defined by xADL 2.0) at design time.

The PLAMerge component starts at a specified location (either a Type or an ArchStructure) and adds and removes the respective elements to the location as described in the PLA diff document.  The merging algorithm first makes the appropriate changs to the root DiffPart.  It finds the proper location based on the Locationelement defined in the PLA diff document. Then the algorithm processes the corresponding adds and removes within that Diff Location.  If the current DiffPart has another DiffPart embedded in it, then the merge algorithm processes that DiffPart recursively.  It searches through the elements in the current location and finds the new component that it must modify specified by the Location element.  Once found, the subsequent adds and removes are made within this location.  This processes continues recursively till all DiffParts are processed.

The PLAMerge component issues warnings in the following three cases: 

  • An element it is trying to merge into cannot be found.
  • An element it is trying to remove cannot be found.
  • An element it is trying to add already exists.
  • If any of these cases occur, a warning is issued and the architect is notified about where such an event has occurred.  It becomes the responsibility of the architect to properly respond to the warnings according to his/her desired goals. 

    In addition to the adding and removing of elements from an architecture, the PLAMerge fixes any broken links.  The key thing to note is that our merge process is description based and elements such as Signature Interface Mappings and Links connect to elements based on their IDs.  During the merge, when adding or removing SIMs or Links or changing elements where the SIMs or Links are connected, their corresponding IDs change.  As a result, the XML links between such elements are broken.  Therefore, as a final resort PLAMerge iterates through all possible broken Signature Interface Mappings and Links and fixes their XML links.


    The PLAMerge component can be invoked through the UI driver or manually by sending the PerformPLAMergeMessage request.

    PerformPLAMergeMessage

    public PerformPLAMergeMessage(String diffURL,
        String archURL, String startingID,
        boolean isStructural, String componentID)
                
    Parameters:
    diffURL - This is the URL of the diff document that merge will get the additions and removals from.
    archURL - This is the URL of the open xADL architecture that we are merging into. Note this architecture will be modified during the merge process.
    startingID - This is the ID of the ArchStructure or type-version element in the architecture where we should start the merge process
    isStructural - This flag is true if the IDs passed in corresponds to an ArchStructure element, false if its a type-version element .
    componentID - This is ID of the component requesting the merge service. This ID is the same as the ID in the PLAMergeStatusMessage that corresponds to this merge process. This is to allow the requesting component to only listen in on the progress messages it cares about. This field can be null.

    Then to invoke PLAMerge:


    /* In a C2Component*/
    // Create the message // This invokes the merge process on the architectures // specified. // -diffURL: The URL of the diff document that contains // all the instructions for the merge // -architecture: the URL of the architecture that we are // merging into // -startingID: The ID of the element in the architecture // to start the merge process // -We pass in true if the ID corresponds to ArchStructures // -compID: The component ID of the requesting component // (this component) PerformPLAMergeMessage mergeMessage = new PerformPLAMergeMessage(diffURL, architecture startingID, true, compID);

    // Sends the request upwards
    sendToAll(mergeMessage , topIface);
     


    When the merge process has completed, it will send out the following message:

    PLAMergeStatusMessage

    public PLAMergeStatusMessage(String mergeArchURL,
        String componentID, int currentValue, int upperBound,
        boolean isDone, boolean errorOccurred, Exception error)
    
    Parameters:
    mergeArchURL - This is the URL of the architecture that we are merging into.
    componentID - This is the ID of the component who requested the merge service. This field may be null
    currentValue - This is the numerical representation of the current progress.
    upperBound - This is total expected work that is required.
    isDone - This is a flag to signal whether or not the merge process has completed. Note: this will be true in the case of errors.
    errorOccurred - This flag to signal whether or not an error has occurred.
    error - This is the actual exception that occurred, please refer to the list below.
    Exceptions:
    InvalidURLException - This exception is thrown when the provided URL to open an xArch document is invalid.
    InvalidElementIDException - This exception is thrown if the provided starting ID is invalid.
    MissingElementException - This exception is thrown when the algorithm cannot find a required element in the architecture description.
    MissingAttributeException - This exception is thrown when an expected attribute does not exist.
    BrokenLinkException - This exception is thrown when a HREF resolves to null.

    Please note that although the message can contain progress information (currentValue and upperBound), these fields currently are not used. The PLAMerge component does not report on its progress during the merge process but only sends out this message when it has finished. All of these values can be obtained through a simple get operation, getX() where X is the field name. For example, getMergeArchURL() would get the mergeArchURL value, getComponentID() would get the componentID value, and so forth.


    Additional questions about the PLAMerge component should be sent to Chris Van der Westhuizen.