Kotlin for Enterprise Applications using Java EE
更新时间:2021-06-10 18:50:15
最新章节:Leave a review - let other readers know what you thinkcoverpage
Title Page
Foreword
Contributors
About the author
About the reviewers
Acknowledgements
About Packt
Why subscribe?
Packt.com
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used in the book
Get in touch
Reviews
Kotlin – A First look
Technical requirements
Introduction to Kotlin
The history of Kotlin
Features of Kotlin
Getting started with Kotlin
Installing Kotlin
Installing Kotlin on Linux
Installing Kotlin on Windows
Installing Kotlin on Mac
Compiling and running
A quick tour of Kotlin
Declaring variables
Data types in Kotlin
Warnings
Type inference
String templates
Multi-line String Literals
Expressions over statements
Functions
Default arguments
Named arguments
varargs and spread
The for loop
Iterating over a list
When clause
The nullable type
Lambda expressions in Kotlin
Extension functions
Classes in Kotlin
Constructors
Static functions
Kotlin programming style and Syntax
Summary
Kotlin – The Game Changer
Technical requirements
Why Kotlin is the game changer
Interoperability with Java
Functional paradigms
Immutability
Null safety
Kotlin versus Java
Null safety issue
Arrays in Kotlin are invariant
Extension functions
No checked exceptions
Functional paradigms
Concise code
Configuring Kotlin in the project
Creating a simple Kotlin project
Maven project
Configuring Kotlin in Eclipse
Working with coroutines
Coroutines in Kotlin
Using Kotlin with Java
Kotlin in an existing Java project
Java in a Kotlin project
Summary
An Overview of Java EE and Kotlin
Technical requirements
Overview of Java EE
New features and enhancements in Java EE 8
Introduction to the Java EE architecture
Integrating Kotlin plugins
The all-open compiler plugin
Using the all-open plugin in Maven
Using the all-open plugin in Gradle
No-arg compiler plugin
Using the no-org plugin in Maven
Using the no-org plugin in Gradle
The kotlin-spring compiler plugin
Using the kotlin-spring plugin in Maven
Using the kotlin-spring plugin in Gradle
Using the kotlin-spring plugin in CLI
JPA plugin
Using the kotlin-jpa plugin in Maven
Using the kotlin-jpa plugin in Gradle
Using the kotlin-jpa plugin in CLI
The SAM-with-receiver compiler plugin
Using the SAM-with-receiver plugin in Maven
Using the SAM-with-receiver plugin in Gradle
Using the SAM-with-receiver plugin in CLI
The Jackson plugin
Using the Jackson plugin in Maven
Using the Jackson plugin in Gradle
Kotlin and Servlets
Kotlin for server-side development
Servlets
The life cycle of a servlet
Creating a simple servlet application
Kotlin and EJB
An overview of EJBs
Advantages of EJBs
The EJB component model
Bean validation
Summary
Kotlin with JSF and CDI
Technical requirements
Introduction to JSF
JSF architecture
The Benefits of using JSF
Developing our first JSF application
Kotlin and CDI
The Difference between EJB and CDI-managed beans
Injecting the beans
Producers
Qualifiers
Scopes
CDI and domain events
Defining an event
Listening to the event
Firing the event
Interceptors
Interceptor
Implementing the interceptor
Building custom interceptors
Defining a custom interceptor
Enhancing the auditable interceptor
Activating the interceptor
Summary
Kotlin with JPA and EJB
Technical requirements
Kotlin Data Classes
Java Persistence API
JPA architecture
Bootstrapping the JPA
Mapping domain entities using JPA
Queries
Modeling JPA entities
Mapping entities
OneToMany mapping
Cascading
Fetching strategy
Naming a join column
ManyToOne mapping
Data sources
Persistence units
Persistence context
Transactions
Exception handling
Using JPA in an application
Summary
Enterprise Messaging with Kotlin
Technical requirements
Understanding the messaging domains
Messaging architecture
Messaging domains
Point-to-point messaging model
Publish-subscribe messaging model
Messaging queues and topics
Java messaging System
Installing GlassFish
Configuring GlassFish
Building a messaging service using Kotlin
Point-to-point messaging
Writing a producer class
A quick comparison to Java code
Writing a Consumer class
Writing a test case for the Point-to-point messaging model
Publish-subscribe model
Writing a Publisher class
Writing a Subscriber class
Writing a test case for the publish-subscribe model
Message acknowledgement
Transactions
Enabling transactions in the point-to-point messaging model
Enabling transactions in the publish-subscribe messaging model
Summary
Developing RESTful Services with JAX-RS
Technical requirements
Web services
Working model of the web service
RESTful web services
Understanding REST verbs
Resources
HTTP status codes
The 100 series
The 200 series
The 300 series
The 400 series
The 500 series
Introduction to JAX-RS
JAX-RS annotations
Implementing a RESTful service using Jersey
Implementing Real-World RESTful Web Services
Defining the layers
Writing a POST function for a create operation
Invoking the create organization API using cURL
Writing a GET function for a read operation
Invoking the get organization API using cURL
Summary
Securing JAVA EE Applications with Kotlin
Technical requirements
Introduction to security API
The IdentityStore mechanism
EmbeddedIdentityStoreDefinition
DatabaseIdentityStoreDefinition
LdapIdentityStoreDefinition
HttpAuthenticationMechanism
BasicAuthenticationMechanismDefinition
FormAuthenticationMechanismDefinition
Custom form-based HTTP authentication
The SecurityContext API
Implementing security API using Kotlin
Securing JAX-RS APIs with JWT
The structure of JWT
Header
Payload
Signature
Implementing JWT
Summary
Implementing Microservices with Kotlin
Technical requirements
Introduction to microservices
Advantages of microservices
Breaking the monolith into microservices
Microservices architecture (MSA)
Developing real-world microservices
Developing the microservices
Developing the authentication service
Implementing the /authorize/jwt/token API
Implementing the /authorize/jwt/verify-token API
Developing the identity service
The flow diagram
Exception handling
Writing test code for microservices
Unit testing
Writing the skeleton for the test class
Setting up the test data
Mocking the response
Writing the assertions
Integration testing
Writing a REST client for the POST /authorize/jwt/token API
Writing a REST client for the /identity/organization/{orgId} API
Writing the assertions
Refactoring the integration test cases
Summary
Performance Monitoring and Logging
Technical requirements
Finding Memory Leaks
Application monitoring
Java Mission Control
Java VisualVM
Garbage collection
Memory model
Types of garbage collector
Serial and parallel collectors
Concurrent collectors
Tuning the GC
High throughput and low latency
High throughput and low footprint
Low pause time and small footprint
Profiling
Profiling with JProfiler
Offline profiling
Getting our real-world application production-ready
Summary
Design Patterns with Kotlin
Technical requirements
Design patterns
Advantages of design patterns
Categorizing design patterns
Creational patterns
Structural patterns
Behavioral patterns
Implementing the singleton pattern
Writing a singleton class in Java
Writing the test case for a singleton
Lazy initialization
Singleton implementation in comparison to Kotlin
Implementing the factory pattern
Implementing the builder pattern
Implementing the decorator pattern
Writing the code for the decorator pattern
Adding decorators
Implementing the observer pattern
Illustrating the observer pattern
Implementing the chain of responsibility pattern
Illustrating the chain-of-responsibility pattern
Defining the contracts
Writing the implementation
Defining the concrete handlers
Verifying the handler implementation
Selecting design patterns
Summary
Other Books You May Enjoy
Leave a review - let other readers know what you think
更新时间:2021-06-10 18:50:15