Skip to content
  • Andrés G. Aragoneses's avatar
    Playlists: (refactoring) more progress towards immutability · e4b14cc3
    Andrés G. Aragoneses authored
    PlaylistParser.Parse() was mutable (the result of its execution was
    available at one of the properties of its instance. This can be
    avoided by making Parse() static, and return the result instead
    of just a bool indicating its success (from now on, a null value
    returned means a failure to parse).
    
    To do this, the PlaylistParser class has to be split in two:
    - static class PlaylistParser
    - DTO class ParsedPlaylist
    
    This doesn't only make the code safer, it allows me to remove
    the lock{} inside Parse() method, and makes everything a bit
    more readable and maintainable.
    e4b14cc3