I have always used Spring framework (3.x) in my projects, using such features as:
I want to migrate some of my previous projects to Play framework. Recently I've started studying Scala language along with Play framework 2.x. And I want to use the same features as before. For database I'm going to use Slick library.
Could you advise me what to use for security and full text search?
Play is a direct competitor to Spring framework and designed to develop and deploy web applications more efficiently and also provides better MVC framework. In terms of getting a web application up and running quickly, play is the best.
Play Framework is the best full-stack web framework available in the current market to develop Reactive Web Applications, Reactive systems, Reactive architecture, Reactive microservices, or Reactive libraries using both FP and RP paradigms, that is, FRP.
Play Framework makes it easy to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly architecture. Built on Akka, Play provides predictable and minimal resource consumption (CPU, memory, threads) for highly-scalable applications.
Play Framework is an open-source web application framework which follows the model–view–controller (MVC) architectural pattern. It is written in Scala and usable from other programming languages that are compiled to JVM bytecode, e.g. Java.
Migration to new technology is always a bumpy road, so don't expect the first thing you try to work for you - might be you need to implement something yourself. I'll get to this with a specific example in a bit.
First, Scala means scalable, not integratable. That is, if you choose to code anything in Scala, keep in mind that frameworks meant for automating things in Java mostly do not work on the Scala side. ORM is a very good example of this since Scala methods are not always exactly Java methods, so the metadata will end up in incorrect places and you'll end up having corrupt data. So the general pointer is that if you go with Scala, you really can't look into the Java ecosystem for helpers unless the helpers are completely isolated from language semantics.
Assuming you took full advantage of Spring Security, you were using role-based access control. If you go with Java, you actually should be able to use Spring Security which definitely helps you with the migration and saves time writing more code. All you really need is a Spring container in your Play app and thankfully others have already solved that: Integrating Play framework 2.0 and Spring framework
On Scala side RBAC seems to be a civilized fight about semantics betwen RBAC and ACL with no clear winner. This is problematic since it seems like no one's actually working on one which means you may have to roll your own.
With Java you should be able to use Hibernate/any JPA solution since it's not tied to a web container. Play also comes with EBeans but from what I've observed it can't be used for the most exotic use cases. Might be you'll never hit those though so it's worth trying out since it's already there.
On Scala side, as you already thought, Slick should be alright.
Search is a really complex thing so I'd actually setup standalone Solr/ElasticSearch and integrate to its APIs instead of embed it to the app itself, no matter what language or framework is being used.
Latest Play just about supports Guice, Scala itself tries to enforce the cake pattern. Spring should be possible with the container integration linked earlier.
I hope someone else actually has good insights to comment on this because the way Play is built, especially on the Java side seems to be very IOC hostile.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With