#677 add pattern Trampoline.#696
Conversation
|
Throttling test has failed. |
|
It is a known issue #643 |
iluwatar
left a comment
There was a problem hiding this comment.
- The project is missing from parent
pom.xml - The module build fails with Checkstyle errors
| it is possible to implement algorithms recursively in Java without blowing the stack | ||
| and to interleave the execution of functions without hard coding them together or even using threads. | ||
|
|
||
|
|
There was a problem hiding this comment.
Would it be possible to explain the pattern shortly in Explanation section? See https://github.com/iluwatar/java-design-patterns/wiki/02.-Pattern-template and some other patterns like http://java-design-patterns.com/patterns/decorator/ for examples.
| * [Trampolining: a practical guide for awesome Java Developers](https://medium.com/@johnmcclean/trampolining-a-practical-guide-for-awesome-java-developers-4b657d9c3076) | ||
| * [Trampoline in java ](http://mindprod.com/jgloss/trampoline.html) | ||
| * [cyclops-react](https://github.com/aol/cyclops-react) | ||
|
|
There was a problem hiding this comment.
Use Tutorials section for examples. Pattern descriptions can be in Credits.
| <version>1.16.18</version> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
|
|
There was a problem hiding this comment.
Using Lombok should be project level decision. We haven't used it elsewhere so please do not take it into use in one pattern.
| the key enabling mechanism is the fact that Trampoline.more is a lazy operation. | ||
| Trampoline in cyclops-react extends java.util.Supplier. Calling Trampoline.more we are basically creating | ||
| a Supplier that defers the actual recursive call, and having defered the call we can move it outside of the recursive loop. | ||
| This means we can define algorithms recursively in Java but execute them iteratively.*/ |
There was a problem hiding this comment.
Please refer to methods properly in Javadoc e.g. {@link package.class#member label}. What is cyclops-react?
There was a problem hiding this comment.
cyclops-react is a library for additions java8 streams.
done.
| Trampoline in cyclops-react extends java.util.Supplier. Calling Trampoline.more we are basically creating | ||
| a Supplier that defers the actual recursive call, and having defered the call we can move it outside of the recursive loop. | ||
| This means we can define algorithms recursively in Java but execute them iteratively. | ||
| */ |
There was a problem hiding this comment.
Please prefer <p> tag in Javadoc. See other patterns for examples. Please describe what the example does and how it implements the pattern.
| public class TrampolineAppTest { | ||
|
|
||
| @Test | ||
| public void test()throws IOException{ |
There was a problem hiding this comment.
Please use descriptive test method name? What does it test?
There was a problem hiding this comment.
Done. Changed to testTrampolineWithFactorialFunction
|
@besok please comment when you've implemented the changes. |
|
Ok. I am going to do it on holidays(20-21.01) |
How can i add this modula to parent pom? |
|
@iluwatar , can you check my changes? |
|
Well done @besok 👍 Thanks for the new pattern! |
Pull request title
Pull request description