Skip to content

Conversation

@salni84
Copy link

@salni84 salni84 commented Oct 20, 2020

  • Exceptions werden dort behandelt wo die Methoden aufgerufen werden. (getActualValue())
  • Alle anderen funktionalen Methoden sind frei von Fehlerhandling
  • Kommentare gelöscht
  • Und noch ein wenig refactoring ;-)

throw new ReadWriteException("Not possible to read protocol-type: " + protocol);
}

}catch (ParserConfigurationException | IOException | SAXException e) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

die exceptions sollten so lokal, d.h. so nahe am Erzeuger wie möglich, catched werden. das war vor deinen changes eher der fall ... :)
weil: Jetzt hast du in einer abstrakten Methode getActualValue sehr technische Exceptions-Catches drin, die stark von der Implementierung der einzelnen Protokolle abhängig sind. Das ist nicht gut (eine Form von "mixed levels of abstraction" Code Smell, oder auch Verletzung von information hiding).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants