Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve design of edge constraints checking #416

Closed
prmr opened this issue Feb 22, 2021 · 0 comments
Closed

Improve design of edge constraints checking #416

prmr opened this issue Feb 22, 2021 · 0 comments
Labels
main Issues with the main code base refactoring A proposal to refector or generally improve the code
Milestone

Comments

@prmr
Copy link
Owner

prmr commented Feb 22, 2021

The edge validation code requires the construction of an entirely new ConstraintSet object for every call, which is not efficient. We can refactor the code so that we only need one ConstraintSet per diagram type.

@prmr prmr added refactoring A proposal to refector or generally improve the code main Issues with the main code base labels Feb 22, 2021
@prmr prmr added this to the Release 3.2 milestone Feb 22, 2021
prmr added a commit that referenced this issue Feb 22, 2021
When a user attempts to create a constructor call, they use the normal
"CallEdge" creation tool from the tool bar. This design decision was to
avoid forcing the user to use two very similar tools to create call and
constructor edges. However, internally if a constructor call is created,
a ConstructorEdge must be used, so it's necessary to convert the
original CallEdge to a Constructor Edge. This was initially done in the
DiagramCanvasController, leading to a special case and coupling with the
SequenceDiagram Builder. To avoid this design weakness, the conversion
from CallEdge to ConstructorEdge is moved to the SequenceDiagramBuilder.
Farihatanjin pushed a commit to Farihatanjin/JetUML that referenced this issue Feb 23, 2021
When a user attempts to create a constructor call, they use the normal
"CallEdge" creation tool from the tool bar. This design decision was to
avoid forcing the user to use two very similar tools to create call and
constructor edges. However, internally if a constructor call is created,
a ConstructorEdge must be used, so it's necessary to convert the
original CallEdge to a Constructor Edge. This was initially done in the
DiagramCanvasController, leading to a special case and coupling with the
SequenceDiagram Builder. To avoid this design weakness, the conversion
from CallEdge to ConstructorEdge is moved to the SequenceDiagramBuilder.
prmr added a commit that referenced this issue Feb 23, 2021
The case where trying to create a constructor edge was implemented as a
special case in constraints, where the constraint was only added to the
constraint set if the call could be a legal constructor call. This
divergence from the design, where all constraints are stored in a set,
was creating an obstacle to the future improvement of the constraint
management. With this change, all constraints are implemented as
predicates.
Farihatanjin added a commit to Farihatanjin/JetUML that referenced this issue Feb 24, 2021
`ConstraintSet` is now stored as a private static final field in each
diagram builder. This reduces object creation by eliminating the need to
create and merge new `ConstraintSet` objects each time `canAdd` is
called. For this reason, I removed the `merge` method in `ConstraintSet`
which is no longer necessary.
The `ConstraintSet` field can be accessed by method
`getEdgeConstraints()` which simply returns the set of constraints. I
see no encapsulation issue in doing so since there is no method
available to modify contents of a `ConstraintSet` which will be
returned.
 `Satisfied` takes in the `canAdd` parameters in order to check the
conditions whilst keeping the code simple.
Farihatanjin added a commit to Farihatanjin/JetUML that referenced this issue Feb 24, 2021
ConstraintSet is now stored as a private static final field in each
diagram builder. This reduces object creation by eliminating the need to
create and merge new ConstraintSet objects each time canAdd is
called. For this reason, I removed the `merge` method in ConstraintSet
which is no longer necessary.
The ConstraintSet field can be accessed by method
getEdgeConstraints() which simply returns the set of constraints. I
see no encapsulation issue in doing so since there is no method
available to modify contents of a ConstraintSet which will be
returned.
Satisfied takes in the canAdd parameters in order to check the
conditions whilst keeping the code simple.
yannsartori added a commit to yannsartori/JetUML that referenced this issue Feb 24, 2021
prmr pushed a commit that referenced this issue Feb 25, 2021
Farihatanjin added a commit to Farihatanjin/JetUML that referenced this issue Feb 25, 2021
`ConstraintSet` is now stored as a private static final field in each
diagram builder. This reduces object creation by eliminating the need to
create and merge new `ConstraintSet` objects each time `canAdd` is
called. For this reason, I removed the `merge` method in `ConstraintSet`
which is no longer necessary.
The `ConstraintSet` field can be accessed by method
`getEdgeConstraints()` which simply returns the set of constraints. I
see no encapsulation issue in doing so since there is no method
available to modify contents of a `ConstraintSet` which will be
returned.
 `Satisfied` takes in the `canAdd` parameters in order to check the
conditions whilst keeping the code simple.
Farihatanjin added a commit to Farihatanjin/JetUML that referenced this issue Feb 25, 2021
ConstraintSet is now stored as a private static final field in each
diagram builder. This reduces object creation by eliminating the need to
create and merge new ConstraintSet objects each time canAdd is
called. For this reason, I removed the `merge` method in ConstraintSet
which is no longer necessary.
The ConstraintSet field can be accessed by method
getEdgeConstraints() which simply returns the set of constraints. I
see no encapsulation issue in doing so since there is no method
available to modify contents of a ConstraintSet which will be
returned.
Satisfied takes in the canAdd parameters in order to check the
conditions whilst keeping the code simple.
Farihatanjin added a commit to Farihatanjin/JetUML that referenced this issue Feb 25, 2021
Farihatanjin added a commit to Farihatanjin/JetUML that referenced this issue Mar 6, 2021
Farihatanjin added a commit to Farihatanjin/JetUML that referenced this issue Mar 6, 2021
Farihatanjin added a commit to Farihatanjin/JetUML that referenced this issue Mar 6, 2021
This reverts commit 724e450.
Farihatanjin added a commit to Farihatanjin/JetUML that referenced this issue Mar 6, 2021
This reverts commit 619eaff.
Farihatanjin added a commit to Farihatanjin/JetUML that referenced this issue Mar 6, 2021
`ConstraintSet` is now stored as a private static final field in each
diagram builder. This reduces object creation by eliminating the need to
create and merge new `ConstraintSet` objects each time `canAdd` is
called. For this reason, I removed the `merge` method in `ConstraintSet`
which is no longer necessary.
The `ConstraintSet` field can be accessed by method
`getEdgeConstraints()` which simply returns the set of constraints. I
see no encapsulation issue in doing so since there is no method
available to modify contents of a `ConstraintSet` which will be
returned.
 `Satisfied` takes in the `canAdd` parameters in order to check the
conditions whilst keeping the code simple.
Farihatanjin added a commit to Farihatanjin/JetUML that referenced this issue Mar 6, 2021
ConstraintSet is now stored as a private static final field in each
diagram builder. This reduces object creation by eliminating the need to
create and merge new ConstraintSet objects each time canAdd is
called. For this reason, I removed the `merge` method in ConstraintSet
which is no longer necessary.
The ConstraintSet field can be accessed by method
getEdgeConstraints() which simply returns the set of constraints. I
see no encapsulation issue in doing so since there is no method
available to modify contents of a ConstraintSet which will be
returned.
Satisfied takes in the canAdd parameters in order to check the
conditions whilst keeping the code simple.
Farihatanjin added a commit to Farihatanjin/JetUML that referenced this issue Mar 6, 2021
Farihatanjin added a commit to Farihatanjin/JetUML that referenced this issue Mar 6, 2021
This reverts commit 724e450.
Farihatanjin added a commit to Farihatanjin/JetUML that referenced this issue Mar 8, 2021
ConstraintSet is now stored as a private static final field in each
diagram builder. This reduces object creation by eliminating the need to
create and merge new ConstraintSet objects each time canAdd is
called. For this reason, I removed the `merge` method in ConstraintSet
which is no longer necessary.
The ConstraintSet field can be accessed by method
getEdgeConstraints() which simply returns the set of constraints. I
see no encapsulation issue in doing so since there is no method
available to modify contents of a ConstraintSet which will be
returned.
Satisfied takes in the canAdd parameters in order to check the
conditions while keeping the code simple.
Farihatanjin added a commit to Farihatanjin/JetUML that referenced this issue Mar 8, 2021
Farihatanjin added a commit to Farihatanjin/JetUML that referenced this issue Mar 8, 2021
yingjie-xu pushed a commit to yingjie-xu/JetUML that referenced this issue Mar 9, 2021
When a user attempts to create a constructor call, they use the normal
"CallEdge" creation tool from the tool bar. This design decision was to
avoid forcing the user to use two very similar tools to create call and
constructor edges. However, internally if a constructor call is created,
a ConstructorEdge must be used, so it's necessary to convert the
original CallEdge to a Constructor Edge. This was initially done in the
DiagramCanvasController, leading to a special case and coupling with the
SequenceDiagram Builder. To avoid this design weakness, the conversion
from CallEdge to ConstructorEdge is moved to the SequenceDiagramBuilder.
yingjie-xu pushed a commit to yingjie-xu/JetUML that referenced this issue Mar 9, 2021
The case where trying to create a constructor edge was implemented as a
special case in constraints, where the constraint was only added to the
constraint set if the call could be a legal constructor call. This
divergence from the design, where all constraints are stored in a set,
was creating an obstacle to the future improvement of the constraint
management. With this change, all constraints are implemented as
predicates.
yingjie-xu pushed a commit to yingjie-xu/JetUML that referenced this issue Mar 9, 2021
prmr pushed a commit that referenced this issue Mar 9, 2021
ConstraintSet is now stored as a private static final field in each
diagram builder. This reduces object creation by eliminating the need to
create and merge new ConstraintSet objects each time canAdd is
called. For this reason, I removed the `merge` method in ConstraintSet
which is no longer necessary.
The ConstraintSet field can be accessed by method
getEdgeConstraints() which simply returns the set of constraints. I
see no encapsulation issue in doing so since there is no method
available to modify contents of a ConstraintSet which will be
returned.
Satisfied takes in the canAdd parameters in order to check the
conditions while keeping the code simple.
prmr pushed a commit that referenced this issue Mar 9, 2021
prmr pushed a commit that referenced this issue Mar 9, 2021
prmr added a commit that referenced this issue Mar 9, 2021
prmr added a commit that referenced this issue Mar 9, 2021
@prmr prmr closed this as completed Mar 9, 2021
louib pushed a commit to louib/JetUML that referenced this issue Aug 15, 2021
When a user attempts to create a constructor call, they use the normal
"CallEdge" creation tool from the tool bar. This design decision was to
avoid forcing the user to use two very similar tools to create call and
constructor edges. However, internally if a constructor call is created,
a ConstructorEdge must be used, so it's necessary to convert the
original CallEdge to a Constructor Edge. This was initially done in the
DiagramCanvasController, leading to a special case and coupling with the
SequenceDiagram Builder. To avoid this design weakness, the conversion
from CallEdge to ConstructorEdge is moved to the SequenceDiagramBuilder.
louib pushed a commit to louib/JetUML that referenced this issue Aug 15, 2021
The case where trying to create a constructor edge was implemented as a
special case in constraints, where the constraint was only added to the
constraint set if the call could be a legal constructor call. This
divergence from the design, where all constraints are stored in a set,
was creating an obstacle to the future improvement of the constraint
management. With this change, all constraints are implemented as
predicates.
louib pushed a commit to louib/JetUML that referenced this issue Aug 15, 2021
louib pushed a commit to louib/JetUML that referenced this issue Aug 15, 2021
ConstraintSet is now stored as a private static final field in each
diagram builder. This reduces object creation by eliminating the need to
create and merge new ConstraintSet objects each time canAdd is
called. For this reason, I removed the `merge` method in ConstraintSet
which is no longer necessary.
The ConstraintSet field can be accessed by method
getEdgeConstraints() which simply returns the set of constraints. I
see no encapsulation issue in doing so since there is no method
available to modify contents of a ConstraintSet which will be
returned.
Satisfied takes in the canAdd parameters in order to check the
conditions while keeping the code simple.
louib pushed a commit to louib/JetUML that referenced this issue Aug 15, 2021
louib pushed a commit to louib/JetUML that referenced this issue Aug 15, 2021
louib pushed a commit to louib/JetUML that referenced this issue Aug 15, 2021
louib pushed a commit to louib/JetUML that referenced this issue Aug 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
main Issues with the main code base refactoring A proposal to refector or generally improve the code
Projects
None yet
Development

No branches or pull requests

1 participant