Home Java • Download Functional Programming for Java Developers by Dean Wampler PDF

Download Functional Programming for Java Developers by Dean Wampler PDF

By Dean Wampler

Software improvement at the present time is embracing useful programming (FP), no matter if it's for writing concurrent courses or for handling enormous facts. the place does that go away Java builders? This concise booklet bargains a practical, approachable creation to FP for Java builders or somebody who makes use of an object-oriented language.

Dean Wampler, Java specialist and writer of Programming Scala (O'Reilly), indicates you ways to use FP ideas corresponding to immutability, avoidance of side-effects, and higher-order features for your Java code. each one bankruptcy offers workouts that will help you perform what you've discovered. when you take hold of some great benefits of sensible programming, you’ll realize that it improves all the code you write.
* research easy FP ideas and observe them to object-oriented programming
* become aware of how FP is extra concise and modular than OOP
* Get priceless FP classes in your Java variety design—such as fending off nulls
* layout info buildings and algorithms utilizing practical programming ideas
* Write concurrent courses utilizing the Actor version and software program transactional reminiscence
* Use sensible libraries and frameworks for Java—and study the place to head subsequent to deepen your sensible programming talents

Show description

Read or Download Functional Programming for Java Developers PDF

Similar java books

Java For Dummies

Begin construction strong courses with Java 6—fast!

Get an summary of Java 6 and start construction your individual programs
Even if you're new to Java programming—or to programming in general—you can wake up and operating in this wildly renowned language in a rush. This booklet makes it effortless! From the way to set up and run Java to figuring out sessions and gadgets and juggling values with arrays and collections, you'll get up to the mark at the new positive aspects of Java 6 in no time.

Discover how to
* Use object-oriented programming
* paintings with the alterations in Java 6 and JDK 6
* keep time through reusing code
* combine Java and Javascript with the hot scripting tools
* Troubleshoot code difficulties and attach insects

Java in a Nutshell (6th Edition)

The newest variation of Java in a Nutshell is designed to assist skilled Java programmers get the main out of Java 7 and eight, yet it’s additionally a studying direction for brand new builders. Chock filled with examples that display tips on how to take entire benefit of sleek Java APIs and improvement most sensible practices, the 1st component to this completely up to date booklet presents a fast paced, no-fluff creation to the Java programming language and the center runtime points of the Java platform.

Practical JIRA Administration

If youre conversant in JIRA for factor monitoring, malicious program monitoring, and different makes use of, you recognize it could actually occasionally be tough to establish and deal with. during this concise ebook, software program toolsmith Matt Doar solutions tricky and frequently-asked questions about JIRA management, and indicates you ways JIRA is meant for use.

Liferay 6.x Portal Enterprise Intranets Cookbook

Over 60 hands-on recipes that will help you successfully create complicated and hugely custom-made company intranet strategies with Liferay Portal 6. x CE approximately This BookLearn how you can use Liferay Portal to create a completely practical intranet firm with a transparent constitution and database of all departments and staff of your companySave a while and funds via taking regulate of your information, files, and company processesPacked with step by step, real-world examples that can assist you with the deploy, deployment, and configuration of Liferay and that can assist you run robust instruments to your staff or clientsWho This e-book Is ForIf you're a Java developer or administrator with a technical heritage and wish to put in and configure Liferay Portal as an company intranet, this can be the publication for you.

Additional resources for Functional Programming for Java Developers

Example text

Furthermore, Java’s type safety won’t let you “forget” that an option is returned. You must determine if a Some was returned and extract the value before calling methods with it, or handle the None case. Using Option as a return type improves the robustness of your code compared to allowing nulls and it provides better documentation for users of the code. We are expressing and enforcing the optional availability of a value through the type system. Algebraic Data Types and Abstract Data Types In the previous discussion the Option interface has only two valid implementing types: Some and None.

So, its hasValue always returns true and its get method simply returns the value. It also provides conventional toString, equals, and hashCode methods. I’ll explain why Some is declared final in the next section. Finally, here is None, the only other valid subtype of Option: package option; public final class None extends Option { public static class NoneHasNoValue extends RuntimeException {} 18 | Chapter 2: What Is Functional Programming? class) ? false : true; } } @Override public int hashCode() { return -1; } A None instance is used when the Option has no value.

Designing Types | 21 One final point on algebraic data types. Recall that Some and None are final and can’t be subtyped. Final types are often considered bad in Java, because you can’t subclass them to create special versions for testing. That’s really only a problem for types with strong dependencies on other objects that would make testing difficult, like networked services. Well-designed algebraic data types should never have such connections, so there is really nothing that would need to be replaced by a test-only derivative.

Download PDF sample

Rated 4.14 of 5 – based on 17 votes
In Java