Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Undo quick hack with JFS 2017 speaker data #67

Open
ascheman opened this issue Aug 14, 2017 · 0 comments
Open

Undo quick hack with JFS 2017 speaker data #67

ascheman opened this issue Aug 14, 2017 · 0 comments
Assignees
Labels
Milestone

Comments

@ascheman
Copy link
Member

Found a really ugly quick hack in the code. Took me 2 hours to fix and circumvent this. Nevertheless even my workaround is still a large code smell and should be refactored.

In general we should think about using more strong types, even in internal interfaces to avoid such problems in the future. And, of course, we should provide better (unit) tests and keep our abstractions clear!!!

The problem occured with speaker pictures in the SpeakerImageServiceImpl. For Heise conferences we have them available as a byte stream (and know the filename additionally). For DOAG (Formes) conferences, i.e., Java Forum Stuttgart 2017, we have the filename but treat it as the byte stream. So the code needed to detect this and extract the file contents by the file name given in the byte stream. Groovy enabled this by having methods with default arguments (the filename) which allowed to apply a single argument to the method call. Even if it was the filename it was treated as content. We could have prevented this by

  • using strong typed parameters
  • providing image data from the extractor component to the image service (image service should not even know about the repository details)

which we should both do in the future.

@ascheman ascheman added the bug label Aug 14, 2017
ascheman added a commit that referenced this issue Aug 14, 2017
It should not even know where to find the data of JFS 2017!!!
@ascheman ascheman removed their assignment Aug 14, 2017
@ascheman ascheman added this to the later milestone Feb 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants