Super Agile Web Development with Seasar2
Seasar Conferenceã§ã¯ãç§ã2ã¤ã®ã»ãã·ã§ã³ã§ã話ãã¾ãã
Seasar2.4
Seasar2.4ã®ã»ãã·ã§ã³ã§ã¯ï½¤ãã¼ã¸ã§ã³2.4ã®æ大ã®ç®çã§ããSMART deployãä¸å¿ã«ã話ãã¾ããSMART deployã¨ã¯ãããã¸ã§ã¯ãã®ä½ææã«è¨å®ãã¡ã¤ã«ã®åæè¨å®ãæ¸ã¾ããå¾ã¯ï½¤ä¸åè¨å®ãã¡ã¤ã«ãããããã¨ãªãéçºãé²ãããã¨ã®ã§ããæ©è½ã§ããåæè¨å®ã§å¿
è¦ãªã®ã¯ãããã¸ã§ã¯ãã®ã«ã¼ãããã±ã¼ã¸ã¨ãã¼ã¿ãã¼ã¹ã¸ã®æ¥ç¶æ
å ±ãããã§ãã
- examples.chura
- examples.chura.dao
- examples.chura.util
ã®ãããªããã±ã¼ã¸æ§æã®å ´å、examples.churaãã«ã¼ãããã±ã¼ã¸ã«ãªãã¾ããã«ã¼ãããã±ã¼ã¸é
ä¸ã®ããã±ã¼ã¸æ§æã¯ï½¤è¦ç´ã«ãã£ã¦æ±ºãããã¦ãããã、è¨å®ãã¡ã¤ã«ç¡ãã§Seasar2ããããã(ã¹ãã¼ãã«)ãããã¤ãã¦ããã¾ãã
SMART deployã«ã¯ã
- HOT
- WARM
- COOL
ã®3種é¡ãããã¾ããã¢ããªã±ã¼ã·ã§ã³ãµã¼ãã®ãªãã¼ãç¡ãã«ã¯ã©ã¹ã®å¤æ´ãHOTã«èªèã§ããHOT deployãæãããããã®æ©è½ã«ãªãã¾ãããã ããHOTã ã¨è¥å¹²ããã©ã¼ãã³ã¹ãå£åãã¦ãã¾ãã®ã§ï½¤HOTã«èªèã¯ãããªãããã©ï½¤ã¢ããªã±ã¼ã·ã§ã³ã®èµ·åæã«ãã¹ã¦ããããã¤ãã¦ããã©ã¼ãã³ã¹ã確ä¿ããã®ãCOOL deployã§ããWARM deployã¯ãã®ä¸éã
詳ããã¯ãã»ãã·ã§ã³ã§ã
Super Agile Web Development with Seasar2
Seasar2.4ã«ã¤ãã¦ã¯ãæ¢ã«ããç¨åº¦æ
å ±ãåºã¾ã£ã¦ããã¨æãã¾ãã、å®ã¯ï½¤æ¥µç§ã«éçºããã¦ãããããã¯ã群ãããã¾ãã
ããããChuraã
Churaã«ã¯ã
- Super Agile
- ã½ã¼ã¹ã³ã¼ããè¨å®ãã¡ã¤ã«ã®éãæ¿æ¸ããããã¨ãå¾¹åºçã«è¿½åãããã®ã
- Easy Enterprise
ã®2ã¤ã®ã¹ã¿ã¤ã«ãããã¾ãã
ç§ã話ãã®ã¯Super Agileãå°æããã話ãã®ãEasy Enterpriseã®ã»ãã§ãã
Super Agileã§ã¯ãJavaã ãã§ãªããã©ã®è¨èªã®ãã¬ã¼ã ã¯ã¼ã¯ã¨æ¯ã¹ã¦ããããããã£ã®ãããªè¨èªçãªé¨åãã®ããã°ãæãã½ã¼ã¹ã³ã¼ããæ¸ããã«ãããããã¨ãå®ç¾ã§ããã®ã§ã¯ãªããã¨æãã¾ãã(ãã¡ããããã¹ã¦ã«ããã¦æãå°ãªãããã§ã¯ãªã、å¾æä¸å¾æã¯ããã¨æãã¾ãã)
ã¾ã ã¾ã ãèåãã§ãã、å®éã«è©¦ããã¨ãã§ãã¾ãããã®æåãªRailsã®scaffoldã¨åæ§ã®ãã¨ããã£ã¦ã¿ã¾ããããã»ããã¢ããæé ã¯æ¬¡ã®ã¨ããã§ãã
- JDK1.5ãã¤ã³ã¹ãã¼ã«ããã
- Eclipse3.1 or 3.2ãã¤ã³ã¹ãã¼ã«ããã
- Tomcat 5.5ç³»ãã¤ã³ã¹ãã¼ã«ããã
- Tomcat Plugin 3.1ãã¤ã³ã¹ãã¼ã«ããã
- Doltengã¨Diiguãã¤ã³ã¹ãã¼ã«ããã
- Eclipseã§ä¸è¨ã®Updateãµã¤ãããã¤ã³ã¹ãã¼ã«ãã¦ãã ããã
Eclipseã®ã¡ãã¥ã¼ããFile -> New -> Projectãé¸ã³ã¾ãããã¤ã¢ãã°ã表示ãããã®ã§ãChura Projectãé¸æãã¾ãã
Nextã®ãã¿ã³ãã¯ãªãã¯ãã¦ãã ãããPackage nameã«chura-example2ãRoot Package Nameã«examples.churaã¨å
¥åããJREã³ã³ããã¼ãUse Default JRE(1.5)ã«ãªã£ã¦ãããã¨ã確èªãã¾ããProject typeã«Teeda + Uujiãé¸æããFinishãã¯ãªãã¯ãã¦ãã ãããchura-example2ã®ããã¸ã§ã¯ããä½æããã¾ãã
ããã¸ã§ã¯ããå³ã¯ãªãã¯ãã¦ãTomcatããã¸ã§ã¯ã -> Tomcatã®ã³ã³ããã¹ããæ´æ°ãé¸æãã¾ããããã§éçºãå§ããããã®å¿
è¦ãªè¨å®ã¯å®äºãã¾ãããç´ãã«éçºãã¯ãããããããã«HSQLDBãã¤ã³ã¹ãã¼ã«ããã¦ãã¾ããã¡ãã¥ã¼ããTomcat -> Tomcatèµ·åãé¸æãã¦ãTomcatãç«ã¡ä¸ãã¾ããHOT deployã§éçºããã®ã§ãã¢ããªã±ã¼ã·ã§ã³ãµã¼ããèµ·åããã¾ã¾ã§éçºãããã¨ãå¯è½ã§ãã
ããã§ã¯ãscaffoldãä½æãã¾ããEclipseã®ã¡ãã¥ã¼ããWindow -> Show View -> Other... -> Dolteng -> DatabaseViewãé¸æãã¾ãã
DatabaseViewã«chura-example2ã®ããªã¼ã表示ãããjdbc.diconãè¦ããã¯ãã§ããDoltengã¯ãSeasar2ã®diconãã¡ã¤ã«ãå©ç¨ãã¦ããã¼ã¿ãã¼ã¹ã«æ¥ç¶ãã¦ããã¾ãããã¡ãã¡Pluginç¨ã«è¨å®ããå¿
è¦ã¯ãªãã®ã§ãã
jdbc.diconãå±éããã¨INFORMATION_SCHEMAã¨PUBLICã¨ãããã©ã«ã(?)ãè¦ããã¯ãã§ããPUBLICãããã«å±éãã¦ãã ãããDEPTã¨EMPãã¼ãã«ãè¦ããã¯ãã§ããEMPãã¼ãã«ãå³ã¯ãªãã¯ãã¦ãGenerate Scaffold Applicationããé¸æãã¦ãã ãããããã§ãscaffold(è¶³å ´)ãã§ãã¾ããã
ãã©ã¦ã¶ããhttp://localhost:8080/chura-example2/view/emp/empList.htmlã«ã¢ã¯ã»ã¹ãã¦ãã ããã
ãããªããExcelã®ããã«ååºå®ï½¤è¡åºå®ããããã¼ãã«ãè¦ããã¯ãã§ããTeedaã使ãã°ï½¤ãããªãã¨ã¯ç°¡åã§ããå³ã«ã¹ã¯ãã¼ã«ããã¨Edit, Delete, Inquireã¨ãããªã³ã¯ãè¦ããã®ã§å¾ã¯ï½¤å¥½ãã«ããã£ã¦ãã ããã
æãåå、scaffoldãããã£ãã、次ã¯ããã¼ã¿ãã¼ã¹ã«ã¢ã¯ã»ã¹ããDaoãè¦ã¦ã¿ã¾ããããexamples.chura.dao.EmpDaoãéãã¦ãã ããã
ããã ã(å®éã«ã¯ãpackage宣è¨ãimportããããã©)ã§ããæ±ç¨çã«ãã¼ãã«ã«ã¢ã¯ã»ã¹ããã ããªã、interfaceã®å®£è¨ã ãã§ï½¤ä¸åãã¸ãã¯ãæ¸ãå¿ è¦ã¯ããã¾ããã
public interface EmpDao extends GenericDao {
}
ãããå®ç¾ãã¦ããã®ã、Uuji(ãã¼ã)ã¨å¼ã°ããæ°ãã¬ã¼ã ã¯ã¼ã¯ã§ãã
å½æ¥ã¯ï½¤Uujiãå«ãã¦ãSuper Agileãªéçºã®ä»æ¹ãã話ãã¾ãã