Skip to content

The Cookie Jar Challenge: How do we model / handle application state?

License

Notifications You must be signed in to change notification settings

joyheron/cookie-jar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Cookie Jar Challenge

Handling application state is difficult. Different languages and paradigms have different ways for managing state. In this challenge, I would like to use a simple example and see how different people implement the state handling.

The Example: A cookie jar

A cookie jar

The cookie jar is an entity whose state changes over time: sometimes someone takes a cookie out of the jar, sometimes someone adds cookies to the jar. Is it possible for someone to take cookies out of the jar at the same time? Who knows?

The cookie jar can be empty, but there can never be a negative number of cookies...

The Usual Suspects

Cookie Monster

If cookie monster gets ahold of the cookie jar, he will eat a lot of cookies. Maybe all of them, but probably more than one. Silly Cookie Monster.

Kitten

Kitten likes cookies, but she's a bit more conscious of her figure, so she's likely to only eat one cookie.

Grandma

We all love grandma! She doesn't like to eat cookies, but she's always adding cookies to the jar. After all, you look a bit too skinny!

The Implementations

Do you have an example? Let me know!

License

Copyright © 2017 Joy Clark

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

The Cookie Jar Challenge: How do we model / handle application state?

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published