Google Groups Home
Help | Sign in
Discussion on what-is-grails
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
noppanit@terasoft.co.th  
View profile
 More options May 14, 5:40 am
From: "noppa...@terasoft.co.th" <toy.New...@gmail.com>
Date: Wed, 14 May 2008 02:40:13 -0700 (PDT)
Local: Wed, May 14 2008 5:40 am
Subject: Discussion on what-is-grails
ถามคุณใหม่หน่อยครับว่า ถ้าผมจะเปลี่ยนมาพัฒนา Grails
คือผมต้องหัดภาษาใหม่อีกภาษาเลยใช่หรือเปล่าครับ คือผมเป็น Java อยู่แล้ว
หรือว่า เราสามารถ เขียน Grails ไปเรียก Java ได้อีกทีนึงครับ ขอบคุณครับ

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chanwit Kaewkasi  
View profile
 More options May 14, 5:53 am
From: "Chanwit Kaewkasi" <chan...@gmail.com>
Date: Wed, 14 May 2008 16:53:30 +0700
Local: Wed, May 14 2008 5:53 am
Subject: Re: [th-grails-user] Discussion on what-is-grails
สวัสดีครับ

ต้องทำความเข้าใจภาษา Groovy ในระดับเบื้องต้นนิดนึงครับ
จริง ๆ มันก็เหมือน Java ที่เพิ่ม concept ของ closure เข้ามาครับ
Grails และ Groovy ออกแบบมาให้ใช้งานกับ Java อยู่แล้วครับ
เพราะฉะนั้นการเรียกใช้ class กันสามารถทำได้โดยตรงครับ

- ตัว controller ของ Grails คือ Spring MVC
ตรงนี้จะมีรูปแบบการเขียนโปรแกรมที่คล้าย ๆ กันครับ
- ถ้าเคยออกแบบระบบด้วย Hibernate หรือ EJB3 ไว้แล้วก็สามารถนำมาใช้ได้เลย
- ถ้ามี XML ของ spring beans อยู่ก็นำเข้ามาใช้ได้เช่นกันครับ

-ชาญวิทย์

2008/5/14 noppa...@terasoft.co.th <toy.New...@gmail.com>:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
somkiat puisungnoen  
View profile
 More options May 15, 11:06 pm
From: somkiat puisungnoen <somkia...@gmail.com>
Date: Thu, 15 May 2008 20:06:41 -0700 (PDT)
Local: Thurs, May 15 2008 11:06 pm
Subject: Re: Discussion on what-is-grails

ตอนนี้ผมกำลังศึกษาตัว Groovy อยู่เลยครับ  มาศึกษาด้วยกันครับ

ต่อไปก็จะลงไปที่ Grails ครับ [ ลองใช้เบื้องต้นแล้วชอบครับ ง่ายดี
แต่ต้องศึกษาเพิ่มเติมอีกเยอะ ]

On May 14, 2:40 am, "noppa...@terasoft.co.th" <toy.New...@gmail.com>
wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chanwit Kaewkasi  
View profile
 More options May 16, 1:03 am
From: "Chanwit Kaewkasi" <chan...@gmail.com>
Date: Fri, 16 May 2008 12:03:24 +0700
Local: Fri, May 16 2008 1:03 am
Subject: Re: [th-grails-user] Re: Discussion on what-is-grails
งั้นผมจะลองเริ่มอธิบาย Groovy ไว้ใน group บ้างละกันครับ

เริ่มจากตัวอย่างที่เลียนแบบมาจากหน้าโฮมเพจของ Groovy
(1-7 คือเลขบรรทัดเพื่อใช้อ้างอิง เวลาเอาไปทดลอง run ให้ลบออกก่อนนะครับ)

1. class Greet {
2.  def name
3.  Greet(who) {
4.     name = who[0].toUpperCase() + who[1..-1]
5.  }
6.  def hello() { println "Hello $name!" }
7. }

def g = new Greet('world')  // สร้างวัตถุ
g.hello()              // แสดงผล "Hello World!"

จากตัวอย่างนี้ลอง save ไว้ชื่อ Greet.groovy แล้วสั่ง groovy
Greet.groovy บน command line ดูก็จะเห็นผลของการทำงาน
(ผม assume ว่าติดตั้ง Groovy กันเป็นแล้วนะครับ)

โค้ดด้านบน อธิบายโดยใช้แนวคิดของ Java ได้ดังนี้ครับ
1. class Greet มี modifier เป็น public
2. def name เป็นการประกาศ bean property นั่นคือด้วยบรรทัดนี้เราจะได้
   - private field ชื่อ name
   - getter เมธอด getName
   - setter เมธอด setName
โดยอัตโนมัติครับ ถ้าไม่ระบุ type อย่างที่เห็น จะได้ default type เป็น
Object (java.lang.Object) ครับ
3. public constructor รับ argument 1 ตัว
4. ตั้งค่า property name โดย who[0] จะเป็นการนำ element ตัวแรกของ who
ซึ่งรับค่ามาเป็น String แล้วเรียกใช้เมธอด .toUpperCase()
เพื่อแปลงเป็นตัวอักษรใหญ่ ตามด้วย who[1..-1] ซึ่งหมายถึงเอา String
ตัวที่เหลือทั้งหมด
6. เป็นการประกาศเมธอด hello ซึ่งจริง ๆ แล้วถ้าใช้ def และไม่ระบุ
return type ของเมธอดไว้เป็น void แบบนี้คือจะใช้ default type เป็น
Object เหมือนเคยครับ
6.1 การใช้ println คือการเรียกใช้ System.out.println ตัว String
ที่เป็น double qoute จะเป็นข้อความชนิดพิเศษเรียกว่า GString
ซึ่งจะอ้างอิงถึงตัวแปรด้ว ${ ... } ได้ ( note: 'abc' ใน Groovy คือ
"abc" ใน Java)
ตามตัวอย่างนี้คือเอาค่าจาก property name มาแสดงผลด้วยกันกับคำว่า Hello ครับ

-ชาญวิทย์

2008/5/16 somkiat puisungnoen <somkia...@gmail.com>:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
khomkrit  
View profile
 More options May 16, 2:38 am
From: khomkrit <khomkrit....@gmail.com>
Date: Thu, 15 May 2008 23:38:43 -0700 (PDT)
Local: Fri, May 16 2008 2:38 am
Subject: Re: Discussion on what-is-grails
ตอนนี้ผมกลับมาใน field ของ programming อีกรอบนึงแล้วครับ ต่อไปจะลุย
Groovy เต็มที่ล่ะ :D

สำหรับคำอธิบายของพี่ใหม่ผมอยากจะให้เขียนเป็น page เก็บไว้เลยครับ
เวลาผมอยากจะอ้างถึงเพื่อโปรโมท group จะได้อ้างมาได้ตรงๆ :) แล้วก็
ตรงส่วนของ code น่ะครับ ไม่รู้ว่า Google Group
ในหน้าที่เป็นหน้าเวปนั้น สนับสนุน HTML หรือเปล่า เพราะผมอยากจะให้ทำ
syntax highlight น่ะครับ มันดูสวย น่าอ่าน และดูอ่านง่ายดีครับ

On May 16, 12:03 pm, "Chanwit Kaewkasi" <chan...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chanwit Kaewkasi  
View profile
 More options May 16, 2:43 am
From: "Chanwit Kaewkasi" <chan...@gmail.com>
Date: Fri, 16 May 2008 13:43:45 +0700
Local: Fri, May 16 2008 2:43 am
Subject: Re: [th-grails-user] Re: Discussion on what-is-grails

> สำหรับคำอธิบายของพี่ใหม่ผมอยากจะให้เขียนเป็น page เก็บไว้เลยครับ

เอาเลยครับ
page ใช้ HTML ได้ครับ

-ชาญวิทย์

2008/5/16 khomkrit <khomkrit....@gmail.com>:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
somkiat puisungnoen  
View profile
 More options May 16, 1:15 pm
From: somkiat puisungnoen <somkia...@gmail.com>
Date: Fri, 16 May 2008 10:15:55 -0700 (PDT)
Local: Fri, May 16 2008 1:15 pm
Subject: Re: Discussion on what-is-grails
ขอบคุณมากครับ  ได้เรียนรู้เพิ่มเติมเยอะเลยครับ
ส่วนผมก็กำลังเริ่มศึกษา
โดยได้เขียนบันทึกการอ่านและศึกษาไว้ที่นี่ครับ

http://www.narisa.com/blog/up1/index.php?cat=168

ผิดถูกอย่างไร ก็แนะนำได้ครับ

ช่วงนี้มาค้นๆ และทำตามจากเอกสารใน group นี้ครับ


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chatsiri Ratana  
View profile
 More options May 16, 9:23 pm
From: "Chatsiri Ratana" <insider...@gmail.com>
Date: Sat, 17 May 2008 08:23:41 +0700
Local: Fri, May 16 2008 9:23 pm
Subject: Re: [th-grails-user] Re: Discussion on what-is-grails
 เชียร์อีกแรงครับ :D

2008/5/16 khomkrit <khomkrit....@gmail.com>: