[2.x Scala] play-faster is on github

172 views
Skip to first unread message

virtualeyes

unread,
Jul 30, 2013, 8:44:38 AM7/30/13
to play-fr...@googlegroups.com
Speed up your play development: play-faster

HOUSSEM ZAIER

unread,
Jul 30, 2013, 9:03:20 AM7/30/13
to play-fr...@googlegroups.com
Thanks man I need this 


2013/7/30 virtualeyes <sit...@gmail.com>
Speed up your play development: play-faster

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Zaier Houssem
Ingénieur développeur web/mobile   
           Skype: houssemzaier
 

Yann Simon

unread,
Jul 30, 2013, 10:05:16 AM7/30/13
to play-fr...@googlegroups.com
Thanks for the project.

Can you explain this?
"Consider replacing cake pattern with design by contract"

Do you have an example for this?


2013/7/30 virtualeyes <sit...@gmail.com>
Speed up your play development: play-faster

--

virtualeyes

unread,
Jul 30, 2013, 10:30:14 AM7/30/13
to play-fr...@googlegroups.com
Sure, I went all-in on cake designing a DAO repository for ScalaQuery, and needlessly paid the price (longer build times) for the added layers.

design by contract:
private[model] trait UserContract extends DAOContract[User] {
 
def findByEmail(s: String): Option[User]
}

private[model] class UserDAO extends DAO[User] with UserContract {
 
def findByEmail(s: String) = option[User]( byEmail(s) )
  val byEmail  
= Users.createFinderBy(_.email)
}

Where DAOContract defines standard get, list, count, etc. methods, and abstract DAO class implements them, following same interface + implementation pattern as above.

In a controller:
object Account extends Controller {
 
def reset(email: String) = Action {
    repo
.user.findByEmail(email) map{u=>
     
...
   
} getOrElse NotFound
 
}
}

Cake is best suited for library writers, IMO, where there may be no other way to (easily) express a given structure.

Yann Simon

unread,
Jul 30, 2013, 10:51:47 AM7/30/13
to play-fr...@googlegroups.com
Understand.

I tough you were speaking about dependency management with traits.
traitA {
  this: DependencyTrait =>
...
}

Difficult to replace this with a design by contract IMHO.


2013/7/30 virtualeyes <sit...@gmail.com>

Andrew Conner

unread,
Jul 30, 2013, 2:03:01 PM7/30/13
to play-fr...@googlegroups.com
There's some really great stuff here, thanks.

virtualeyes

unread,
Jul 30, 2013, 3:13:38 PM7/30/13
to play-fr...@googlegroups.com
On Tuesday, July 30, 2013 10:51:47 AM UTC-4, Yann Simon wrote:
Understand.

I tough you were speaking about dependency management with traits.
traitA {
  this: DependencyTrait =>
...
}

Right, I should clarify that, thanks. I'm talking about implementing the cake pattern without having a clearly defined need for it; i.e. cake for the sake of cake.

Self types of course are not necessarily evidence of having implemented cake. Could be a concrete hasA relationship, which is how I sometimes use self types. e.g.
abstract class DAO[Entity](implicit db: DataBaseComponent) extends QueryWrapper {
 
self: DAOContract[Entity] =>
 
...
}

Anyway, dependency management may be better served by Guice, Subcut, or other established library.

Tired of rolling my own, that's what brought me to Play.

 

virtualeyes

unread,
Aug 2, 2013, 9:34:30 AM8/2/13
to play-fr...@googlegroups.com
Please post build time/developer experience improvements after implementing the project/tips.

Particularly interested in build times and percentage reduction.

Thanks
Reply all
Reply to author
Forward
0 new messages