舉報

會員
Learn Kotlin Programming(Second Edition)
Kotlinisageneral-purposeprogramminglanguageusedfordevelopingcross-platformapplications.CompletewithacomprehensiveintroductionandprojectscoveringthefullsetofKotlinprogrammingfeatures,thisbookwilltakeyouthroughthefundamentalsofKotlinandgetyouuptospeedinnotime.LearnKotlinProgrammingcoverstheinstallation,tools,andhowtowritebasicprogramsinKotlin.You'lllearnhowtoimplementobject-orientedprogramminginKotlinandeasilyreuseyourprogramorpartsofit.ThebookexplainsDSLconstruction,serialization,nullsafetyaspects,andtypeparameterizationtohelpyoubuildrobustapps.You'lllearnhowtodestructureexpressionsandwriteyourown.You'llthengettogripswithbuildingscalableappsbyexploringadvancedtopicssuchastesting,concurrency,microservices,coroutines,andKotlinDSLbuilders.Furthermore,you'llbeintroducedtothekotlinx.serializationframework,whichisusedtopersistobjectsinJSON,Protobuf,andotherformats.Bytheendofthisbook,you'llbewellversedwithallthenewfeaturesinKotlinandwillbeabletobuildrobustapplicationsskillfully.
最新章節
- Leave a review - let other readers know what you think
- Other Books You May Enjoy
- Summary
- Rules
- Annotations
- Protobuf serialization and deserialization
品牌:中圖公司
上架時間:2021-06-24 12:17:05
出版社:Packt Publishing
本書數字版權由中圖公司提供,并由其授權上海閱文信息技術有限公司制作發行
- Leave a review - let other readers know what you think 更新時間:2021-06-24 14:14:22
- Other Books You May Enjoy
- Summary
- Rules
- Annotations
- Protobuf serialization and deserialization
- How it works
- Json serialization and deserialization
- Setup
- Kotlin Serialization
- Summary
- Using callbacks with coroutines
- Blocking IO with coroutines
- Concurrent HTTP requests
- Coroutines in action
- Debugging coroutines
- Using select for deferred
- Using select for channels
- select expression
- Ticker channels
- Conflated channels
- Producers
- Closing a channel
- Rendezvous channels
- Channels
- Application of Coroutines
- Summary
- Error handling
- With context
- Wrapping Java executors
- Dispatcher inheritance
- Coroutine dispatchers
- Async
- Supervisor scope
- Failure in a child coroutine
- Cancellation or failure in a parent
- Cancellation and failure
- Global scope
- Context and scope
- Job state
- Join
- Cancellation
- Jobs
- Parent-child relationship
- Nested coroutines
- Structured concurrency
- runBlocking Builder
- Launch builder
- Coroutine builders
- Suspending functions
- Coroutines
- Summary
- Futures
- Non-blocking I/O and asynchronous programming
- CyclicBarrier
- CountDownLatch
- Atomic variables
- A blocking queue
- ConcurrentHashMap
- Concurrent collections
- he bounded buffer problem
- Semaphores
- Read-write locks
- Locks
- Monitors
- Race conditions
- Executors
- The Dining Philosophers Problem
- Deadlocks and livelocks
- CPU-bound versus I/O-bound
- Thread interrupts
- Stopping a thread
- Creating a thread
- Blocking
- Threads
- Concurrency
- Section 3: Advanced Concepts in Kotlin
- Summary
- Implementing a Lagom service
- Defining services
- Lagom
- Why microservices?
- Drawbacks
- Definition
- Microservices with Kotlin
- Summary
- Resources
- One instance
- Tags
- Conditions
- Config
- Tags conditions and config
- Testing non-deterministic code
- Table-driven testing
- A custom generator
- Specifying a generator
- Property testing
- Project config
- The spec interceptor
- The test case interceptor
- Interceptors
- Inspectors
- Custom matchers
- Combining matchers
- Expecting exceptions
- Floating point matchers
- Collection matchers
- String matchers
- Matchers
- Choosing a spec
- Getting started
- Testing in Kotlin
- Summary
- Sequences
- Indexed access
- Read-only views
- Sets
- Maps
- Lists
- Arrays
- Class hierarchy
- Collections
- Summary
- Limitations
- Data class definition rules
- Destructing types
- Destructed declarations
- The hashCode and equals methods generated for you
- toString out of the box
- The copy method
- Automatic creation of getters and setters
- Introduction to data classes
- Data Classes
- Summary
- Algebraic data types
- Recursive type bounds
- Type reification
- Type erasure
- Type projection
- Nothing type
- Variance overview
- Contravariance
- Covariant return
- Covariance
- Invariance
- Type variance
- Multiple bounds
- Upper bounds
- Bounded polymorphism
- Parameterized types
- Parameterized functions
- Generics
- Summary
- Runtime annotation discovery
- @JvmOverloads
- @Throws
- @JvmStatic
- @JvmName
- Standard annotations
- Annotation parameters
- Annotations
- Declared and undeclared
- Invoking a function reflectively
- Reflective functions and properties
- Useful KClass properties
- Objects and companions
- Instantiation with callBy
- Constructors
- Instantiation using reflection
- KClass
- Reflection
- Using an Optional
- Creating and returning an Optional
- Optional
- Safe casting
- Elvis operator
- Force operator
- Safe null access
- Smart cast
- Nullable types
- Null Safety Reflection and Annotations
- Summary
- Properties or methods?
- A non-null property delegate
- Observables
- Lateinit versus lazy
- Lazy initializations
- Delegated properties
- Late initialization
- Visibility
- Overriding getters and setters
- Why use properties?
- Properties
- Summary
- Validation and error accumulation
- Using function receivers in a DSL
- Infix functions as keywords
- Custom DSLs
- Further projection functions
- Projection
- Fold
- Either
- Type alias
- Implementing memoization
- Memoization
- Adding currying support
- Currying in action
- Currying and partial application
- Noinline
- Inline functions
- Function composition
- Bytecode
- Functions in the JVM
- Function-literal receivers
- Bound references
- Member and extension function references
- Top-level function references
- Function references
- Anonymous functions
- Closures
- Assigning a function
- Returning a function
- Higher-order functions
- Higher-Order Functions and Functional Programming
- Summary
- Checked exceptions
- Erasure naming
- Object and static methods
- Default parameters
- Top-level functions
- Kotlin from Java
- Java void methods
- Escaping Kotlin identifiers
- Single abstract methods
- Getters and setters
- Java from Kotlin
- Pure functions
- Generic functions
- Require/assert/check
- Repeat
- Use
- Lazy
- Run
- With
- Let
- Apply
- Standard library functions
- Spread operator
- Varargs
- Tail recursive functions
- Function literals
- Java interop
- Assignment
- Comparison
- Invoke
- Get/set
- in/contains
- Basic operators
- Operator overloading
- Operators
- Infix functions
- Multiple return values
- Companion object extensions
- Overriding member extension functions
- Member extension functions
- Extension functions on null values
- Extension function precedence
- Extension functions
- Default parameters
- Named parameters
- Top-level functions
- Local functions
- Member functions
- Single expression functions
- Defining functions
- Functions in Kotlin
- Section 2: Practical Concepts in Kotlin
- Summary
- Sealed classes
- Class delegation
- Inheritance versus composition
- Overriding rules
- Polymorphism
- Interface or abstract classes
- Abstract classes
- Visibility modifiers
- Inheritance
- Interfaces
- Static methods and companion objects
- Enum classes
- Inline classes
- Data classes
- Nested classes
- Access levels
- Classes
- Object-Oriented Programming in Kotlin
- Summary
- Limitations
- Contracts on method invocation
- Contracts on a function return value
- Contracts API
- Code contracts
- Type hierarchy
- Function return
- The when without argument
- When (value)
- The when expression
- Explicit casting
- Smart casts
- The null syntax
- Control flow as expressions
- Internal
- Protected
- Private
- Visibility modifiers
- Scope
- This expression
- Referential equality and structural equality
- Instantiating classes
- Exception handling
- Loops
- Ranges
- String templates
- Import renaming
- Wildcard imports
- Imports
- Packages
- Comments
- Arrays
- Strings
- Chars
- Booleans
- Unsigned integers
- Numbers
- Basic types in Kotlin
- Type inference
- val and var
- Kotlin Basics
- Summary
- Mixing Kotlin and Java in a project
- Eclipse and Kotlin
- IntelliJ and Kotlin
- Kotlin with Maven
- Kotlin with Gradle
- Kotlin for scripting
- The REPL
- Kotlin runtime
- Using the command line to compile and run Kotlin code
- Technical requirements
- Getting Started with Kotlin
- Section 1: Fundamental Concepts in Kotlin
- Reviews
- Get in touch
- Conventions used
- Download the color images
- Download the example code files
- To get the most out of this book
- What this book covers
- Who this book is for
- Preface
- Packt is searching for authors like you
- About the reviewers
- About the authors
- Contributors
- Packt.com
- Why subscribe?
- About Packt
- Learn Kotlin Programming Second Edition
- Copyright and Credits
- Title Page
- coverpage
- coverpage
- Title Page
- Copyright and Credits
- Learn Kotlin Programming Second Edition
- About Packt
- Why subscribe?
- Packt.com
- Contributors
- About the authors
- About the reviewers
- Packt is searching for authors like you
- Preface
- Who this book is for
- What this book covers
- To get the most out of this book
- Download the example code files
- Download the color images
- Conventions used
- Get in touch
- Reviews
- Section 1: Fundamental Concepts in Kotlin
- Getting Started with Kotlin
- Technical requirements
- Using the command line to compile and run Kotlin code
- Kotlin runtime
- The REPL
- Kotlin for scripting
- Kotlin with Gradle
- Kotlin with Maven
- IntelliJ and Kotlin
- Eclipse and Kotlin
- Mixing Kotlin and Java in a project
- Summary
- Kotlin Basics
- val and var
- Type inference
- Basic types in Kotlin
- Numbers
- Unsigned integers
- Booleans
- Chars
- Strings
- Arrays
- Comments
- Packages
- Imports
- Wildcard imports
- Import renaming
- String templates
- Ranges
- Loops
- Exception handling
- Instantiating classes
- Referential equality and structural equality
- This expression
- Scope
- Visibility modifiers
- Private
- Protected
- Internal
- Control flow as expressions
- The null syntax
- Smart casts
- Explicit casting
- The when expression
- When (value)
- The when without argument
- Function return
- Type hierarchy
- Code contracts
- Contracts API
- Contracts on a function return value
- Contracts on method invocation
- Limitations
- Summary
- Object-Oriented Programming in Kotlin
- Classes
- Access levels
- Nested classes
- Data classes
- Inline classes
- Enum classes
- Static methods and companion objects
- Interfaces
- Inheritance
- Visibility modifiers
- Abstract classes
- Interface or abstract classes
- Polymorphism
- Overriding rules
- Inheritance versus composition
- Class delegation
- Sealed classes
- Summary
- Section 2: Practical Concepts in Kotlin
- Functions in Kotlin
- Defining functions
- Single expression functions
- Member functions
- Local functions
- Top-level functions
- Named parameters
- Default parameters
- Extension functions
- Extension function precedence
- Extension functions on null values
- Member extension functions
- Overriding member extension functions
- Companion object extensions
- Multiple return values
- Infix functions
- Operators
- Operator overloading
- Basic operators
- in/contains
- Get/set
- Invoke
- Comparison
- Assignment
- Java interop
- Function literals
- Tail recursive functions
- Varargs
- Spread operator
- Standard library functions
- Apply
- Let
- With
- Run
- Lazy
- Use
- Repeat
- Require/assert/check
- Generic functions
- Pure functions
- Java from Kotlin
- Getters and setters
- Single abstract methods
- Escaping Kotlin identifiers
- Java void methods
- Kotlin from Java
- Top-level functions
- Default parameters
- Object and static methods
- Erasure naming
- Checked exceptions
- Summary
- Higher-Order Functions and Functional Programming
- Higher-order functions
- Returning a function
- Assigning a function
- Closures
- Anonymous functions
- Function references
- Top-level function references
- Member and extension function references
- Bound references
- Function-literal receivers
- Functions in the JVM
- Bytecode
- Function composition
- Inline functions
- Noinline
- Currying and partial application
- Currying in action
- Adding currying support
- Memoization
- Implementing memoization
- Type alias
- Either
- Fold
- Projection
- Further projection functions
- Custom DSLs
- Infix functions as keywords
- Using function receivers in a DSL
- Validation and error accumulation
- Summary
- Properties
- Why use properties?
- Overriding getters and setters
- Visibility
- Late initialization
- Delegated properties
- Lazy initializations
- Lateinit versus lazy
- Observables
- A non-null property delegate
- Properties or methods?
- Summary
- Null Safety Reflection and Annotations
- Nullable types
- Smart cast
- Safe null access
- Force operator
- Elvis operator
- Safe casting
- Optional
- Creating and returning an Optional
- Using an Optional
- Reflection
- KClass
- Instantiation using reflection
- Constructors
- Instantiation with callBy
- Objects and companions
- Useful KClass properties
- Reflective functions and properties
- Invoking a function reflectively
- Declared and undeclared
- Annotations
- Annotation parameters
- Standard annotations
- @JvmName
- @JvmStatic
- @Throws
- @JvmOverloads
- Runtime annotation discovery
- Summary
- Generics
- Parameterized functions
- Parameterized types
- Bounded polymorphism
- Upper bounds
- Multiple bounds
- Type variance
- Invariance
- Covariance
- Covariant return
- Contravariance
- Variance overview
- Nothing type
- Type projection
- Type erasure
- Type reification
- Recursive type bounds
- Algebraic data types
- Summary
- Data Classes
- Introduction to data classes
- Automatic creation of getters and setters
- The copy method
- toString out of the box
- The hashCode and equals methods generated for you
- Destructed declarations
- Destructing types
- Data class definition rules
- Limitations
- Summary
- Collections
- Class hierarchy
- Arrays
- Lists
- Maps
- Sets
- Read-only views
- Indexed access
- Sequences
- Summary
- Testing in Kotlin
- Getting started
- Choosing a spec
- Matchers
- String matchers
- Collection matchers
- Floating point matchers
- Expecting exceptions
- Combining matchers
- Custom matchers
- Inspectors
- Interceptors
- The test case interceptor
- The spec interceptor
- Project config
- Property testing
- Specifying a generator
- A custom generator
- Table-driven testing
- Testing non-deterministic code
- Tags conditions and config
- Config
- Conditions
- Tags
- One instance
- Resources
- Summary
- Microservices with Kotlin
- Definition
- Drawbacks
- Why microservices?
- Lagom
- Defining services
- Implementing a Lagom service
- Summary
- Section 3: Advanced Concepts in Kotlin
- Concurrency
- Threads
- Blocking
- Creating a thread
- Stopping a thread
- Thread interrupts
- CPU-bound versus I/O-bound
- Deadlocks and livelocks
- The Dining Philosophers Problem
- Executors
- Race conditions
- Monitors
- Locks
- Read-write locks
- Semaphores
- he bounded buffer problem
- Concurrent collections
- ConcurrentHashMap
- A blocking queue
- Atomic variables
- CountDownLatch
- CyclicBarrier
- Non-blocking I/O and asynchronous programming
- Futures
- Summary
- Coroutines
- Suspending functions
- Coroutine builders
- Launch builder
- runBlocking Builder
- Structured concurrency
- Nested coroutines
- Parent-child relationship
- Jobs
- Cancellation
- Join
- Job state
- Context and scope
- Global scope
- Cancellation and failure
- Cancellation or failure in a parent
- Failure in a child coroutine
- Supervisor scope
- Async
- Coroutine dispatchers
- Dispatcher inheritance
- Wrapping Java executors
- With context
- Error handling
- Summary
- Application of Coroutines
- Channels
- Rendezvous channels
- Closing a channel
- Producers
- Conflated channels
- Ticker channels
- select expression
- Using select for channels
- Using select for deferred
- Debugging coroutines
- Coroutines in action
- Concurrent HTTP requests
- Blocking IO with coroutines
- Using callbacks with coroutines
- Summary
- Kotlin Serialization
- Setup
- Json serialization and deserialization
- How it works
- Protobuf serialization and deserialization
- Annotations
- Rules
- Summary
- Other Books You May Enjoy
- Leave a review - let other readers know what you think 更新時間:2021-06-24 14:14:22