is it possible to use JSR-303 for validation or especially validation groups in the scala version of play? I could not find anything in the documentation about this...
Best Regards!
Related
I am trying to implement some domain object validation in Play 2 with scala in my REST based project. For the same project which was a in java earlier we use oval for that purpose. Any one can help me out by any such kind of validation tool to work with case class or at the JSON conversion. Any thing do we have in play framework to do this kind of domain object validation.
Any help will be highly appreciated...
Check out play json framework:
https://www.playframework.com/documentation/2.6.x/ScalaJson
It is a very powerful framework for validating JSON objects
I'm new in Slick and Play and I can't find any references about caching in docs(2 and 3rc). Is there any native way in Slick for cache organization or if not tell me, please, why and whats the reasons for not having it? Summary, I hope that somebody help me in this question or show another better way.
I don't think Slick has got anything, it is just for interacting with a RDBMS. But since you are using play framework you have the play cache API:s that you can use, for example in a DAO that wraps Slick. You can read more about it in the play framework docs here: https://www.playframework.com/documentation/2.3.x/ScalaCache
Also see http://slick.typesafe.com/doc/2.1.0/orm-to-slick.html#read-caching and the following section
Hey I love Play Framework Scala and I also am falling in love with Firebase. I was wondering though, I'm planning on building an app using AngularFire and I'm going to need to do some server-side logic/computation and make some server-side queries to Firebase. Is this possible to do with a Play Framework Scala setup? If so what is the recommended approach? If not, is it coming? If so when? I think it's so cool that the Firebase guys used Scala to build Firebase, but I'm bummed there is no Scala API to work with (that I can see). Maybe I could use the Java API somehow, but write still write the app in Scala? Any help would be great. Thanks!
Scala is highly interoperable with Java (compiles to the same bytecode) so you should be able to use the Java API straight-up without any issues.
While some libraries add Scala-specific wrappers to make an API more idiomatic and pleasant for a functional programming style and to smooth some rough edges, it's often not strictly necessary.
If for some reason you didn't want to use the Java client libs, you could also interface with the Firebase REST API via Play 2's very convenience and succinct web services library.
Should be no problem with either their Java SDK (when using Firebase on the backend) or the JavaScript SDK (when using it on the client). But you won't have native support for Scala or Play, especially no support for Iteratee/Enumeratee in Play.
The Java API looks quite good and seems to be event driven. So it should be no problem to integrate it in Play in a scalable way.
I am working on a play framework project with scala in which I want to have Scala domain classes (or even Java domain classes) using MongoDb as data store.
I want maximum performance while serving hundreds of thousands if not millions of requests per day.
Since both scala language and Play framework is adding new features by the month, what is the best answer in terms of latest production version of the modules mentioned in the question
and play framework 1.2.2, scala 0.9.1+ and scala language 2.8+?
for anyone stumbling upon this question and using playframwork 2.1.x or above I highly recommend taking a look at reactivemongo site and github project.
It's a mongodb scala driver that allows asynchronous db operations.
Great performance and mature enough for use in production.
At the time of writing this the current version is 0.9 and is being used by us in production without any problems.
I use Morphia module, a MongoDB integration for Play! 1.2.x
For scala I would suggest you have a look at https://github.com/novus/salat
I've written a play plugin for salat which you can find here https://github.com/leon/play-salat
Good luck!
Just thinking of implementing Guice in scala
Any sample code ?
Unless you specifically need Guice to add Scala to an existing Java-based project that uses framework, I'd advocate that you just use built-in language features instead.
Traits and implicits can give you all the Dependency Injection you'll need. You might also want to search online for the Cake pattern.
This post about DI in Scala will be able to help you to get going with Guice. See Using Google Guice topic.