Your SlideShare is downloading. ×
多治見IT勉強会 Groovy Grails
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

多治見IT勉強会 Groovy Grails

1,641
views

Published on

地元、多治見市で、Groovy/grailsな話をしてきた。

地元、多治見市で、Groovy/grailsな話をしてきた。


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,641
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. 2010.10.14 at Tajimi def speaker = new Cast(name:”T.Yamamoto”,version:”TI-2010-10-14”)
  • 2. def name='World' def list = ["Hello", " ", "World"] println "Hello $name!" list.each{ print it } class Greet { def name Greet(who) { name = who[0].toUpperCase() +who[1..-1] } def salute() { println "Hello $name!" } } def g = new Greet('world') // create object g.salute()
  • 3. import java.util.Date; } return this.black; public Integer getColorId() { } public class Color { return this.colorId; public void setBlack(String black) { private Integer colorId; } this.black = black; private String colorName; public void setColorId(Integer colorId) { } private String cyan; this.colorId = colorId; public String getRgb() { private String magenta; } return this.rgb; private String yellow; public String getColorName() { } private String black; return this.colorName; public void setRgb(String rgb) { private String rgb; } this.rgb = rgb; private String sysIpaddress; public void setColorName(String } private Date sysLastmodified; colorName) { public String getSysIpaddress() { private Integer sysUid; this.colorName = colorName; return this.sysIpaddress; public Color(Integer colorId, String } } colorName, String cyan, public String getCyan() { public void setSysIpaddress(String String magenta, String yellow, String return this.cyan; sysIpaddress) { black, String rgb, } this.sysIpaddress = sysIpaddress; String sysIpaddress, Date public void setCyan(String cyan) { } sysLastmodified, Integer sysUid) { this.cyan = cyan; public Date getSysLastmodified() { this.colorId = colorId; } return this.sysLastmodified; this.colorName = colorName; public String getMagenta() { } this.cyan = cyan; return this.magenta; public void setSysLastmodified(Date this.magenta = magenta; } sysLastmodified) { this.yellow = yellow; public void setMagenta(String magenta) { this.sysLastmodified = sysLastmodified; this.black = black; this.magenta = magenta; } this.rgb = rgb; } public Integer getSysUid() { this.sysIpaddress = sysIpaddress; public String getYellow() { return this.sysUid; this.sysLastmodified = sysLastmodified; return this.yellow; } this.sysUid = sysUid; } public void setSysUid(Integer sysUid) { } public void setYellow(String yellow) { this.sysUid = sysUid; public Color() {} this.yellow = yellow; } public Color(Integer colorId) { } } this.colorId = colorId; public String getBlack() {
  • 4. class Color { Integer colorId String colorName String cyan,magenta,yellow,black,rgb String sysIpaddress Date sysLastmodified Integer sysUid } class Color { Integer colorId, sysUid String colorName,cyan,magenta,yellow,black,rgb,sysIpaddress Date sysLastmodified }
  • 5. public class HelloWorld { String name; public void setName(String name){ this.name = name; } public String getName(){ return name; } public String greet(){ return "Hello "+name; } public static void main(String[] args){ HelloWorld helloWorld = new HelloWorld(); helloWorld.setName("Groovy"); System.out.println(helloWorld.greet()); } }
  • 6. public class HelloWorld { String name; public void setName(String name){ this.name = name; } public String getName(){ return name; } public String greet(){ return "Hello "+name; } public static void main(String[] args){ HelloWorld helloWorld = new HelloWorld(); helloWorld.setName("Groovy"); System.out.println(helloWorld.greet()); } }
  • 7. public class HelloWorld { String name public void setName(String name){ this.name = name } public String getName(){ return name } public String greet(){ return "Hello "+name } public static void main(String[] args){ HelloWorld helloWorld = new HelloWorld() helloWorld.setName("Groovy") System.out.println(helloWorld.greet()) } }
  • 8. public class HelloWorld { String name public String greet(){ return "Hello "+name } public static void main(String[] args){ HelloWorld helloWorld = new HelloWorld() helloWorld.setName("Groovy") System.out.println(helloWorld.greet()) } }
  • 9. public class HelloWorld { String name public String greet(){ return "Hello "+name } } HelloWorld helloWorld = new HelloWorld() helloWorld.setName("Groovy") System.out.println(helloWorld.greet())
  • 10. class HelloWorld { String name def greet(){ return "Hello "+name } } def helloWorld = new HelloWorld() helloWorld.setName("Groovy") println(helloWorld.greet())
  • 11. class HelloWorld { String name def greet(){ return "Hello "+name } } def helloWorld = new HelloWorld() helloWorld.name = "Groovy" println helloWorld.greet()
  • 12. class HelloWorld { String name def greet(){ "Hello $name"} } def helloWorld = new HelloWorld() helloWorld.name = "Groovy" println helloWorld.greet()
  • 13. class HelloWorld { String name def greet(){ "Hello $name"} } def helloWorld = new HelloWorld(name: "Groovy") println helloWorld.greet()
  • 14. @Grab('com.google.code.jcouchdb:jcouchdb:1.0.1-1') import org.jcouchdb.db.Database Database db = new Database(     "localhost", "example_xmldo"   ) db.createDocument(     [name:' ',comment:' '])
  • 15. Groovy G*( )
  • 16. mailService.send to: 'foobar@gmail.com', subject: 'Hello World', htmlBody: '<bold>Hello</bold>'
  • 17. import com.google.appengine.api.datastore.Entity def person = new Entity("person") person['name'] = " " person.age = 18 println person.name person.save() def q = new Query('person') def list = datastoreService.prepare(q).asList( Builder.withLimit(20).offset(0) ) person.delete()
  • 18. 29
  • 19. 30
  • 20. 31
  • 21. % grails run-app 38
  • 22. class Chat { String message Date dateCreated Date lastUpdated class ChatController { static constraints = { static scaffold = true message nullable:false } dateCreated() lastUpdated() } }
  • 23. Q&A
  • 24. 43

×