rockpaperscissors is a is a true object-oriented implementation of the famous Rock, Paper and Scissors game.
This application follows these four fundamental principles:
- not a single
null
(why NULL is bad?) - not a single
public
static
method (why they are bad?) - not a single mutable class (why they are bad?)
- not a single
instanceof
keyword, type casting, or reflection (why?)
If you want to know more about true object-oriented programming, I recommend these books:
- Elegant Objects (Volume 1) by Yegor Bugayenko
- Elegant Objects (Volume 2) by Yegor Bugayenko
- Object Thinking by David West
First, build it:
$ mvn clean package
Then, run:
$ java -jar target/rockpaperscissors-<version>-jar-with-dependencies.jar
Change for the version found in pom.xml
file.
The MIT License (MIT)
Copyright (c) 2017 Fabrício 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.