Java Reference
In-Depth Information
Listing 1-6. Java 8 Lambda Implementation of cloneWithoutNulls(List)
public static <A> List<A> cloneWithoutNulls(final List<A> list) {
List<A> toReturn = new ArrayList<>(list);
toReturn.removeIf(it -> it == null);
return toReturn;
Listing 1-7. Example of Defining a Comparator of Java 8
Comparator c =
Java 8 Returns Java to the Forefront
Software development is exciting because its core problems have not been solved yet: the practices,
processes, and tools that go into software development are in a state of constant evolution and development.
We can see this in the way that the dominant programming paradigm has changed: in the late '80s and
through the '90s, the answer to every question was objects; now, programmers expect a wider palette with
which to express code.
Over the course of the last decade, programmers have begun borrowing more from a paradigm called
“functional programming.” Whereas an object-oriented paradigm thinks about objects, and objects have
behaviors, functional programming thinks in terms of verbs (functions), which act on nouns (arguments).
Whereas object-oriented programming builds up a mechanism of interacting objects, functional
programming builds up a function that is resolved through composite functions.
An object-oriented program can be thought of as a corporate environment. You have a CEO (the “Main
Class”), who issues high-level orders. Subordinates take up these orders. Although these subordinates
each have some of their own data (their own files on their computer and their own stickie notes on their
desk), these subordinates mostly delegate to their own subordinates. As you get farther down this chain, the
subordinates become more technical (implementation-specific), with the end of the chain performing the
last precise bit of work. Then the result of the action (either an exception or a return value) is communicated
back up through the chain of subordinates to the CEO, who may then issue another command.
Main Class
Query Data
Print Result
Map DB
Results to
Data Objects
Get DB
Print to
Standard Out
Query DB
Format Result
Search WWH ::

Custom Search