Vasiliy Zukanov
Aug 23, 2017 · 1 min read

Articles like this one make me want to give Kotlin a try. Good job!

One question: why hook into the parsing process and add various converters, instead of adding getXXX methods in Article class that take care of post-conditions?

For example (Java equivalent):

public VideoType getVideoType() {    return this.videoType == null ? VideoType.unknown : videoType;}

This way, all post-conditions related to articles will be bundled inside Article class instead of being scattered in different places. IMHO, this approach is better for modeling and more maintainable.

Am I missing something?

)
    Vasiliy Zukanov

    Written by

    Software development consultant, freelance developer and blogger at www.techyourchance.com.

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade