Tuesday, April 26, 2005

JavaBlackBelt

อ่านเจอ site นี้ใน serverside ก็เลยลองเข้าไปใช้บริการดู
เป็น web ที่ให้บริการทดสอบความรู้เราในเรื่องต่างๆ (ของ java)
ลองทดสอบเรื่อง hibernate ดู
ปรากฎว่า 15 ข้อ ตอบถูกไป 11 ได้คะแนน 75 % ถือว่า "Fail"
ไอ้ 4 ข้อที่ตอบไม่ได้ก็เป็นพวก

>In Hibernate 2.1, regarding constructors which of the following POJO class could be used by hibernate in order to store and retrieve your POJO instances ?
# A class that defines a public constructor
# A class that does not explicitely define a constructor
# A class that defines a private constructor with arguments (with all arguments Serializable)
# A class that defines a private no argument constructor

อันนี้ตอบตกไปข้อ ลืมเรื่อง private constructor ไป เพราะไม่เคยใช้

>How to specify composite keys in the Hibernate mapping file ?

ตอบไม่ได้อีกเช่นกัน เพราะใช้แต่ xdoclet ไม่เคยต้องเขียน mapping ด้วยมือ

อีกข้อ 1 อ่านแล้วงงคำถาม ก็เลยไม่ได้ตอบ
ส่วนอีกข้อ จำได้ว่าตอบถูก แต่เฉลยบอกว่าข้อนี้ไม่ได้ tick ตอบไป

ตัว Web Application นี้ใช้ struts, spring, hibernate ทำ
หลังจากเริ่ม post ประกาศตัวใน serverside
ปรากฎว่ามีคนแห่เข้ามาเยอะ ทำให้ server ล่ม
เพราะตัว application ไม่ scaleable
เจ้าคนเขียนเริ่มหงุดหงิด ถึงกับ post ว่า
We started developping using all the nice technologies we know: Servlet/JSP, Struts, Spring DAOs, Hibernate.

But we experienced painful problems and the learning curve was hard.

Between you and me, if we had to do it again in the same conditions, I may not use Hibernate, neither Spring transactions, and probably something else than Struts (maybe PhP ? oups, I've said it !). We'll publish an article later end May and explain how these painful layers have been useful sometimes.


เห็นด้วยนะว่า learning curve นั้นสูง
เวลาที่ต้อง train น้องใหม่ในเรื่องพวกนี้ ไม่รู้ว่าจะเริ่มต้นสอนยังไงดี
ส่วนเรื่องทำ app อย่างไรให้ scaleable อันนี้สิเป็นเรื่องที่ต้อง
พึ่งประสบการณ์(ที่เคยผิดผลาด)
กับต้องใช้ความเข้าใจในภาพรวมและภาพย่อยมากหน่อย

มีคน post เสริมว่า
Java is fast and scallable when used right.
Unfortunatelly, Java developers quite often over-engineer, over-design, over-layer, over-hype, over-complicate...


ผมก็เป็นอีกคนที่เคยทำ over-... มา
(ทำไงได้มันสนุกดีนี่น่า)

ไว้รออ่าน article ในเดือน may กันว่าเขาจะพูดถึงประเด็นไหน

Related link from Roti

No comments: