Link Details

Link 1171053 thumbnail
User 225256 avatar

By mswatcher
Submitted: Jun 23 2014 / 10:12

In software, it's common to have operations that only make sense when an object is in a particular state. For example, in a guess-how-many-jelly-beans-are-in-the-jar contest, you're typically not allowed to guess the same number as someone else. Also, there can't be a winner if no one has guessed. So if you write a class to handle that sort of contest, you naturally end up with code checking for those conditions:
  • 3
  • 0
  • 63
  • 31

Add your comment

Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Upvoters (3)

Downvoters (0)

    Apache Hadoop
    Written by: Piotr Krewski
    Featured Refcardz: Top Refcardz:
    1. Play
    2. Akka
    3. Design Patterns
    4. OO JS
    5. Cont. Delivery
    1. Play
    2. Java Performance
    3. Akka
    4. REST
    5. Java