All Projects → c-guntur → paneer-tikka-masala

c-guntur / paneer-tikka-masala

Licence: MIT license
A Code Kata using a cooking recipe to make an Indian curry, Paneer Tikka Masala (grilled and marinated cottage cheese in a tomato and cream gravy).

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to paneer-tikka-masala

ownNoteEditor
JavaFX editor for the ownNote files locally stored in ownCloud folder
Stars: ✭ 25 (+25%)
Mutual labels:  java15
scattersphere
Job Coordination API for Tasks
Stars: ✭ 30 (+50%)
Mutual labels:  completablefuture-api
java-handles-kata
Java Reflection and Unsafe Alternates - MethodHandle and VarHandle API - Fix broken tests in a Code Kata
Stars: ✭ 15 (-25%)
Mutual labels:  codekata
modern-java-demos
Modern Java: From Java 8 to Java 18. 现代Java案例大全/《Java核心编程》源码
Stars: ✭ 98 (+390%)
Mutual labels:  java15
completable-future-example
Example project comparing Java's CompletableFuture and Future implementations
Stars: ✭ 32 (+60%)
Mutual labels:  completablefuture
futures-extra
Java library for working with Guava futures
Stars: ✭ 131 (+555%)
Mutual labels:  completablefuture-api
Jacoco
🔬 Java Code Coverage Library
Stars: ✭ 3,041 (+15105%)
Mutual labels:  java15

Java CompletableFuture : A Cooking Recipe Kata

badge
Figure 1. build
Duke with Paneer Tikka Masala

java.util.concurrent.CompletableFuture is a versatile utility in Java (since Java 8). It provides a means of task execution, both synchronous and asynchronous.

A CompletableFuture implements java.util.concurrent.Future (available since Java 5) and java.util.concurrent.CompletionStage (available since Java 8) and adds additional methods for operating on tasks.

Some additional documentation about the three in this kata:

What is a Code-Kata

A code-kata is a coding exercise that builds muscle memory by a practice of programming to arrive at a known solution.

How does one go about with this code kata?

The essence of the exercise (presentation material and code kata) is to demonstrate the usage patterns for CompletableFuture.

This set of code katas rely on fixing broken code. There may be multiple ways to solve the broken code, the intent is to learn and experiment. There is a driving main class and there are recipe parts, which need to be fixed.

The project contains several java classes that fail to cook our recipe. A recipe mindmap to prepare Paneer Tikka Masala is included below.

Recipe

Here are simple steps to use this kata

  1. Checkout the code from a terminal/command prompt.

  2. Setup the project in your IDE.

    • IntelliJ: Launch your IDE and point to the pom.xml to be opened as a project.

    • Eclipse: Import Existing Maven Projects.

    • Netbeans: Open Project, then run mvn verify.

    • Any other IDE: Ensure that the src/main/java, src/kata/java and src/solution/java are on the source path.

  3. Run the main class PaneerTikkaMasala.

  4. None of the cooking recipe parts will print out on your console.

  5. Fix the broken/empty sections of code using the TODO and HINT comments.

  6. Repeat above steps until all recipe parts are printed.

  7. Check the solutions to see if there are other ways to solve. (Remember, the solution may be less performant than yours)

  8. Rinse and repeat (delete and checkout again, then back to Step 1) to build muscle memory.

Order of solving

Start in the following oder to fix the broken code or add code where empty. Follow the TODOs and HINTs. Your IDE should list out all TODOs.

  1. Part1CheckIngredients - Checks for the ingredients for the recipe.

  2. Part2aMakePaneerTikka - How to make the Paneer Tikka (cottage cheese roast).

  3. Part2bMakeMasala - How to make the Masala (pureed/spiced gravy).

  4. Part3Cooking - How to cook the Paneer Tikka and the Masala, then garnish.

  5. PaneerTikkaMasala - Plays the role of a chef and orchestrates the entire cooking.

Mission

Your mission, should you choose to accept it, will be to fix the recipe. This message will self-destruct in* NaN minutes

Requirements

How to prepare for coding along

This kata is developed as a Java maven project. Ensure that you have:

  1. Apache Maven 3.6.x or above. Tested with Apache Maven 3.6.3. Link: https://maven.apache.org/download.cgi

  2. JDK 11 or above. Tested with OpenJDK 15. Link: http://jdk.java.net/15/

  3. Your favorite Java IDE. IntelliJ IDEA Ultimate was used to develop this kata.

Project Structure

|____IDE                    <----- Contains Run Configurations and Live Templates for IntelliJ
|____pom.xml                <----- The POM for running maven commands
|____README.adoc            <----- This file
|____assets                 <----- Images and docs linked above
|____src
| |____main
| | |____resources
| | |____java
| | | |____none
| | | | |____cgutils
| | | | | |____recipe
| | | | | | |____paneer
| | | | | | | |____tikka    <----- Common classes shared by Kata and Solution portions
| |____kata
| | |____java
| | | |____none
| | | | |____cgutils
| | | | | |____recipe
| | | | | | |____paneer
| | | | | | | |____tikka    <----- The broken recipe code, that needs to be fixed
| |____solution
| | |____java
| | | |____none
| | | | |____cgutils
| | | | | |____recipe
| | | | | | |____paneer
| | | | | | | |____tikka    <----- Solutions
| |____test
| | |____java
| | | |____none
| | | | |____cgutils
| | | | | |____recipe
| | | | | | |____paneer
| | | | | | | |____tikka    <----- Some tests for utilities used in this project

Take Away

The key take-away from this kata is a solid understanding of the Java CompletableFuture API.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].