Introduction to Play Framework
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Introduction to Play Framework

on

  • 2,588 views

An introduction to play framework

An introduction to play framework

Statistics

Views

Total Views
2,588
Views on SlideShare
2,588
Embed Views
0

Actions

Likes
0
Downloads
52
Comments
0

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Introduction to Play Framework Presentation Transcript

  • 1. Play Framework wildfire tech team
  • 2. 前 言Java 项目的开发效率• 臃肿,框架繁杂• IDE: Eclipse• 自动化: Ant• Redeploy: JRebel• 敏捷开发的浪潮 (Rails)
  • 3. OK , Play Framework iscoming...
  • 4. 前 言邂逅 Play• scala 用户组• 仿 Rails• 自动编译部署
  • 5. OK , Lets run a simple example
  • 6. Example$ play new yabe• app/: model/, view/, controller• conf/: application.rb, routes, messages• lib/• public/• test/
  • 7. Example$ play run• http://localhost:9000• conf/routes• app/controllers/Application.java• app/views/Application/index.html• template: app/views/main.html• write an error then refresh, Woo~• write index.html
  • 8. Exampleconnect to db• conf/application.conf• default: db=mem• db=mysql://root:root@localhost/yabe
  • 9. Example$ play test• http://localhost:9000/@tests
  • 10. Examplecreate the data model• use Hibernate but have no configuration• play.db.jpa.Model = JPA + helper(e.g. id)
  • 11. app/models/User.java
  • 12. test/BasicTest.java
  • 13. app/models/User.java
  • 14. test/BasicTest.java
  • 15. app/models/Post.java
  • 16. test/BasicTest.java
  • 17. app/models/Comment.java
  • 18. test/BasicTest.java
  • 19. app/models/Post.java
  • 20. test/BasicTest.java
  • 21. test/data.yml
  • 22. test/BasicTest.java
  • 23. All the tests is green?
  • 24. Examplecreate the view
  • 25. conf/data.yml
  • 26. app/Bootstrap.java
  • 27. app/controllers/Application.java
  • 28. app/views/Application/index.html
  • 29. ...ugly version
  • 30. ...beautiful version
  • 31. ...so many works• The comments page• Setting up a Captcha• Add tagging support• A basic admin area using CRUD• Adding authentication• Creating a custom editor area• Completing the application tests• Preparing for production• Internationalisation and localisation
  • 32. OK ,消化一下
  • 33. Five cool things you can do with Play • HTTP param and Java method param • action and Java method • DRY (template system) • JPA on steroids • Straightforward file upload management
  • 34. Conclusion • just reload when fix bug • stateless model(REST, scalable) • template system(groovy) • Asynchronous(NIO model, long polling) • pure java • full stack • Resolve and show errors • Productive
  • 35. Play 2.0 and scala ...
  • 36. Resource• http://www.playframework.org/• http://www.playframework.org/2.0
  • 37. Thank you !