Scaffolding for Play Framework 2 - scala

Is there scaffolding generator utility for Play Framework 2 for Scala like Ruby on Rails has? I found some topics about this but didn't figure out which one was most popular or even if there was the standard one?
Your thoughts?
UPDATE: I mean scaffolding for generating controllers, views, models or any of them.

If you're using MongoDB, the reactive mongo plugin has an auto source feature, which gives you a REST scaffolding API:
http://mandubian.com/2013/06/11/play-autosource/

Slick can generate models from your database tables. They aren't play specific so I think you'd have to write controllers yourself, but it's a start.
https://scala-slick.org/

Related

Play Framework and Slick project architecture

I'm migrating an Application from Grails to Play Framework and i'm currently trying to figure out what's the best way of organizing the project structure.
I want to use Slick Codegen alongside with Flyway for Migrations, cause i want to keep a track of all the migrations that are being done (a solution similar to Rails Migrations would be perfect).
I see that Play Framework has the Play-Slick module but from what i've noticed, everything just happens like pure black-magic.
I saw an example on GitHub where Slick Modelling, Play Framework and Flyway Migrations are 3 separate SBT Modules, which makes perfect sense in case we ever want to move away from Play Framework.
Now, my questions is: What's the best architecture approach for a Play Framework App?
Note: I'm a newbie in Play Framework and Scala.
I did a post a while ago about using Play + slick + mysql. Is has the minimal structure to work, but the one I found more correct (I think this point will be subjective): http://pedrorijo.com/blog/play-slick/
or the source code at https://github.com/pedrorijo91/play-slick3-steps

CRUD operations on a database in Play

I'd like to be able to create/delete/change a database and tables, create/delete indexes and all these kinds of things by Scala code, not by an sql file. Probably, using anorm. Is wonder, is it possible?
I know it's possible to do CRUD operations with tables.
Slick is a Scala ORM that can do most of what you're asking for, however it does not have a pure Scala way of creating a new database. You can read more about that here.
You say you are using play then start off using Ebean ORM
Have a look at
Play Persistance
and
Avaje EBean
If you have downloaded play look in the samples directory there is a computer database example. It is a very good example of CRUD
Good luck
I would recommend slick! Slick at first seems different if you are moving from directly stating your statements, but it is super handy to work with. Check it out here

Is it feasible to build company specific framework that wraps NHibernate?

I heard that companies that use Java technologies, they used to build their own custom Framework that wraps Hibernate. However, is it really feasible for their .Net peers to do the same thing with NHibernate or Entity Framework?
This is almost always a horrible idea - I think Ayende sums it up best in this article. In general, you should consider NHibernate itself to be the "wrapper" around your data access - attempting to build an abstraction layer on top of it is probably going to be a losing proposition.
Actually, you should check out some of the articles on .NET Junkie's weblog. He wrote several great posts on how to deal with repositories, queries, commands and so on. We've been using these in a very large enterprise system where we switch between an in-memory dictionary, an in-memory SQLite database and a production environment using SQL Server or Oracle. Obviously, we use NHibernate for this.
I use the repository pattern and a separate project/dll to abstract away the data framework nhibernate / entity framework. this is a good starting point http://codebetter.com/petervanooijen/2008/04/04/wrapping-up-nhibernate-in-repositories/

Design Pattern to use with Entity Framework Code First

I am working on creating a Technical Design Document for my new project that is being developed using Entity Framework 4.1 Code First.
I want my DAL to be to be loosely coupled, easily testable and should be able to dynamically inject it using IoC Container...
Thinking of using Repository Pattern. Are there any good resources for reference?
--
Preetham Reddy
See these tutorials:
http://www.asp.net/entity-framework/tutorials/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application
http://www.asp.net/entity-framework/tutorials/using-the-entity-framework-and-the-objectdatasource-control-part-2-adding-a-business-logic-layer-and-unit-tests
This is a pretty good post.
http://blogs.msdn.com/b/adonet/archive/2009/06/16/using-repository-and-unit-of-work-patterns-with-entity-framework-4-0.aspx

What's the best way to paginate a dataset with Zend_Framework and Doctrine?

Before I start to build this myself I thought I'd ask others to share their experience. What's the best / your favorite way to paginate a dataset with an application built upon Zend_Framework and Doctrine as your ORM?
I'm new to Doctrine.
I'm calling the model directly from a View Helper, bypassing the Controller, although I'm still interested if your solution uses controllers.
I did see one article on this topic:
http://ciaranmcnulty.com/blog/2009/06/Simplify-pagination-logic-using-a-custom-zend-paginator-adapter
Devzone has an article using Doctrine, Zend Framework OR Pear, but none of those options mention a #ZF app that uses Doctrine.
You don't need anything special.
Look on Github for ready paginator adapter, e.g. this one.
In theory, one way is to create a custom data source adapter and plug it into Zend Paginator. http://framework.zend.com/manual/en/zend.paginator.advanced.html