/rockpaperscissors

A true OO implementation of the rock, paper and scissors game

Primary LanguageJavaMIT LicenseMIT

rockpaperscissors

EO principles respected here We recommend IntelliJ IDEA

Build Status License

rockpaperscissors is a is a true object-oriented implementation of the famous Rock, Paper and Scissors game.

What does true object-oriented means?

This application follows these four fundamental principles:

  • No null (why?)
  • No code in constructors (why?)
  • No getters and setters (why?)
  • No mutable objects (why?)
  • No static methods, not even private ones (why?)
  • No instanceof, type casting, or reflection (why?)
  • No implementation inheritance (why?)
  • No public methods without @Override
  • No statements in test methods except assertThat (why?)

If you want to know more about true object-oriented programming, I recommend these books:

How use it?

First, build it:

$ mvn clean package

Then, run:

$ java -jar target/rockpaperscissors-VERSION-jar-with-dependencies.jar

Change VERSION for the version found in pom.xml file.

License

The MIT License (MIT)

Copyright (C) 2017-2018 Fabricio Barros Cabral

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.