This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 99124 - Assembled/realized interfaces are removed after component removal
Summary: Assembled/realized interfaces are removed after component removal
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: Diagram Component (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Thuy.d Nguyen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-27 14:05 UTC by Sergey Petrov
Modified: 2007-05-25 08:37 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Petrov 2007-03-27 14:05:19 UTC
reproducible with 070323

Assembled/realized interfaces are removed after component removal if in iconic
view. Can lead to data loss.

steps:
1. create component diagram
2. add component
3. select interface in palette
4. click on the component and in free space
5. repeat step 4
6. transform second interface to non-iconic view
7. select assembly connector in palette
8. repeat step 4
9. select component only (on diagram) and press delete
10. select checkbox "remove from model" and press Yes in confirmation dialog
all iconic interfaces are removed from model
(non-iconic remains)
Comment 1 Yang Su 2007-03-29 20:27:27 UTC
The described testcase creates one component, two provided interfaces (without
consuming component connected) and a required interface (without supplier). 

The iconic interface (assembly connector) is implemented in TSConnector (from
TomSawyer library) with a definition -- "A connector is a specialized node that
may be placed at the end or the beginning of an edge path. A connector is always
owned by a drawable node."

So when a component is selected on graph to be deleted, its connector is
selected inexplicitly, if the connector is not connected to other components, it
will be deleted as well which is the case here. Please test a scenario with
assembly connector connecting to both provided and required interfaces, delete
one component and verify the iconic interface stays.

The assembly connector is type of interface, once it's transformed to non-iconic
form its underlying implementation has switched to regular Interface node from
TSConnector, the ownership constraint is gone, that's why its behavior is
different. It now serves as a standalone standard interface realized by a
component rather than a single interface provided by the component.

I think the current behavior is intended and correct, any counterarguments?
Comment 2 Sergey Petrov 2007-03-30 16:39:59 UTC
- is it TS definition or uml specification definition? Is it good to argue
behavior/changes by ts internal behavior?
- another use case
   1) component provide interface 
   2) some class implement the interface on another diagram
   3) ok, don't need component any more, select and remove from model
   oh, my interface gone away too...
- another example:  several components provide(use/assemble) the same interface
(but different presentations of the interface on the same diagram or on
different diagrams), and I delete one of component
- if component-iconic interface have really tight relation why interfaces aren't
removed if components are removed from project tree
- is it really good to delete something without warnings/asking, as I remember
we asked users if they want to delete accessors but accessors really have no
sense after deletion of attribute.. 
- etc :)
Comment 3 Thuy.d Nguyen 2007-04-25 05:42:34 UTC
Changed the logic not to remove lollipop interfaces and assembly connectors that
are connected to a component being deleted.
Comment 4 Andrew Korostelev 2007-05-25 08:37:37 UTC
verified in netbeans-6.0-nightly-200705250000-full