SPF-OST / pytrnsys_gui

Graphical user interface for pytrnsys
https://pytrnsys.readthedocs.io
GNU Lesser General Public License v3.0
3 stars 4 forks source link

Refactor connection base #453

Closed ahobeost closed 1 year ago

ahobeost commented 1 year ago

Using polymorphism to minimize code duplication and ease debugging and developing of connections

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
1.9% 1.9% Duplication

zuckerruebe commented 1 year ago

Can we rebase this off master after having merged https://github.com/SPF-OST/pytrnsys_gui/pull/451?

zuckerruebe commented 1 year ago

I like it!

Some things to discuss:

  1. Use enums instead of strings?
  2. Why have the additional indirection of segmentItemCreator?
  3. Maybe take everything a step further to get to an interface of the sort:
    def getCorners(inputPortCoordinates: Tuple[float, float], outputPortCoordinates: Tuple[float, float]) -> Sequence[Tuple[float, float]]: ...
  4. Does the implementation make sure connections don't go through components? Did it before? To do that the signature in 3. would have to change probably.