舉報

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