cblue on February 15th, 2012

Grails 2.0.1 ออกแล้วครับเมื่อวาน วันวาเลนไทน์พอดี

ดาวน์โหลดได้จากที่นี่ครับ

admin on February 1st, 2012

สำนัก Opendream ภูมิใจเสนอคอร์สเรียน Grooy & Grails2.0 โดย Chanwit Kaewkasi ท่านที่สนใจสามารถลงทะเบียนเรียนได้แล้วตั้งแต่วันนี้ครับ สอนเป็นภาษาไทยนะครับ :)
Opendream is proudly to announce that Groovy & Grails training has come to Thailand & ASEAN. Instructed by a long-term Grails contributor using the latest Grails 2.0, students will learn to:

Develop enterprise Web applications using Grails
Understand the architectural concepts and best practices to deliver high quality Grails applications
Inter-operate between Groovy & Java codes
Understand Spring and Hibernate Concepts underpinning Grails

This training will be available in Bangkok, Thailand and the ASEAN area. ท่านที่สนใจสามารถอ่านรายละเอียดได้ที่นี่ครับ Opendream Mitnehmen

Tags:

ผมอยากเรียน Grails & Groovy นะครับ มีใครพอจะเปิดคอร์สสอนในวันเสาร์และวันอาทิตย์ได้บ้างครับ (มีค่าเรียนอย่าแพงมากนะครับ ;p )

ไม่ได้เข้ามา update ข่าวสารของ Grails นานพอควร โดยครั้งนี้ทางทีมพัฒนาปล่อย version 2.o M1 ออกมาให้ใช้งานกัน ซึ่งมี feature ใหม่ๆ ที่น่าสนใจ และ ที่เข้าใจได้ง่ายๆ ดังนี้

1. Grails console ที่ใช้ง่ายขึ้น และมี output ที่เป็นมิตรและดูง่ายมากขึ้น ตัวอย่างดังรูป

และใน Grails console นั้นสามารถใช้ปุ่ม TAB สำหรับ Auto-completion อีกด้วย

2.  มี Reload Agent ซึ่งช่วยลดปัญหาสำหรับการ auto-load classes, jar file ต่างๆ เมื่อมีการเปลี่ยนแปลง  ซึ่งน่าจะช่วยคนพัฒนาได้มากเช่นกัน จะได้ไม่ต้องมานั่ง clean กันเอง และหวังว่าจะไม่กินหน่วยความจำมากไปจนเต็มนะ !!

3. มี Template ของ Document ใหม่ หน้าตาไฉไล ดังรูป

4.  Test Report ใหม่ ดูไฮโซขึ้นเยอะ ดังรูป

 

5. ปรับปรุง error report ต่างๆ ให้ง่ายและเข้าใจได้ง่ายขึ้น ทำให้หาจุดที่ผิดพลาดได้ง่ายขึ้นอีก happy กันไปอีกขั้น

ุ6. ใน version นี้มี default database คือ H2 ซึ่งก็แน่นอนว่ามี Console งามๆ มาให้ใช้งานกันง่ายๆ

7. Feature หลักๆ ใน version นี้ ประกอบไปด้วย ฺBinary plugin, Groovy 1.8 และ Spring 3.1 profile support

8. action ใน Controller สามารถใช้ method ได้แล้ว ซึ่งแต่ก่อนจะสร้างด้วย closure เท่านั้น เช่น

def index() {
}

9. สนับสนุน Servlet Asynchronous ของ Servlet 3.0 แล้ว

10. Scaffolding นั้นสร้างด้วยมาตรฐาน HTML5

11. มี jQuery มาให้ด้วยเลย

Reference Website

 

Tags:

Eros on May 28th, 2011
ตอนนี้ หนูศึกษาจาก web นี้อยู่ค่ะ
http://multi-tenant.github.com/grails-multi-tenant-core/guide/index.html 

ลักษณะงานคือ ต้องการสร้าง server ที่ใช้ได้จากหลายบริษัท
คิดว่าน่าจะทำเป็น Database per บริษัท

โดยใช้ชื่อ URL ต่างกันก้อด้าย เช่น
“company1.blue-eye.com”
“company2.blue-eye.com”

หรือจะทำแบบ check login user ก้อด้าย
หรือทำทั้ง 2 แบบ

======================

หัวข้อที่ 2. Multi-Tenant Modes

หนูเลือกเป็น “singleTenant”

แล้วมันบอกว่า มีวิธี Resolving the DataSource 2 วิธี
1) Mapping DataSources through Config.groovy
2) Mapping DataSources through the database
หนูไม่เข้าใจว่ามันต่างกันยังไง แล้วแบบไหนเหมาะกว่า?

ถ้าใช้วิธีที่ 1
t1 = “jdbc:mysql://localhost/ets_dev1″
t2 = “jdbc:mysql://localhost/ets_dev2″
t3 = “jdbc:mysql://localhost/ets_dev3″
แล้ว URL ที่ใช้เข้าเว็็บจาก “http://localhost:8080/nuch” จะเปลี่ยนเป็นอย่างอื่นรึป่าวคะ?
พอเข้าไปแล้วมันฟ้อง
org.codehaus.groovy.grails.web.mapping.exceptions.UrlMappingException: Error mapping onto view [/index]: Could not decode mapped tenant id from request server name localhost

หรือเพราะโค้ดหนูยังไม่สมบูรณ์?

แล้ว เราต้อง CREATE DATABASE ets_dev1 2 3 เองใช่มั้ยคะ?

แล้ว
//JNDI Example
t1 = “java:comp/env/myDataSource”

ไม่มีได้มั้ยคะ?

==================

หัวข้อที่ 3. Configure a Tenant Resolver

3.1 DNS Resolver Set Up
มี 2 แบบ คือ
1) Mapping subdomains using Config.groovy
2) Mapping subdomains using the database
มันต่างกันยังไง แล้วมีผลต่อ Database กับ URL อย่างไร?

3.2 Acegi Resolver Set Up
เราควรจะลง multi-tenant-acegi ใช่มั้ยคะ?
พอลงแล้ว เราต้องสร้าง class User เองเหรอคะ? เห็นลงแล้วไม่มีให้

แล้ว “userTenantId” จะเป็น 1 or 2  or 3 … ใครเป็นคนกำหนด หรือว่ามันอัตโนมัติ?
แล้วมีโอกาสที่เค้าจะโกหกเพื่อเอาข้อมูลบริษัทอื่นมั้ยคะ?

รู้สึกว่าหนูจะไม่รู้เยอะมาก ต้องขอรบกวนพี่ๆหน่อยนะคะ ><
ขอบคุณค่ะ

 

Tags: , ,

up1 on May 27th, 2011

โดยใน version นี้มีหลายๆ อย่างที่เปลี่ยนแปลง และ ปรับปรุงให้ดีขึ้นมาก ส่วนที่น่าสนใจมีดังนี้

1. มาพร้อม Libraries ต่างๆ ดังนี้

  • Spring Framework 3.1 M1
  • Groovy 1.8
  • Hibernate 3.6
  • Servlet 3.0
  • Apache Tomcat 7.0

2. ฺBinary plugins
3. Reload agent
4. Plugin usage tracking
5. Improve scaffolding UI ให้สนับสนุน HTML5
6. มี Unit Testing ที่ดีขึ้น
7. Abstract Inheritance Support in GORM
8. GORM API now available to Java
9. Include H2 Database Engine เข้ามาเป็น default database แทนที่ HSQL

โดยในแต่ละ features นั้นจะนำมาอธิบายๆ อย่างละเอียดในบทความต่อๆ ไปครับ

Reference Website

 

Tags:

ไปเจอ slide ของ Guillaume Laforge ที่ไป present ในงาน GR8Conf Europe 2011 เลยนำมาบอกต่อครับ น่าสนใจมากๆ เกี่ยวกับ Groovy ครับ

Tags: ,

Eros on May 13th, 2011

ขอคำชี้แนะหน่อยค่ะ เรื่อง transaction ใน service ค่ะ
AnyDomain.withTransaction { … }
มันมีความสามารถในการ rollback แค่ไหนคะ
ทำข้ามหลายๆ service methods กับหลายๆ domain ได้รึป่าว?

อย่างเช่น เรามี 3 methods คือ
newBill( )
newTxaction( )
deleteBill( )
ถ้าเราสั่ง deleteBill( ) แล้วต้องการให้การ save( ) ทั้งหมดใน
newBill( ), newTxaction( ) ไม่ถูก save ในฐานข้อมูล จะทำได้มั้ยคะ?

ขอบคุณค่ะ

Tags: ,

กำลังหัดใช้ groovy และ grails ครับ
แต่ตอนนี้มีปัญหาว่า พอสร้าง Groovy Project ชื่อว่า hello_world เสร็จแล้ว ผมจะไปสร้าง jar file เพื่อมาทดลอง รัน ได้อย่างไรครับ
ช่วยแนะนำด้วยครับ หรืออธิบายให้ด้วยครับ
ขอบคุณมากครับ
siamkom
ปล. ตอนนี้ใช้ eclipse, netbeans และ STS อยู่ครับ