Google App Engine with Gaelyk

2,142 views

Published on

Malaysia Open Source Conference 2011 presentation on Gaelyk.

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,142
On SlideShare
0
From Embeds
0
Number of Embeds
486
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Google App Engine with Gaelyk

    1. 1. Google App Engine with Gaelyk Easy cloud development. Or why using Gaelyk is like cheating the cloud development game.
    2. 2. About me#java #groovy #grails#android #iphone-dev#clojure #lisp#agile#ruby #jruby #macruby#favoriteMedium #software_architect#cloud #gae
    3. 3. Cloud computing?
    4. 4. Teach Yourself Gaelyk in 30 minutes• Introduction to Google App Engine• Overview of Gaelyk• Getting Started• Future of GAE and Gaelyk
    5. 5. http://gaelyk.appspot.com
    6. 6. Guillaume Laforge Head of Groovy Development at SpringSourcehttp://www.slideshare.net/glaforge
    7. 7. Software as a Service Gmail, SalesForcePlatform as a Service Google App EngineInfrastructure as a Service Amazon EC2, Azure
    8. 8. Platform as a Service Google App Engine
    9. 9. Gaelyk Services• Template pages• Datastore (similar to NoSQL)• Email• XMPP (Jabber e.g., Gtalk)• Multi-tenant(namespace)• Caching (Memcache)
    10. 10. • Download “gaelyk-template-project”• Create groovy class• Create gtpl template pages• dev_appserver.sh war• http://localhost:8080/
    11. 11. Gaelyk Directory Structure
    12. 12. URL Routing/ Simple URL routings config in routes.groovy /get "/about", redirect: "/general/about.html"
    13. 13. URL Routing/ Advance URL routings config in routes.groovy /get “/project/@id”, forward: “/project.groovy?id=@id”get “/delete/@id”, forward: “/delete.groovy?id=@id”get “/more/*”, forward: ”/more.groovy”/ More involved example /get “/edit/@project/@id”, forward: “/edit.groovy?id=@id&project=@project”
    14. 14. Controller/ Simple Groovlet controller /def name = params.namedef now = new Date()request.now = nowrequest.name = nameforward “hello.gtpl”
    15. 15. Views/Templates<body> <% def name = params.name def message = "Hi ${name} Hello World!" %> <p> ${message} </p></body>
    16. 16. Views/Templates (2)<% def user = session.user%><html> <body> <% if (user) { %> <p>You are currently logged in.</p> <% } else { %> <p>Youre not logged in.</p> <% } %> </body></html>
    17. 17. Datastore (1)/ Create and save entity data /def project = new Entity(“project”)project.name = “Kickass Web Application”project.owner = bob.key.idproject.createdDate = new Date()project.save()
    18. 18. Datastore (2)def project = new Entity(“project”)project.name = “Kickass Web Application”project.owner = bob.key.idproject.createdDate = new Date()project.save()//...sometime to delete dataproject.delete()
    19. 19. Datastore (3)/ Querying data /def query = new Query(“project”)query.addSort(“createdDate”, SortDirection.DESCENDING)query.addFilter(“name”, FilterOperator.EQUAL, “Kickass Project”)def preparedQuery = datastore.prepare(query)def results = preparedQuery.adList( withLimit(20) )
    20. 20. Datastore (4)/ Querying data with more Groovy meta-programming /def query = new Query(“project”) .addSort(“createdDate”, SortDirection.DESCENDING) .addFilter(“name”, FilterOperator.EQUAL, “Kickass Project”)def results = datastore.prepare(query).asList( withLimit(20) )
    21. 21. Datastore (5)/ Latest Query DSL -- Not release yet / SELECT * FROM projects WHERE name = “Kickass Project” ORDER BY createdDate DESC
    22. 22. <!-- Making use of results from controller --><% def results = request.results %><ul>! <% results.each { result -> %>! ! <li>! ! ! ${result.name}! ! </li>! <% } %></ul>
    23. 23. Datastore (4)/ Create and save entity data // in “Project X” context /namespace.of(“projectX”) { def project = new Entity(“project”) project.name = “Kickass Web Application” project.owner = bob.key.id project.createdDate = new Date() project.save()}
    24. 24. Email/ Sending email /mail.send from: "app-admin-email@gmail.com", to: "recipient@somecompany.com", subject: "Re: Invoice", textBody: "Hi, here’s the latest invoice", attachment: [data: "Latest Invoice , fileName: "invoice.doc"]
    25. 25. Deployment/ Running on local for development /dev_appserver.sh war/ Deploy to GAE /appcfg.sh update war
    26. 26. Showcase: AndroidRockeeet
    27. 27. • AndroidRockeeet.appspot.com• Android deployment tool• From concept to 1st deploy = 5 hours• Beta testing now• Never concerned about scaling
    28. 28. What’s missing from this talk? Plugins Billing Quota Advance API Apps market integration ...

    ×