The Well-Grounded Java Developer, Second Edition
Understanding Java from the JVM up gives you a solid foundation to grow your expertise and take on advanced techniques for performance, concurrency, containerization, and more.

In The Well-Grounded Java Developer, Second Edition you will learn:

The new Java module system and why you should use it
Bytecode for the JVM, including operations and classloading
Performance tuning the JVM
Working with Java’s built-in concurrency and expanded options
Programming in Kotlin and Clojure on the JVM
Maximizing the benefits from your build/CI tooling with Maven and Gradle
Running the JVM in containers
Planning for future JVM releases

The Well-Grounded Java Developer, Second Edition introduces both the modern innovations and timeless fundamentals you need to know to become a Java master. Authors Ben Evans, Martijn Verburg, and Jason Clark distill their decades of experience as Java Champions, veteran developers, and key contributors to the Java ecosystem into this clear and practical guide. You’ll discover how Java works under the hood and learn design secrets from Java’s long history. Each concept is illustrated with hands-on examples, including a fully modularized application/library and creating your own multithreaded application.

Foreword by Heinz Kabutz.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

About the technology
Java is the beating heart of enterprise software engineering. Developers who really know Java can expect easy job hunting and interesting work. Written by experts with years of boots-on-the-ground experience, this book upgrades your Java skills. It dives into powerful features like modules and concurrency models and even reveals some of Java’s deep secrets.

About the book
With The Well-Grounded Java Developer, Second Edition you will go beyond feature descriptions and learn how Java operates at the bytecode level. Master high-value techniques for concurrency and performance optimization, along with must-know practices for build, test, and deployment. You’ll even look at alternate JVM languages like Kotlin and Clojure. Digest this book and stand out from the pack.

What's inside

The new Java module system
Performance tuning the JVM
Maximizing CI/CD with Maven and Gradle
Running the JVM in containers
Planning for future JVM releases

About the reader
For intermediate Java developers.

About the author
Benjamin J. Evans is a senior principal engineer at Red Hat. Martijn Verburg is the principal SWE manager for Microsoft’s Java Engineering Group. Both Benjamin and Martijn are Java Champions. Jason Clark is a principal engineer and architect at New Relic.

Table of Contents
PART 1 - FROM 8 TO 11 AND BEYOND!
1 Introducing modern Java
2 Java modules
3 Java 17
PART 2 - UNDER THE HOOD
4 Class files and bytecode
5 Java concurrency fundamentals
6 JDK concurrency libraries
7 Understanding Java performance
PART 3 - NON-JAVA LANGUAGES ON THE JVM
8 Alternative JVM languages
9 Kotlin
10 Clojure: A different view of programming
PART 4 - BUILD AND DEPLOYMENT
11 Building with Gradle and Maven
12 Running Java in containers
13 Testing fundamentals
14 Testing beyond JUnit
PART 5 - JAVA FRONTIERS
15 Advanced functional programming
16 Advanced concurrent programming
17 Modern internals
18 Future Java
1140556647
The Well-Grounded Java Developer, Second Edition
Understanding Java from the JVM up gives you a solid foundation to grow your expertise and take on advanced techniques for performance, concurrency, containerization, and more.

In The Well-Grounded Java Developer, Second Edition you will learn:

The new Java module system and why you should use it
Bytecode for the JVM, including operations and classloading
Performance tuning the JVM
Working with Java’s built-in concurrency and expanded options
Programming in Kotlin and Clojure on the JVM
Maximizing the benefits from your build/CI tooling with Maven and Gradle
Running the JVM in containers
Planning for future JVM releases

The Well-Grounded Java Developer, Second Edition introduces both the modern innovations and timeless fundamentals you need to know to become a Java master. Authors Ben Evans, Martijn Verburg, and Jason Clark distill their decades of experience as Java Champions, veteran developers, and key contributors to the Java ecosystem into this clear and practical guide. You’ll discover how Java works under the hood and learn design secrets from Java’s long history. Each concept is illustrated with hands-on examples, including a fully modularized application/library and creating your own multithreaded application.

Foreword by Heinz Kabutz.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

About the technology
Java is the beating heart of enterprise software engineering. Developers who really know Java can expect easy job hunting and interesting work. Written by experts with years of boots-on-the-ground experience, this book upgrades your Java skills. It dives into powerful features like modules and concurrency models and even reveals some of Java’s deep secrets.

About the book
With The Well-Grounded Java Developer, Second Edition you will go beyond feature descriptions and learn how Java operates at the bytecode level. Master high-value techniques for concurrency and performance optimization, along with must-know practices for build, test, and deployment. You’ll even look at alternate JVM languages like Kotlin and Clojure. Digest this book and stand out from the pack.

What's inside

The new Java module system
Performance tuning the JVM
Maximizing CI/CD with Maven and Gradle
Running the JVM in containers
Planning for future JVM releases

About the reader
For intermediate Java developers.

About the author
Benjamin J. Evans is a senior principal engineer at Red Hat. Martijn Verburg is the principal SWE manager for Microsoft’s Java Engineering Group. Both Benjamin and Martijn are Java Champions. Jason Clark is a principal engineer and architect at New Relic.

Table of Contents
PART 1 - FROM 8 TO 11 AND BEYOND!
1 Introducing modern Java
2 Java modules
3 Java 17
PART 2 - UNDER THE HOOD
4 Class files and bytecode
5 Java concurrency fundamentals
6 JDK concurrency libraries
7 Understanding Java performance
PART 3 - NON-JAVA LANGUAGES ON THE JVM
8 Alternative JVM languages
9 Kotlin
10 Clojure: A different view of programming
PART 4 - BUILD AND DEPLOYMENT
11 Building with Gradle and Maven
12 Running Java in containers
13 Testing fundamentals
14 Testing beyond JUnit
PART 5 - JAVA FRONTIERS
15 Advanced functional programming
16 Advanced concurrent programming
17 Modern internals
18 Future Java
69.99 In Stock
The Well-Grounded Java Developer, Second Edition

The Well-Grounded Java Developer, Second Edition

The Well-Grounded Java Developer, Second Edition

The Well-Grounded Java Developer, Second Edition

Paperback(2nd ed.)

$69.99 
  • SHIP THIS ITEM
    In stock. Ships in 1-2 days.
  • PICK UP IN STORE

    Your local store may have stock of this item.

Related collections and offers


Overview

Understanding Java from the JVM up gives you a solid foundation to grow your expertise and take on advanced techniques for performance, concurrency, containerization, and more.

In The Well-Grounded Java Developer, Second Edition you will learn:

The new Java module system and why you should use it
Bytecode for the JVM, including operations and classloading
Performance tuning the JVM
Working with Java’s built-in concurrency and expanded options
Programming in Kotlin and Clojure on the JVM
Maximizing the benefits from your build/CI tooling with Maven and Gradle
Running the JVM in containers
Planning for future JVM releases

The Well-Grounded Java Developer, Second Edition introduces both the modern innovations and timeless fundamentals you need to know to become a Java master. Authors Ben Evans, Martijn Verburg, and Jason Clark distill their decades of experience as Java Champions, veteran developers, and key contributors to the Java ecosystem into this clear and practical guide. You’ll discover how Java works under the hood and learn design secrets from Java’s long history. Each concept is illustrated with hands-on examples, including a fully modularized application/library and creating your own multithreaded application.

Foreword by Heinz Kabutz.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

About the technology
Java is the beating heart of enterprise software engineering. Developers who really know Java can expect easy job hunting and interesting work. Written by experts with years of boots-on-the-ground experience, this book upgrades your Java skills. It dives into powerful features like modules and concurrency models and even reveals some of Java’s deep secrets.

About the book
With The Well-Grounded Java Developer, Second Edition you will go beyond feature descriptions and learn how Java operates at the bytecode level. Master high-value techniques for concurrency and performance optimization, along with must-know practices for build, test, and deployment. You’ll even look at alternate JVM languages like Kotlin and Clojure. Digest this book and stand out from the pack.

What's inside

The new Java module system
Performance tuning the JVM
Maximizing CI/CD with Maven and Gradle
Running the JVM in containers
Planning for future JVM releases

About the reader
For intermediate Java developers.

About the author
Benjamin J. Evans is a senior principal engineer at Red Hat. Martijn Verburg is the principal SWE manager for Microsoft’s Java Engineering Group. Both Benjamin and Martijn are Java Champions. Jason Clark is a principal engineer and architect at New Relic.

Table of Contents
PART 1 - FROM 8 TO 11 AND BEYOND!
1 Introducing modern Java
2 Java modules
3 Java 17
PART 2 - UNDER THE HOOD
4 Class files and bytecode
5 Java concurrency fundamentals
6 JDK concurrency libraries
7 Understanding Java performance
PART 3 - NON-JAVA LANGUAGES ON THE JVM
8 Alternative JVM languages
9 Kotlin
10 Clojure: A different view of programming
PART 4 - BUILD AND DEPLOYMENT
11 Building with Gradle and Maven
12 Running Java in containers
13 Testing fundamentals
14 Testing beyond JUnit
PART 5 - JAVA FRONTIERS
15 Advanced functional programming
16 Advanced concurrent programming
17 Modern internals
18 Future Java

Product Details

ISBN-13: 9781617298875
Publisher: Manning
Publication date: 11/22/2022
Edition description: 2nd ed.
Pages: 704
Product dimensions: 7.38(w) x 9.25(h) x 1.60(d)

About the Author

Ben Evans is a principal engineer at New Relic, a Java Champion, and the Java/JVM track lead at InfoQ, as well as a frequent contributor to Oracle's Java Magazine, and a regular speaker at conferences worldwide. He co-founded the Adopt-a-JSR and AdoptOpenJDK initiatives, and served on the Java Community Process Executive Committee for 6 years. Ben has also authored Optimizing Java, Java in a Nutshell, 7th Edition, and Java: The Legend.

Martijn Verburg is the principal SWE group manager for the Java Engineering Group at Microsoft. He is the co-leader of the London Java User Group (LJC) where he co-founded AdoptOpenJDK, the world's leading (non-Oracle) OpenJDK distribution. He has been made a Java Champion in recognition for his contribution to the Java ecosystem.

Jason Clark is a principal engineer and architect at New Relic, and was previously an architect at WebMD. A regular conference speaker, Jason contributes to the open-source project Shoes, aiming to make GUI programming easy and fun for beginners.

Table of Contents

Foreword xvii

Preface xix

Acknowledgements xxii

About this book xxiv

About the authors xxviii

About the cover illustration xxx

Part 1 From 8 to 11 and Beyond! 1

1 Introducing modern Java 3

1.1 The language and the platform 4

1.2 The new Java release model 6

1.3 Enhanced type inference (var keyword) 9

1.4 Changing the language and the platform 13

Sprinkling some sugar 14

Changing the language 14

JSRs and JEPs 15

Incubating and preview features 15

1.5 Small changes in Java 11 17

Collections factories (JEP 213) 17

Remove enterprise modules (JEP 320) 18

HTTP/2 (Java 11) 19

Single-file source-code programs (JEP 330) 24

2 Java modules 26

2.1 Setting the scene 27

Project Jigsaw 28

The module graph 31

Protecting the internals 32

New access control semantics 33

2.2 Basic modules syntax 34

Exporting and requiring 36

Transitivity 37

2.3 Loading modules 37

Platform modules 38

Application modules 39

Automatic modules 39

Unnamed module 40

2.4 Building a first modular app 40

Command-line switches for modules 41

Executing a modular app 43

Modules and reflection 45

2.5 Architecting for modules 46

Split packages 47

Java 8 Compact Profiles 47

Multi-release JARs 49

2.6 Beyond modules 52

3 Java 17 55

3.1 Text Blocks 55

3.2 Switch Expressions 57

3.3 Records 60

Nominal typing 66

Compact record constructors 67

3.4 Sealed Types 69

3.5 New form of instanceof 74

3.6 Pattern Matching and preview features 75

Part 2 Under the hood 79

4 Class files and bytecode 81

4.1 Class loading and class objects 82

Loading and linking 83

8 Class objects 85

4.2 Class loaders 86

Custom class loading 88

Modules and class loading 95

4.3 Examining class files 95

Introducing javap 96

Internal form for method signatures 96

The constant pool 98

4.4 Bytecode 101

Disassembling a class 101

The runtime environment 103

Introduction to opcodes 105

Load and store opcodes 106

Arithmetic opcodes 107

Execution flow control opcodes 108

Invocation opcodes 109

Platform operation opcodes 112

Shortcut opcode forms 112

4.5 Reflection 113

Introducing reflection 114

Combining class loading and reflection 116

Problems with reflection 117

5 Java concurrency fundamentals 119

5.1 Concurrency theory primer 120

But I already know about Thread 120

Hardware 121

Amdahl's law 121

Explaining Java's threading model 123

Lessons learned 124

5.2 Design concepts 124

Safety and concurrent type safety 125

Liveness 126

Performance 126

Reusability 126

How and why do the forces conflict? 127

Sources of overhead 127

5.3 Block-structured concurrency (pre-Java 5) 128

Synchronization and locks 128

The state model for a thread 130

Fully synchronized objects 131

Deadlocks 132

Why synchronized? 135

The volatile keyword 137

Thread states and methods 137

Immutability 144

5.4 The Java Memory Model (JMM) 147

5.5 Understanding concurrency through bytecode 149

Lost Update 151

Synchronization in bytecode 153

Synchronized methods 157

Unsynchronized reads 158

Deadlock revisited 160

Deadlock resolved, revisited 162

Volatile access 166

6 JDK concurrency libraries 169

6.1 Building blocks for modern concurrent applications 169

6.2 Atomic classes 170

6.3 Lock classes 172

Condition objects 173

6.4 CountDownLatch 174

6.5 ConcurrentHashMap 176

Understanding a simplified HashMap 176

Limitations of Dictionary 179

Approaches to a concurrent Dictionary 180

Using ConcurrentHashMap 182

6.6 CopyOnWriteArrayList 185

6.7 Blocking queues 188

Using BlockingQueue APIs 194

Using Work-Unit 196

6.8 Futures 197

CompletableFuture 198

6.9 Tasks and execution 200

Modeling tasks 200

Executors 202

Single-threaded executor 203

Fixed-thread pool 204

Cached thread pool 205

ScheduledThreadPoolExecutor 205

7 Understanding Java performance 207

7.1 Performance terminology: Some basic definitions 209

Latency 210

Throughput 210

Utilization 210

Efficiency 211

Capacity 211

Scalability 211

Degradation 211

7.2 A pragmatic approach to performance analysis 212

Know what you re measuring 212

Know how to take measurements 213

Know what your performance goals are 214

Know when to stop 215

Know the cost of achieving higher performance 215

Know the dangers of premature optimization 216

7.3 What went wrong? Why do we have to care? 217

Moore's law 217

Understanding the memory latency hierarchy 219

7.4 Why is Java performance tuning hard? 220

The role of time in performance tuning 221

H Understanding cache misses 222

7.5 Garbage collection 224

Basics 225

Mark and sweep 225

Areas of memory 227

Young collections 228

Full collections 228

Safepoints 228

G1: Java's default collector 229

The Parallel collector 231

GC configuration parameters 232

7.6 JIT compilation with HotSpot 233

Why have dynamic compilation? 234

Introduction to HotSpot 235

Mining methods 236

Dynamic compilation and monomorphic calls 236

Reading the compilation logs 237

Deoptimization 238

7.7 JDK Flight Recorder 238

Flight Recorder 239

Mission Control 240

Part 3 Non-Java languages on the JVM 249

8 Alternative JVM languages 251

8.1 Language zoology 252

Interpreted vs. compiled languages 252

Dynamic vs. static typing 253

Imperative vs. functional languages 254

Reimplementation vs. original 255

8.2 Polyglot programming on the JVM 256

Why use a non-Java language? 257

Up-and-coming languages 259

Languages we could have picked but didn't 260

8.3 How to choose a non-Java language for your project 262

Is the project area low-risk? 262

Does the language intemperate well with Java? 263

Is there good tooling and test support for the language? 264

How hard is the language to learn? 264

Are there lots of developers using this language? 264

8.4 How the JVM supports alternative languages 265

Performance 266

Runtime environments for non-Java languages 266

Compiler fictions 267

9 Kotlin 270

9.1 Why use Kotlin? 271

Installing 271

9.2 Convenience and conciseness 271

Starting with less 271

Variables 272

Equality 273

Functions 273

Collections 277

Express yourself 279

9.3 A different view of classes and objects 281

Data classes 286

9.4 Safety 287

Null safety 288

Smart casting 289

9.5 Concurrency 291

9.6 Java interoperability 294

10 Clojure: A different view of programming 299

10.1 Introducing Clojure 300

Hello World in Clojure 302

Getting started with the REPL 303

Making a mistake 305

Learning to love the brackets 308

10.2 Looking for Clojure: Syntax and semantics 309

Special forms bootcamp 309

Lists, vectors, maps, and sets 312

Arithmetic, equality, and other operations 315

Working with functions in Clojure 316

Loops in Clojure 319

Reader macros and dispatch 321

10.3 Functional programming and closures 323

10.4 Introducing Clojure sequences 325

Sequences and variable-arity functions 329

10.5 Interoperating between Clojure and Java 330

Calling Java from Clojure 331

The nature of Clojure calls 332

The Java type of Clojure values 332

Using Clojure proxies 333

Exploratory programming with the REPL 334

Using Clojure from Java 335

10.6 Macros 335

Part 4 Build and deployment 343

11 Building with Gradle and Maven 345

11.1 Why build tools matter for a well-grounded developer 345

Automating tedious operations 346

Managing dependencies 346

Ensuring consistency between developers 349

11.2 Maven 350

The build lifecycle 350

Commands/POM intro 351

Building 353

Controlling the manifest 354

Adding another language 355

Testing 357

Dependency management 360

Reviewing 364

Moving beyond Java 8 365

Multirelease JARs in Maven 366

Maven and modules 369

Authoring Maven plugins 372

11.3 Gradle 376

Installing Gradle 376

Tasks 377

What's in a script? 378

Using plugins 378

Building 379

Work avoidance 381

Dependencies in Gradle 382

Adding Kotlin 387

Testing 388

Automating static analysis 389

Moving beyond Java 8 390

Using Gradle with modules 391

Customizing 397

12 Running Java in containers 401

12.1 Why containers matter for a well-grounded developer 402

Host operating systems vs. virtual machines vs. containers 402

Benefits of containers 404

Drawbacks of containers 405

12.2 Docker fundamentals 406

Building Docker images 406

Running Docker containers 409

12.3 Developing Java applications with Docker 411

Selecting your base image 411

Building an image with Gradle 412

Running the build in Docker 414

Ports and hosts 416

Local development with Docker Compose 418

Debugging in Docker 421

Logging with Docker 423

12.4 Kubernetes 424

12.5 Observability and performance 432

Observability 432

Performance in containers 434

13 Testing fundamentals 437

13.1 Why we test 438

13.2 How we test 438

13.3 Test-driven development 441

TDD in a nutshell 442

A TDD example with a single use case 443

13.4 Test doubles 449

Dummy object 449

Stub object 451

Fake object 454

Mock object 456

Problems with mocking 457

13.5 From JUnit 4 to 5 459

14 Testing beyond JUnit 466

14.1 Integration testing with Testcontainers 466

Installing testcontainers 467

An example with Redis 467

Gathering container logs 471

An example with Postgres 472

An example for end-to-end testing with Selenium 474

14.2 Specification-style testing with Spek and Kotlin 476

14.3 Property-based testing with Clojure 481

Clojure.test 481

Clojure.spec 483

Test.check 487

Clojure.spec and test.check 492

Part 5 Java frontiers 495

15 Advanced functional programming 497

15.1 Introduction to functional programming concepts 498

Pure functions 498

Immutability 498

Higher-order junctions 499

Recursion 500

Closures 500

Laziness 501

Currying and partial application 502

15.2 Limitations of Java as a FP language 502

Pure functions 503

Mutability 503

Higher-order junctions 505

Recursion 506

Closures 509

Laziness 511

Currying and partial application 513

Java's type system and collections 514

15.3 Kotlin FP 515

Pure and higher-order junctions 516

Closures 517

Currying and partial application 518

Immutability 519

Tail recursion 522

Lazy evaluation 525

Sequences 526

15.4 Clojure FP 531

Comprehensions 531

Lazy sequences 532

Currying in Clojure 535

16 Advanced concurrent programming 537

16.1 The Fork/Join framework 538

A simple F/J example 539

Parallelizing problems for F/J 542

Work-stealing algorithms 543

16.2 Concurrency and functional programming 544

CompletableFuture revisited 544

Parallel streams 547

16.3 Under the hood with Kotlin coroutines 549

How coroutines work 549

Coroutine scoping and dispatching 554

16.4 Concurrent Clojure 557

Persistent data structures 557

Futures and pcalls 563

Software transactional memory 565

Agents 569

17 Modern internals 571

17.1 Introducing JVM internals: Method invocation 571

Invoking virtual methods 572

H Invoking interface methods 575

Invoking "special" methods 576

Final methods 578

17.2 Reflection internals 578

17.3 Method handles 583

MethodHandle 583

MethodType 584

Looking up method handles 585

Reflection vs. proxies vs. method handles 586

17.4 Invokedynamic 589

Implementing lambda expressions 591

17.5 Small internal changes 593

String concatenation 593

Compact strings 596

Nestmates 597

17.6 Unsafe 600

17.7 Replacing Unsafe with supported APIs 604

VarHandles 605

Hidden classes 607

18 Future Java 609

18.1 Project Amber 610

18.2 Project Panama 612

Foreign Function and Memory API 612

18.3 Project Loom 618

Virtual threads 621

Thread builders 622

Programming with virtual threads 623

When will Project Loom arrive? 625

18.4 Project Valhalla 626

Changing the language model 630

Consequences of value objects 630

Generics revisited 633

18.5 Java 18 633

Appendix A Selecting your Java 637

Appendix B Recap of streams in Java 8 640

Index 649

From the B&N Reads Blog

Customer Reviews