SlideShare uma empresa Scribd logo
1 de 28
Boost up
your productivity
with Kotlin
Liferay Symposium 2018
Louis-Guillaume Durand
Summary
● What is Kotlin?
● Why Kotlin?
● How to use Kotlin in Liferay?
What is Kotlin?
What is Kotlin?
● Programming language for JVM and JS
● Statically typed
● Open source
● Created by JetBrains (→ IntelliJ IDEA)
What is Kotlin?
2010 2011 2016 2017
Project Kotlin JVM Language
Summit
Release 1.0 Android support
{ WORKING }
Release 1.1
Release 1.2
What is Kotlin?
JetBrains concerns:
● To be more productive
● Other languages have features or speed, but not both
● To drive the sales of IntelliJ IDEA
Why Kotlin?
Why Kotlin?
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}
Why Kotlin?
fun main(args: Array<String>) {
println("Hello, world!")
}
Why Kotlin?
data class Greeting(val name: String)
fun main(args: Array<String>) {
val greeting = Greeting("world")
println("Hello, ${greeting.name}!")
}
Why Kotlin?
data class Greeting(var name: String = "") {
fun sayHello() = println("Hello, $name!")
}
fun main(args: Array<String>) {
val greeting = Greeting()
greeting.name = "world"
greeting.sayHello()
}
Why Kotlin?
val greeting: Greeting? = getNullableGreeting()
greeting.name // compilation error
greeting?.name // returns null
greeting!!.name // throws exception
Why Kotlin?
class Name(val value: String) {
operator fun plus(name: Name) {
return Name("${this.value} ${name.value}")
}
}
Why Kotlin?
val firstName = Name("John")
val lastName = Name("Doe")
val fullName = firstName.plus(lastName)
println(fullName.value) // prints "John Doe"
Why Kotlin?
@Deprecated(
level = DeprecationLevel.WARNING, // ERROR, HIDDEN
message = "We use anotherMethod() now",
replaceWith = ReplaceWith("anotherMethod()")
)
fun someMethod()
fun anotherMethod()
Why Kotlin?
fun someMethodToImplement() {
TODO("Implement this ASAP")
}
// add TODO and throws exception
Why Kotlin?
import org.junit.Assert.assertTrue
import org.junit.Test
class DummyTests {
@Test fun `Ceci n'est pas un test`() {
assertTrue(true)
}
}
Why Kotlin?
public class HelloWorld {
public static void printHelloFromJava() {
System.out.println("Hello, world!");
}
}
// ---
fun main(args: Array<String>) {
HelloWorld.printHelloFromJava()
}
How to use Kotlin in Liferay?
How to use Kotlin in Liferay?
buildscript {
dependencies {
classpath group: "org.jetbrains.kotlin",
name: "kotlin-gradle-plugin",
version: "1.1.2"
}
}
apply plugin: 'kotlin'
How to use Kotlin in Liferay?
dependencies {
compileOnly group: "org.jetbrains.kotlin",
name: "kotlin-osgi-bundle",
version: "1.1.2"
}
How to use Kotlin in Liferay?
Import-Package:
!kotlin.*,
*
Conditional-Package:
kotlin.*
→ Add an import statement for a
package that is not referred to by your
code but is still needed
→ Recursively add packages from the
class path when referred and when they
match one of the package
specifications
How to use Kotlin in Liferay?
@Component(
immediate = true,
property = arrayOf(
"com.liferay.portlet.instanceable=true"
// and much more...
),
service = arrayOf(Portlet::class)
)
class KotlinGreeterPortlet : MVCPortlet() { // ... }
How to use Kotlin in Liferay?
class KotlinGreeterPortlet : MVCPortlet() {
@Throws(IOException::class, PortletException::class)
override fun doView(
renderRequest: RenderRequest,
renderResponse: RenderResponse) {
// do awesome stuff with Kotlin...
}
}
How to use Kotlin in Liferay?
https://github.com/liferay/liferay-blade-samples
Conclusion
● Harder
● Better
● Faster
● Stronger
● An introduction to Kotlin by
example, Dmitry Kandalov
● 10 Kotlin Tricks in 10 ish minutes,
Jake Wharton
● Kotlin in Action, Dmitry Jemerov,
Svetlana Isakova
Questions?
Thank you :^)

Mais conteúdo relacionado

Semelhante a Boost up your productivity with Kotlin - Liferay Symposium France 2018

Kotlin: Why Do You Care?
Kotlin: Why Do You Care?Kotlin: Why Do You Care?
Kotlin: Why Do You Care?intelliyole
 
Having Fun with Kotlin Android - DILo Surabaya
Having Fun with Kotlin Android - DILo SurabayaHaving Fun with Kotlin Android - DILo Surabaya
Having Fun with Kotlin Android - DILo SurabayaDILo Surabaya
 
Programming with Kotlin
Programming with KotlinProgramming with Kotlin
Programming with KotlinDavid Gassner
 
Writing Kotlin Multiplatform libraries that your iOS teammates are gonna love
Writing Kotlin Multiplatform libraries that your iOS teammates are gonna loveWriting Kotlin Multiplatform libraries that your iOS teammates are gonna love
Writing Kotlin Multiplatform libraries that your iOS teammates are gonna loveAndré Oriani
 
Get started with android DSC HCMUT
Get started with android DSC HCMUTGet started with android DSC HCMUT
Get started with android DSC HCMUTNhanNguyen534
 
Kotlin Native - C / Swift Interop - ACCU Autmn 2019
Kotlin Native - C / Swift Interop - ACCU Autmn 2019Kotlin Native - C / Swift Interop - ACCU Autmn 2019
Kotlin Native - C / Swift Interop - ACCU Autmn 2019Eamonn Boyle
 
JUnit 5 - The Next Generation
JUnit 5 - The Next GenerationJUnit 5 - The Next Generation
JUnit 5 - The Next GenerationKostadin Golev
 
Quick Introduction to Kotlin Coroutine for Android Dev
Quick Introduction to Kotlin Coroutine for Android DevQuick Introduction to Kotlin Coroutine for Android Dev
Quick Introduction to Kotlin Coroutine for Android DevShuhei Shogen
 
Building Mobile Apps with Android
Building Mobile Apps with AndroidBuilding Mobile Apps with Android
Building Mobile Apps with AndroidKurt Renzo Acosta
 
Jetpack compose
Jetpack composeJetpack compose
Jetpack composeLutasLin
 
Try Jetpack Compose
Try Jetpack ComposeTry Jetpack Compose
Try Jetpack ComposeLutasLin
 
Dear Kotliners - Java Developers are Humans too
Dear Kotliners - Java Developers are Humans tooDear Kotliners - Java Developers are Humans too
Dear Kotliners - Java Developers are Humans tooVivek Chanddru
 
Kotlin coroutine - the next step for RxJava developer?
Kotlin coroutine - the next step for RxJava developer?Kotlin coroutine - the next step for RxJava developer?
Kotlin coroutine - the next step for RxJava developer?Artur Latoszewski
 

Semelhante a Boost up your productivity with Kotlin - Liferay Symposium France 2018 (20)

Kotlin: Why Do You Care?
Kotlin: Why Do You Care?Kotlin: Why Do You Care?
Kotlin: Why Do You Care?
 
Having Fun with Kotlin Android - DILo Surabaya
Having Fun with Kotlin Android - DILo SurabayaHaving Fun with Kotlin Android - DILo Surabaya
Having Fun with Kotlin Android - DILo Surabaya
 
Programming with Kotlin
Programming with KotlinProgramming with Kotlin
Programming with Kotlin
 
Kotlin v1.1.2
Kotlin v1.1.2 Kotlin v1.1.2
Kotlin v1.1.2
 
從零開始學 Android
從零開始學 Android從零開始學 Android
從零開始學 Android
 
Kotlin Presentation
Kotlin PresentationKotlin Presentation
Kotlin Presentation
 
Writing Kotlin Multiplatform libraries that your iOS teammates are gonna love
Writing Kotlin Multiplatform libraries that your iOS teammates are gonna loveWriting Kotlin Multiplatform libraries that your iOS teammates are gonna love
Writing Kotlin Multiplatform libraries that your iOS teammates are gonna love
 
Get started with android DSC HCMUT
Get started with android DSC HCMUTGet started with android DSC HCMUT
Get started with android DSC HCMUT
 
Koin Quickstart
Koin QuickstartKoin Quickstart
Koin Quickstart
 
JUnit 5
JUnit 5JUnit 5
JUnit 5
 
Kotlin Native - C / Swift Interop - ACCU Autmn 2019
Kotlin Native - C / Swift Interop - ACCU Autmn 2019Kotlin Native - C / Swift Interop - ACCU Autmn 2019
Kotlin Native - C / Swift Interop - ACCU Autmn 2019
 
Kotlin
KotlinKotlin
Kotlin
 
JUnit 5 - The Next Generation
JUnit 5 - The Next GenerationJUnit 5 - The Next Generation
JUnit 5 - The Next Generation
 
Quick Introduction to Kotlin Coroutine for Android Dev
Quick Introduction to Kotlin Coroutine for Android DevQuick Introduction to Kotlin Coroutine for Android Dev
Quick Introduction to Kotlin Coroutine for Android Dev
 
Building Mobile Apps with Android
Building Mobile Apps with AndroidBuilding Mobile Apps with Android
Building Mobile Apps with Android
 
Jetpack compose
Jetpack composeJetpack compose
Jetpack compose
 
Try Jetpack Compose
Try Jetpack ComposeTry Jetpack Compose
Try Jetpack Compose
 
Dear Kotliners - Java Developers are Humans too
Dear Kotliners - Java Developers are Humans tooDear Kotliners - Java Developers are Humans too
Dear Kotliners - Java Developers are Humans too
 
Hello to Kotlin
Hello to KotlinHello to Kotlin
Hello to Kotlin
 
Kotlin coroutine - the next step for RxJava developer?
Kotlin coroutine - the next step for RxJava developer?Kotlin coroutine - the next step for RxJava developer?
Kotlin coroutine - the next step for RxJava developer?
 

Último

Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingShane Coughlan
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 

Último (20)

Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 

Boost up your productivity with Kotlin - Liferay Symposium France 2018

  • 1. Boost up your productivity with Kotlin Liferay Symposium 2018 Louis-Guillaume Durand
  • 2. Summary ● What is Kotlin? ● Why Kotlin? ● How to use Kotlin in Liferay?
  • 4. What is Kotlin? ● Programming language for JVM and JS ● Statically typed ● Open source ● Created by JetBrains (→ IntelliJ IDEA)
  • 5. What is Kotlin? 2010 2011 2016 2017 Project Kotlin JVM Language Summit Release 1.0 Android support { WORKING } Release 1.1 Release 1.2
  • 6. What is Kotlin? JetBrains concerns: ● To be more productive ● Other languages have features or speed, but not both ● To drive the sales of IntelliJ IDEA
  • 8. Why Kotlin? public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, world!"); } }
  • 9. Why Kotlin? fun main(args: Array<String>) { println("Hello, world!") }
  • 10. Why Kotlin? data class Greeting(val name: String) fun main(args: Array<String>) { val greeting = Greeting("world") println("Hello, ${greeting.name}!") }
  • 11. Why Kotlin? data class Greeting(var name: String = "") { fun sayHello() = println("Hello, $name!") } fun main(args: Array<String>) { val greeting = Greeting() greeting.name = "world" greeting.sayHello() }
  • 12. Why Kotlin? val greeting: Greeting? = getNullableGreeting() greeting.name // compilation error greeting?.name // returns null greeting!!.name // throws exception
  • 13. Why Kotlin? class Name(val value: String) { operator fun plus(name: Name) { return Name("${this.value} ${name.value}") } }
  • 14. Why Kotlin? val firstName = Name("John") val lastName = Name("Doe") val fullName = firstName.plus(lastName) println(fullName.value) // prints "John Doe"
  • 15. Why Kotlin? @Deprecated( level = DeprecationLevel.WARNING, // ERROR, HIDDEN message = "We use anotherMethod() now", replaceWith = ReplaceWith("anotherMethod()") ) fun someMethod() fun anotherMethod()
  • 16. Why Kotlin? fun someMethodToImplement() { TODO("Implement this ASAP") } // add TODO and throws exception
  • 17. Why Kotlin? import org.junit.Assert.assertTrue import org.junit.Test class DummyTests { @Test fun `Ceci n'est pas un test`() { assertTrue(true) } }
  • 18. Why Kotlin? public class HelloWorld { public static void printHelloFromJava() { System.out.println("Hello, world!"); } } // --- fun main(args: Array<String>) { HelloWorld.printHelloFromJava() }
  • 19. How to use Kotlin in Liferay?
  • 20. How to use Kotlin in Liferay? buildscript { dependencies { classpath group: "org.jetbrains.kotlin", name: "kotlin-gradle-plugin", version: "1.1.2" } } apply plugin: 'kotlin'
  • 21. How to use Kotlin in Liferay? dependencies { compileOnly group: "org.jetbrains.kotlin", name: "kotlin-osgi-bundle", version: "1.1.2" }
  • 22. How to use Kotlin in Liferay? Import-Package: !kotlin.*, * Conditional-Package: kotlin.* → Add an import statement for a package that is not referred to by your code but is still needed → Recursively add packages from the class path when referred and when they match one of the package specifications
  • 23. How to use Kotlin in Liferay? @Component( immediate = true, property = arrayOf( "com.liferay.portlet.instanceable=true" // and much more... ), service = arrayOf(Portlet::class) ) class KotlinGreeterPortlet : MVCPortlet() { // ... }
  • 24. How to use Kotlin in Liferay? class KotlinGreeterPortlet : MVCPortlet() { @Throws(IOException::class, PortletException::class) override fun doView( renderRequest: RenderRequest, renderResponse: RenderResponse) { // do awesome stuff with Kotlin... } }
  • 25. How to use Kotlin in Liferay? https://github.com/liferay/liferay-blade-samples
  • 26. Conclusion ● Harder ● Better ● Faster ● Stronger ● An introduction to Kotlin by example, Dmitry Kandalov ● 10 Kotlin Tricks in 10 ish minutes, Jake Wharton ● Kotlin in Action, Dmitry Jemerov, Svetlana Isakova

Notas do Editor

  1. Unveiled at the JVM Language Summit in July 2011 Dmitry Jemerov said they’ve been working on it for almost a year : https://blog.jetbrains.com/kotlin/2011/07/hello-world-2/ 1.1 & 1.2 in 2017
  2. https://blog.jetbrains.com/kotlin/2011/08/why-jetbrains-needs-kotlin/ Google IO 2017 → Android officially supports Kotlin Android Studio is developped by JetBrains
  3. fun -> concise, name: Type, no semilicon, package level type inferrence : returns Unit here
  4. inline class declaration, data (equals, hashcode, toString, copy = clone), no new keyword, string templates
  5. inline function, default arguments value, string template without curly braces
  6. null safety → can be null only explicitly, null safety with accessor
  7. operator overloading
  8. operator overloading
  9. deprecated levels → WARNING = same as java, ERROR = compilation error, HIDDEN = like method doesn’t exist replace with → easy replacement with IntelliJ IDEA
  10. Add TODO and throws NotImplementedError
  11. Add TODO and throws NotImplementedError
  12. https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/adding-third-party-libraries-to-a-module