case-study
Java implementation of shopping cart case study
Content
- Run
- UML class diagram
- Applied Design Patterns
- Pipeline Definitions
- Used Tools, Frameworks, Libraries etc.
Run
Using Maven
Make sure you have maven installed on your system.
git clone https://github.com/akadir/case-study.git
cd case-study
mvn package -DskipTests
java -jar target/case-study.jar
Using Docker
Pull the latest image from docker-hub and then run it.
docker pull akarakoc/case-study:1.0
docker run akarakoc/case-study:1.0
UML class diagram
Applied Design Patterns
- Chain of Responsibility: To validate products added into cart. This pattern, makes it easy to extend and re-configure validation phase. CartEventValidator
- Strategy Pattern: Delivery cost calculation algorithms can changed in time frequently. Using this pattern makes it easy to adapt this algorithm changes. DeliveryStrategy
- Null Object Pattern: In the initial phase of the ShoppingCart DeliveryStrategy is not set yet. This may lead to a NullPointerException. To prevent this from occurring, None DeliveryStrategy is implemented.
Pipeline Definitions
All action logs can be seen from this link and action definitions are in this folder
-
Every push that contains change in specific folders and/or files triggers two actions, build, and code quality.
- Build Action builds source code on 3 different Operating Systems[Ubuntu, MacOS, Windows] using 3 different java versions[8, 11, 14].
-
Every tagged push event triggers the docker workflow and this workflow builds artifacts then push the docker image to the docker hub
Developed with the Help of
- IntelliJ IDEA - Development environment
- maven - Build automation and dependency management tool.
- logback - Logging library that implements SLF4J API
- mockito - Testing framework to mock objects.
- AssertJ - Rich and easy to use test assertion library
- Docker - Containerisation tool
- SonarCloud - Online Code Quality & Security service
- GitHub Actions - Software workflow automation tool
- gitignore.io - Utility website to generate .gitignore files