My Account Log in

3 options

Design patterns and best practices in Java : a comprehensive guide to building smart and reusable code in Java / Kamalmeet Singh, Adrian Ianculescu, Lucian-Paul Torje.

EBSCOhost Academic eBook Collection (North America) Available online

View online

Ebook Central Academic Complete Available online

View online

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Singh, Kamalmeet, author.
Ianculescu, Adrian, author.
Torje, Lucian-Paul, author.
Language:
English
Subjects (All):
Java (Computer program language).
Physical Description:
1 online resource (272 pages)
Edition:
1st edition
Place of Publication:
Birmingham : Packt, [2018]
System Details:
text file
Biography/History:
Singh Kamalmeet: Kamalmeet Singh got his first taste of programming at the age of 15, and he immediately fell in love with it. After spending over 14 years in the IT Industry, Kamal has matured into an ace developer and a technical architect. He is also the coauthor of a book on Design Patterns and Best Practices in Java. The technologies he works with range from cloud computing, machine learning, augmented reality, serverless applications to microservices and so on. Ianculescu Adrian: Adrian Ianculescu is a software developer with 20 years programming experience, of which 12 years were in Java, starting with C++, then working with C#, and moving naturally to Java. Working in teams ranging from 2 to 40, he realized that making software is not only about writing code and became interested in software design and architecture, in different methodologies and frameworks. After living the corporate life for a while, he started to work as a freelancer and entrepreneur following his childhood passion to make games. Torje Lucian-Paul: Lucian-Paul Torje is an aspiring software craftsman working in software industry for almost 15 years. He is interested in almost anything that has to do with technology. This is why he has worked with everything from MS-DOS TSR to microservices, from Atmel microcontrollers to Android, iOS and Chromebooks, from C/C++ to Java, and from Oracle to MongoDB. Whenever someone is needed to use new and innovative approaches to solve a problem, he is keen to give it a go!
Summary:
Create various design patterns to master the art of solving problems using Java About This Book This book demonstrates the shift from OOP to functional programming and covers reactive and functional patterns in a clear and step-by-step manner All the design patterns come with a practical use case as part of the explanation, which will improve your productivity Tackle all kinds of performance-related issues and streamline your development Who This Book Is For This book is for those who are familiar with Java development and want to be in the driver's seat when it comes to modern development techniques. Basic OOP Java programming experience and elementary familiarity with Java is expected. What You Will Learn Understand the OOP and FP paradigms Explore the traditional Java design patterns Get to know the new functional features of Java See how design patterns are changed and affected by the new features Discover what reactive programming is and why is it the natural augmentation of FP Work with reactive design patterns and find the best ways to solve common problems using them See the latest trends in architecture and the shift from MVC to serverless applications Use best practices when working with the new features In Detail Having a knowledge of design patterns enables you, as a developer, to improve your code base, promote code reuse, and make the architecture more robust. As languages evolve, new features take time to fully understand before they are adopted en masse. The mission of this book is to ease the adoption of the latest trends and provide good practices for programmers. We focus on showing you the practical aspects of smarter coding in Java. We'll start off by going over object-oriented (OOP) and functional programming (FP) paradigms, moving on to describe the most frequently used design patterns in their classical format and explain how Java's functional programming features are changing them. You will learn to enhance implementations by mixing OOP and FP, and finally get to know about the reactive programming model, where FP and OOP are used in conjunction with a view to writing better code. Gradually, the book will show you the latest trends in architecture, moving from MVC to microservices and serverless architecture. We will finish off by highlighting the new Java features and best practices. By the end of the book, you will be able to efficiently address common problems faced while developing applications and be comfortable w...
Contents:
Intro
Title Page
Copyright and Credits
Packt Upsell
Contributors
Table of Contents
Preface
Chapter 1: From Object-Oriented to Functional Programming
Java - an introduction
Java programming paradigms
Imperative programming
Real-life imperative example
Object-oriented paradigm
Objects and classes
Encapsulation
Abstraction
Inheritance
Polymorphism
Declarative programming
Functional programming
Working with collections versus working with streams
An introduction to Unified Modeling Language
Class relations
Generalization
Realization
Dependency
Association
Aggregation
Composition
Design patterns and principles
Single responsibility principle
Open/closed principle
Liskov Substitution Principle
Interface Segregation Principle
Dependency inversion principle
Summary
Chapter 2: Creational Patterns
Singleton pattern
Synchronized singletons
Synchronized singleton with double-checked locking mechanism
Lock-free thread-safe singleton
Early and lazy loading
The factory pattern
Simple factory pattern
Static factory
Simple factory with class registration using reflection
Simple factory with class registration using Product.newInstance
Factory method pattern
Anonymous concrete factory
Abstract factory
Simple factory versus factory method versus abstract factory
Builder pattern
Car builder example
Simplified builder pattern
Anonymous builders with method chaining
Prototype pattern
Shallow clone versus deep clone
Object pool pattern
Chapter 3: Behavioral Patterns
The chain-of-responsibility pattern
Intent
Implementation
Applicability and examples
The command pattern
The interpreter pattern
Intent.
Implementation
The iterator pattern
The observer pattern
The mediator pattern
The memento pattern
Applicability
The state pattern
The strategy pattern
The template method pattern
The null object pattern
The visitor pattern
Chapter 4: Structural Patterns
Adapter pattern
Examples
Proxy pattern
Decorator pattern
Bridge pattern
Composite pattern
Façade pattern
Flyweight pattern
Chapter 5: Functional Patterns
Introducing functional programming
Lambda expressions
Pure functions
Referential transparency
First-class functions
Higher-order functions
Currying
Closure
Immutability
Functors
Applicatives
Monads
Introducing functional programming in Java
Streams
Stream creator operations
Stream intermediate operations
Stream terminal operations
Re-implementing OOP design patterns
Singleton
Builder
Adapter
Decorator
Chain of responsibility
Command
Interpreter
Iterator
Observer
Strategy
Template method
Functional design patterns
MapReduce
Loan pattern
Tail call optimization
Memoization
Examples.
The execute around method
Chapter 6: Let's Get Reactive
What is reactive programming?
Introduction to RxJava
Installing the RxJava framework
Maven installation
JShell installation
Observables, Flowables, Observers, and Subscriptions
Creating Observables
The create operator
The defer operator
The empty operator
The from operator
The interval operator
The timer operator
The range operator
The repeat operator
Transforming Observables
The subscribe operator
The buffer operator
The flatMap operator
The groupBy operator
The map operator
The scan operator
The window operator
Filtering Observables
The debounce operator
The distinct operator
The elementAt operator
The filter operator
The first/last operator
The sample operator
The skip operator
The take operator
Combining Observables
The combine operator
The join operator
The merge operator
The zip operator
Error handling
The catch operator
The do operator
The using operator
The retry operator
Schedulers
Subjects
Example project
Chapter 7: Reactive Design Patterns
Patterns for responsiveness
Request-response pattern
Asynchronous-communication pattern
Caching pattern
Fan-out and quickest-reply pattern
Fail-fast pattern
Patterns for resilience
The circuit-breaker pattern
Failure-handling pattern
Bounded-queue pattern
Monitoring patterns
Bulkhead pattern
Patterns for elasticity
Single responsibility pattern
Stateless-services pattern
Autoscaling pattern
Self-containment pattern
Patterns for message-driven implementation
Event-driven communication pattern
Publisher-subscriber pattern
Idempotency pattern
Chapter 8: Trends in Application Architecture.
What is application architecture?
Layered architecture
Layered architecture with an example
Tiers versus layers
What does layered architecture guarantee?
What are the challenges with layered architecture?
Model View Controller architecture
MVC architecture with an example
A more contemporary MVC implementation
What does MVC architecture guarantee?
What are the challenges with MVC architecture?
Service-oriented architecture
Service-oriented architecture with an example
Web services
SOAP versus REST
Enterprise service bus
What does service-oriented architecture guarantee?
What are the challenges with service-oriented architecture?
Microservices-based Architecture
Microservice architecture with an example
Communicating among services
What does microservices-based architecture guarantee?
What are challenges with microservices-based architecture?
Serverless architecture
Serverless architecture with an example
Independence from infrastructure planning
What does serverless architecture guarantee?
What are the challenges with serverless architecture?
Chapter 9: Best Practices in Java
A brief history of Java
Features of Java 5
Features of Java 8
Currently supported versions of Java
Best practices and new features of Java 9
Java platform module system
JShell
Private methods in interfaces
Enhancements in streams
Creating immutable collections
Method addition in arrays
Additions to the Optional class
New HTTP client
Some more additions to Java 9
Best practices and new features of Java 10
Local variable type inference
copyOf method for collections
Parallelization of full garbage collection
Some more additions to Java 10
What should be expected in Java 11?
Other Books You May Enjoy
Index.
Notes:
Description based on print version record.
ISBN:
9781786469014
1786469014
OCLC:
1043621647

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

Find

Home Release notes

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Find catalog Using Articles+ Using your account