How did I start Scala in financial Java projects.
Masayuki Dobashi
金融系JavaプロジェクトでScalaを使ってみた話
Who am I
- Working at A Securities Company in Roppongi.
- Programming Securities & FX trading system with Java language.
- IT literacy level of the office is very low.
- Programming skill level is also low.
- One day I sessioned a front of about 20 Java programmers, I asked a question "Is there anybody know or heard the word 'Functional & Immutable programming'? Then only 1 person raised his hand.
(sotto voce)
I had thought about
- I could add Java libraries like apache-commons, google-guava, lombok and more.
- Semantics are already changed when lombok is installed.
- I thought I could add 'scala-library-2.11.2.jar' without any approval documents.
How to start
- I made a concept proof program for crypto with Scala, and I handed over to team member.
- Because I was busy , I didn't take care of the member.
- After a month, I noticed that Scala code is running on production servers.
I did it!
What did I do with Scala?
product A
- Java & Scala in same project
- Java interfaces
- Scala implements them
product B
- Java & Scala in same project
- Scala DDD models
- Java services call them
commnet: Scala classes are not compiled untill all errors is removed. Java codes can't find them when some errors remains.
commnet: Scala codes have to return Java types
is つらい
is つらい
What did I do with Scala?
product C
- Java project & Scala project is separated.
- Scala DDD models & Scala services.
- Make Java wrapper servcies for Scala servcies
After this, product A & product B is rewritten to Java cause other member maybe couldn't maintain those.
Binary compatibility
is つらそう
ArtifactId contains scala version.
It means that if one library were discontinued, the project can't version up scala.
Or compile with new version yourself.
from #rpscala.
RESTful server
There are many knowhows and scripts for maven and tomcat deploy eco-system, so it's so heavy to change servlet-container to Play 2 Framework.
It is a part of Java Jersey project. But JAX-RS is not cool, cause of many annotations and more...
Scalatra can work on tomcat.
Is it for good at Java & Scala mixed project?
I'm looking for the way to use modern language in financial company.
Fine.
[Scala] Financial Java project
By hakaicode
[Scala] Financial Java project
- 887