Diptonil / raging-coffee

I had too much coffee and decided to mirror my actions by writing too many programs in Java.
MIT License
19 stars 4 forks source link
java jenkins junit5 maven

Raging Coffee



Open in Gitpod


GitHub CI CodeQL


Table of Contents

Description

This project is geared towards the practical as well as theoretical exploration of the Java language in depth. Primarily, this is to serve as a checklist of my own knowledge in Java but since the best way to learn is to make something that others may learn from as well, this repository has been made public.
The project has dependencies that are managed by Maven (Gradle is not used here at all). The primary reason for this is to enable the inclusion of dependencies such as JDBC, JPA, Spring support tools, et cetera. So the only dependency needed is Maven.
This also deals with certain general problem solving and algorithmic programs as well as design patterns that is just for my own reference. Others are welcome to check those out as well, in any case. There are already more complete and better repositories out there that are more famous for the various implementations of algorithms using Java. This repository is more geared to focus on the nuances of the language in general, rather than recreate the same work.
Here is the link of the repository containing Java programs on algorithms.
Here is the link of the repository containing design patterns elucidated in an intuitive and resourceful manner by experienced and passionate engineers and academic experts.

(Top)

Running Regular Programs

Visual Studio Code with the extension Language Support for Java (TM) by Red Hat has been used (for Java development, no other extension is compulsorily needed). Sections for other IDEs such as IntelliJ or Eclipse shall be added if those environments bear certain feasilbility that deems their adoption over the present IDE.
The required dependencies (JDK 17 & Maven) have firstly been installed (unless using Docker).
Here are all the methods that can be used to run the programs:

  1. Visual Studio Code: Use this to run programs locally on this IDE.
    • From the directory in which the source file is stored:
      javac fileName.java
    • From exactly within the \src\main\java directory (the subdirectory name should be squeezed in only when it does indeed exist for any particular topic):
      java com.ragingcoffee.directoryName.<subdirectoryName>.fileName
  2. Gitpod: Use this to run programs on Cloud. No local cloning needed. Cannot be heavily personalised, though. The procedure to run programs is exactly the same as the procedure for Visual Studio Code (since it runs this IDE on the web).
  3. Docker: For running the programs without JDK and Maven (or any other dependency, for that matter), we just need to have Docker installed. It shall take care of the management of dependencies.
    • From the .devcontainer directory of this repository, run this to create an image:
      docker build -t "raging-coffee:latest" .
    • Now that the image has been created, we can make a container out of it (image is similar to a class, which is a template of how objects would work. Objects here can be said as the containers):
      docker container run -it test_container:latest
    • When the container is up and running, we can repeat the same steps to execute programs that we have been doing above.

(Top)

Running Spring projects

Java follows an extremely rigid and inflexible structure of their projects. This sometimes makes it difficult to club resources for a Java project in a way that would seem appropriate and easily accessible. The directory dedicated to spring contains projects built under the Spring Framework as well as explanations and 'how-to's. Since every Spring project has a preordained way to be run, we cannot do it from the external root directory of the repository.

Extra Additions

None of the dependencies mentioned below are a must for the project, except Maven to test (since it is purely educational and the programs are standalone, not a part of any application). Even these have been used for learning purposes (as well as making the project more accessible and standard) and their guides are in the furtherreading directory.

(Top)

Checklist

The list below is not to be followed in any particular order but is more of a record of what has been done and what is yet to be done.

(Top)

Tests

Incorporating tests in this repository for every program is a work in progress. Since this repo is more educational and exemplary, there are many classes that exist just to show the behaviour of certain in-built methods provided by the Java API. According to the rules of testing (as well as common sense), it is meaningless to test the use of the built-in API and is adviced against. This is why there would exist certain source files without any test files. For example, testing a program that uses the built-in sort that Java offers (Arrays.sort()) is meaningless and is not done.
To run tests, Maven may be used. The corresponding command for Maven:

mvn test

JUnit5 has been used to write tests for this project.

(Top)

Further Reading

Certain build tools and applications have been discussed here within the scope of their use in Java development. They may serve as a guide to understand how these tools integrate with Java, along with how they are used for development (this project is an example as well). These can be found under the furtherreading directory.

(Top)

Resources

For this project, the amalgamation of the following books are used:

(Top)

Recommended Resources

(Top)

Contributions

(Top)