Slim3 for Google App Engine/Java
Slim3ãGAE/Jã«å¯¾å¿ããã¾ããã
ãã¢ãµã¤ãã¯ãã¡ãã
http://higayasuo.appspot.com/
ã½ã¼ã¹ã³ã¼ãããã§ãã¯ã¢ã¦ããããå ´åã¯ãã¡ãã
http://code.google.com/p/slim3/source/checkout
https://slim3.googlecode.com/svn/ãæå®ãã¦ãã§ãã¯ã¢ã¦ãã§ãã¾ãããã¢ç¨ã®ããã¸ã§ã¯ãã¯ãslim3-demoã§ãã
SAStrutsã®ãã¥ã¼ããªã¢ã«ããã£ããã¨ã®ãã人ãªãããã¢ãµã¤ããããã£ããã ã¨ãããã¨ããããã§ããããSlim3 Struts(SAStrutsç¸å½)ãGAE/Jã§åãããã§ãã
ç´ ã®Strutsã ã¨GAEã§ã¯ãã¡ã¤ã«ã¢ãããã¼ãã«å¤±æãã¾ãããSlim3 Strutsã¯ãã®è¾ºã対å¿ãã¦ã¾ãã
ãã£ã¦ã¿ã¦æããã®ã¯ãGAE/Jã¯ãå¶éãçµæ§å³ããã®ã§ãé«åº¦ãªãã¬ã¼ã ã¯ã¼ã¯ã§ããã°ããã»ã©åä½ããªãããããªãããªãã¾ãããã¼ã«ã«ã®éçºãµã¼ãã§åãã¦ããã¯ã©ã¦ãä¸ã§ã¯åããªãã£ãããããã¨ãå¤ãã®ã§ãè¤éãªãã¬ã¼ã ã¯ã¼ã¯ã¯ãåµããããã¨æãã¾ãã
ã¯ã©ã¦ãä¸ã§ãã¾ãåããªãã¨ãã¯ãåå ã追究ããã®ãããªãé£ããã®ã§ãè¤éãªãã¬ã¼ã ã¯ã¼ã¯ã¯é¿ããã»ããç¡é£ã§ãã
Slim3ã§ã¯ãDIã¨AOPãåãã¾ããããã£ããé«éãªå®è£
ãã§ãããã ãã©ãåµããã¡ãªæ©è½ã¯åºæ¬çã«é¿ããã¹ãã«å®è£
ããã»ããããã¨æãã¾ãã
ãã¤ãã£ãã®ã¯ãThread#setContextClassLoader()ã使ããªããã¨ãSlim3ãå¾æã®HOT deployã使ãã¾ãããææ°ã®Slim3ã§ã¯ãã¢ã¯ã·ã§ã³ã¯ã©ã¹ã®ã¿HOT deployã使ããããã«ãªã£ã¦ãã¾ãããã®ã»ãããClassCastExceptionãªã©ãçºçãããã¨ããªããããããããã¦åµãã«ããããªã¨æã£ã¦ãã¾ãã
ãã¼ã«ã«ã®éçºãµã¼ãã§ããDEBUGã¢ã¼ãã§ç«ã¡ä¸ããã°ãHOT deployã£ã½ããã¨ãã§ãã¾ãããããã¯ãJava Platform Debugger Architecture (JPDA) ãå¤å使ã£ã¦ãã¦ãHOT deployã§ããã®ã¯ãããªãéå®çãªæä½ã ããªã®ã§ãHOT deployã«ãªãã¨ãã¨ãªããªãã¨ãã®å¤æãé£ãããåµããããã¨æãã¾ãã
ãã¼ã¿ã¢ã¯ã»ã¹ã¯ãBigTableã使ãã®ã§ãããã¾ã§ã®O/R Mapperã¯å½¹ã«ç«ããªãããããããRDBMSã¨åãèããæã¡è¾¼ãã¨å¤±æãã¾ããã¯ã©ã¦ãä¸ã®ã¢ããªã³ã°ã¯ããã¾ã§ã¨ã¾ã£ããéããã®ã§ãã
ãããããJDOã使ã£ããã¿ã¤ãã»ã¼ããªæµãããããªã¤ã³ã¿ã¼ãã§ã¼ã¹ã使ããã¼ã¿ã¢ã¯ã»ã¹ãã¬ã¼ã ã¯ã¼ã¯ãä½ãäºå®ãSQLãã¡ã¤ã«ã¯ãã¡ãããªããBigTableç¨ã®JDOã¯ãè¤éãªãã¨ãã§ããªãã®ã§ããã¹ã¦ã¿ã¤ãã»ã¼ããªæµãããããªã¤ã³ã¿ã¼ãã§ã¼ã¹ã§å®è£
ãããã¨ãã§ãã¾ãã
ãããªæãããªã
EmployeeMeta e = new EmployeeMeta(); List<Employee> list = JDO.from(Employee.class) .where(e.id.eq(1), e.name.contains("A")) .orderBy(e.id.asc, e.name.desc) .getResultList(); Employee emp = new Employee(); emp.setName("Hoge"); JDO.makePersistenceWithTransaction(emp); JDO.deletePersistenceWithTransaction(emp); JDO.transaction(new TransactionCallback<Void>() { ... });
BigTableã¯ãã¹ãã¼ãããªãã®ã§ãã¨ã³ãã£ãã£ã¯ã©ã¹ããã¡ã¤ã³ã®ä¸å¿ã«ãªãã¾ãããã¸ãã¹ãã¸ãã¯ã¯ãã¨ã³ãã£ãã£ã«æ¸ããã»ããããã§ããããã
åºæ¬ã¯ãã¢ã¯ã·ã§ã³ã¨ã¨ã³ãã£ãã£ã§ãã¢ã¯ã·ã§ã³ããJDOãç´ã«å¼ã¶ã®ã§DIã¯ããå¿
è¦ãªãã®ã§ãã
ã¨ã³ãã£ãã£ã®ã¡ã¿ã¯ã©ã¹ã¯ãantãããã¯Eclipseã®ãã©ã°ã¤ã³ã§èªåçæããäºå®ã§ããJDOã®enhancerã¨åãæãããªã¨æã£ã¦ãã¾ãã
ã¯ã©ã¦ãã¯ããºã¯ã¼ãã§ä¿ºã«ã¯é¢ä¿ãªãã¨æã£ã¦ãããã©ãGAE/Jãåºã以ä¸å
é ãèµ°ããªãã¨ãã
GAE/Jã¯ãç ´å£çãªæè¡ã«ãªãå¯è½æ§ãããã¾ããã¯ã©ã¦ãä¸ã®å¢åå³ã¯ãããã¾ã§ã¨ã¾ã£ããéããã®ã«ãªãã§ãããã
Slim3ã®ããã¸ã§ã¯ããGoogle Codeä¸ã«ä½ã£ã¦ã¿ãã®ã¯ãGAEç¨ã®ããã¸ã§ã¯ããªã®ã§ããã®ã»ããèªç¶ããªã¨æã£ãããã§ããå¥ã«Slim3ãSeasar foundationããæããããã§ã¯ãªãã®ã§ãå¿é ãªãã
追è¨:ä»åã®Slim3 for GAE/Jã¯ãSlim3ã®æ¬æµã§ããSlim3ãåºã¦ãSeasar2ã®ã¦ã¼ã¶ãè¿·ãã®ã¯ã§ããã ãé¿ãããã£ãã®ã§ãã¯ã©ã¦ãã¯Slim3ãããã¾ã§ã®ãããªéçºã¯Seasar2ã¨ãã使ãåãã§ããã®ã§ã¯ãªããã¨æã£ã¦ãã¾ãã
ãã¾ãã¾ã§ããããã¾ã使ãåãã§ããå½¢ã«ãªãã¾ãããã
ä¸å¿ãSlim3 Strutsã¯ãGAE/Jã«ä¾åãã¦ããããã§ã¯ãªãã®ã§ãé常ã®Strutsã®éçºã«ã使ããã¨ã¯ã§ãã¾ãããSAStrutsã¯ä½¿ããããã ãã©DIã¨ãã¯ã¡ãã£ã¨ããã¹ããã¨ãæã£ã¦ãã人ã«ã¯åãã¦ã¾ããã