Skip to content

Conversation

@cstrap
Copy link

@cstrap cstrap commented Jul 22, 2014

With the enum type we'll return to java6, maybe it could be a project constraint using java6 instead other java version.
I don't like switch/case, but it seems pretty readable than if/else.

@arialdomartini
Copy link
Contributor

@giancosta86, you were the one who made the switch to Java 7, you decide ;)

@arialdomartini arialdomartini changed the title Java6 compatible introducing an enum for response type Proposal #1 - Java6 compatible introducing an enum for response type Jul 22, 2014
@giancosta86
Copy link
Contributor

Generally speaking, I'm always in favor of upgrading to the very latest stable version of Java, but it's true that a version constraint might exist in a production environment - it's up to us all to choose whether to apply such constraint or not in this case. ^__^
As for the enum, it seems a nice way of using the elegance of the switch statement without breaking the interface of the service...
The idea of having a translation layer to decouple the domain from the service seems nice and fosters Protected Variations, but should such responsibility be given to the class itself? Perhaps, we might introduce another class performing the translation...

@arialdomartini arialdomartini changed the title Proposal #1 - Java6 compatible introducing an enum for response type Solution #1 - Java6 compatible introducing an enum for response type Jul 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants