Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Kotlin in Action: Kotlin, Scala and Java  RSS feed

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi , good afternoon

regarding these three languages that operate over jvm machine . In java , the most extended technology ( I think ) for business logic is EJB and Spring Beans . Seems scala is using akka actors (despite it can interoperate with Java beans ) . I don't know to much about kotlin, even that I'm a curious person and someday I want to put an eye on it . My question is which is the normal technology for business tier in kotlin ? is kotlin as interoperable with java as scala is ? .

On the other hand , does kotlin only focus in functional programming ? or accepts imperative methodologies ?

Sorry for asking more than one question jeje . Hope you don't mind .


 
Ranch Hand
Posts: 46
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJB was the most used technology in 2006 maybe, but things have fortunately quite changed. I believe Spring framework is now leading. And by the way Spring 5 works quite well with kotlin
 
Ranch Hand
Posts: 469
8
Android Open BSD Slackware
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Yago Segura wrote:Hi , good afternoon

regarding these three languages that operate over jvm machine . In java , the most extended technology ( I think ) for business logic is EJB and Spring Beans . Seems scala is using akka actors (despite it can interoperate with Java beans ) . I don't know to much about kotlin, even that I'm a curious person and someday I want to put an eye on it . My question is which is the normal technology for business tier in kotlin ? is kotlin as interoperable with java as scala is ? .

On the other hand , does kotlin only focus in functional programming ? or accepts imperative methodologies ?

Sorry for asking more than one question jeje . Hope you don't mind .



yes it is interoperable. Kotlin does not focus only to functional programming. Is really different by scala, although has some commonalities.
THere is the concept of Stream, but also in Java. DIfferent is if you use the lambda expressions you get with Kotlin with RXJava. In this way it looks a bit more functional
 
Yago Segura
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Martin Bechtle wrote:EJB was the most used technology in 2006 maybe, but things have fortunately quite changed. I believe Spring framework is now leading. And by the way Spring 5 works quite well with kotlin



Spring it's an amazing technology , and with spring 4 and spring 5 , reactive philosophy and kotlin are turned to a first class citizen inside the framework .

Allthough , the comparison between JEE EJB and spring beans it's not as different ( Sorry in case of I'm an ignorant human jeje . I talk as far as I know ) . At this point , and just in this restricted area, I prefer to use standard tools ( EJB ) . I know that spring beans can run in a lighter container like tomcat , but, doing a simple comparison between Spring beans and EJB , I don't see too much difference , and , IMHO , I prefer to use the standard things as much as I can . 
 
Martin Bechtle
Ranch Hand
Posts: 46
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I disagree on that. First of all there is no standard: JavaEE and EJB is just one of many options. And even if it was, your choice should not be based on the fact that it is a standard, but rather if it is the right technology for your use case. And if you are using it successfully, probably it is! But I suggest that any developer should try to acquire a deeper understanding of how different systems compare to each other and choose the right one for the job, even if it's not the standard one. Another thing you might want to take into consideration is documentation, community support, ease of use, etc... For example, tool X might seem right for the job, but then effectively it might be a nightmare to use.

And finally, another criterion is future proof-ness, which is where in my opinion EJB fails. For the rest, I think it's fine, especially if you know the internals and use it with care, avoiding things that can make scaling up hard (thinking about stateful beans and the need of clustering application servers rather than having a stateless design).
 
Yago Segura
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree in all the things you have said . You have to choose the right tool for your problems , and, if this tool is spring , go ahead . I really love spring . 

As you say, the best option is to know each technology as deep as you can, to make the right choice .  Documentation and Community is a good point to make the right choice . 

maybe the word 'standard' is a bit strong for what I was trying to expose , but I think my point of view it's clear . I prefer to start taking a look at JEE , and , taking into consideration my non functional requirements, evaluate if it's enough for me , or I have to choose another technology . clustering and statefull beans issues are interesting topics to evaluate as well as if I need a full application server or just a servlet container .   
 
author
Ranch Hand
Posts: 149
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kotlin is fully interoperable with Java and allows you to work with any existing Java framework, including Spring. In addition to that, there are Kotlin-specific frameworks such as Ktor, which make better use of Kotlin's language features, but are not as full-featured as the more mature Java libraries.

For less experienced developers, I would recommend Spring as the go-to choice for starting a new Web or enterprise application. It provides all the necessary features, has plenty of documentation and examples, and is generally stable and reliable.
 
Ranch Hand
Posts: 974
9
IBM DB2 Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Martin Bechtle wrote:I disagree on that. First of all there is no standard: JavaEE and EJB is just one of many options.


Well, yes and no I would say. Java EE is not the only way to work with Java at enterprise level - Spring docet - but, at the same time, is a a collection of technologies tought to compose a "standard" set of services.
In my very humble opinion, Spring's great advantage over Java EE is the possibility to keep the fast pace IT is nowadays moving with, something that is much more harder to achieve for a "classical" application server, at least if you're not working with edge-tech oriented application servers.
Spring fx is changing the game's rules. For example, how long would we have had to wait for a Kotlin integration at Java EE level ?
 
If you are using a wood chipper, you are doing it wrong. Even on this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!