<commit_before><commit_msg>Job: #81 Add design note<commit_after>---

Copyright 2013 Mentor Graphics Corp.  All Rights Reserved.

---

# Support creating an interface satisfaction with one tool action
### xtUML Project Design Note

1. Abstract
-----------
This note describes the design required to support creating an interface
satisfaction with a single tool action.

2. Document References
----------------------
[1] Issues 81, https://github.com/xtuml/doc/issues/81  
[2] CQ Issue dts0100938460 - Add an "assembly connector" to Component drawer in
                                    Palette to connect components with interface

3. Background
-------------
Customers are asking for an assembly connection tool which will allow a single
tool to create both a provision and a requirement.

4. Requirements
---------------
4.1 Support a single action to create a satisfaction between two components.

5. Analysis
-----------
5.1 Support auto-creation of satisfaction

The customer has asked for a new tool that will allow creating a satisfaction
with one action.  Rather than introduce a new tool it was decided that we will
extend the support for the existing Provided Interface and Required Interface
tools such that they will auto-create the required element to produce the
satisfaction.

6. Design
---------
6.1 Support auto-creation of satisfaction

To support auto-creation of any graphical element the ooaofgraphics model is
modified in the following manner:

Element Specification.xtuml - Modified to include a referential attribute from
                              Terminal Specification
Terminal Specification.xtuml - Association added between self and Element
                               Specification
                               
The new association between the two classes captures the fact that a terminal
specification may create an element specified by the element specification.  For
this particular issue the terminal specification is a component symbol, and the
element specification to create is either a provided interface or a required
interface.

6.2 Configure auto-creation definitions

The schema for the canvas editor is modified to include automatic creation 
elements.  This schema extension allows a termination specification in xml to
include a definition for auto-creating another element specification.

The plugin.xml for ui.graphics is modified to use this new definition.  The
changes specify automatic creation for the provided interface and required
interface definitions.  Each create the opposite element in the satisfaction for
automatic creation.

6.3 Use auto-creation definitions

In order to use the new definitions the graphics code must look at the
configured terminal specifications and see if the end specification has an
element to auto-create.  If this is true then a new command is executed,
AutocreationCommand.java.  This new command will create the selected tool's
element.  It will use the start and end points of the drawn line and split it
in half.  The new connection will be between the start point to the mid-point.
After this creation has occurred the command will find the element specification
for the auto-create element.  This data is used to create another connection
that has the initial target as it's source and the newly created connection as
its target.  It's positional data is the other half of the initially drawn line.

7. Design Comments
------------------

8. Unit Test
------------
8.1 Provided Interface tool

_- Select the provided interface tool
_- Click on the source component and drag to the target component
_R A provided interface and required interface is created
_R The two interface references are satisfied
_R The provided interface's source is the first component selected

8.2 

_- Select the required interface tool
_- Click on the source component and drag to the target component
_R A required interface and provided interface is created
_R The two interface references are satisfied
_R The required interface's source is the first component selected

End
---

{'fraction_non_alphanumeric': 0.052644526445264454, 'fraction_numerical': 0.010824108241082412, 'mean_word_length': 3.357984994640943, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2270431', 'n_tokens_mistral': 922, 'n_tokens_neox': 868, 'n_words': 559}