You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.
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.
The text was updated successfully, but these errors were encountered:
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 bywhich we should both do in the future.
The text was updated successfully, but these errors were encountered: