⚛ Learn SOLID principles by examples
This is a repository intended to serve as illustrative examples for the course "Principios SOLID Aplicados" (Spanish).
- Install Java 8:
brew cask install corretto8
- Set it as your default JVM:
export JAVA_HOME='/Library/Java/JavaVirtualMachines/amazon-corretto-8.jdk/Contents/Home'
- Clone this repository:
git clone https://github.com/CodelyTV/java-solid-examples
. - Execute some Gradle lifecycle tasks in order to check everything is OK:
- Create the project JAR:
make build
- Run the tests and plugins verification tasks:
make test
- Create the project JAR:
- Start playing around with the different examples of each SOLID principle. You have explanations here and in the test code 🙂
- Gradle (current version: 5.6 - releases):
./gradlew wrapper --gradle-version=5.6 --distribution-type=bin
or modifying the gradle-wrapper.properties - JUnit (current version: 5.5.1 - releases):
build.gradle:11
- Package:
tv.codely.solid_principles.liskov_substitution_principle
- Production code
- Tests code with explanations
- Package:
tv.codely.solid_principles.dependency_inversion_principle
- Production code
- Tests code with explanations
This hopefully helpful examples have been implemented by CodelyTV and contributors.
Pull Requests are welcome. We would suggest oppening an issue before actually coding your Pull Request in order to ask for feedback 🙂
The MIT License (MIT). Please see License for more information.