Slim3 Preview release
Slim3ã®æ£å¼ãªãªã¼ã¹ã¯ãæ¥å¹´ã®ä¸æãããã«ãªãããã§ãããããã¥ã¡ã³ããæä½éã®ãã®ã¯ããã£ãã®ã§ãä»ã®æ®µéã®ãã®ãPreviewçã¨ãã¦ç´¹ä»ãã¦ããã¾ãã
ãµã¤ãã¸ã¯ãhttp://slim3.org ã§ã¢ã¯ã»ã¹ãã¦ãã ããã
Getting StartedããããSlim3 Datastoreã®ããã¥ã¡ã³ããèªã¿ãOnline demoãã¿ãã°ãSlim3ã®ãã¨ã¯ææ¡ã§ããããã«ãªã£ã¦ãã¾ãã
Oneline demoããã½ã¼ã¹ãè¦ããããã«ãªã£ã¦ããã®ã§ãåãããªããã½ã¼ã¹ã確èªãããã¨ãã§ãã¾ããOnline demoã¯ãIE6ã§è¦ãã¨ã¬ã¤ã¢ã¦ããå´©ãã¦ãã¾ãããããã¯IE6ã使ããªã¨ããã¡ãã»ã¼ã¸ã¨ãããã¨ã§ã(IE7,8ã§ã¯æªç¢ºèª)
Slim3ã¯ãGoogle App Engineã«å¯¾ãã¦æé©åããã¦ãã¾ãã
ä¾ãã°ãæè¿ãApp Engineã§åé¡ã«ãªã£ã¦ããã®ã¯ãspin upã®æéã§ããspin upã¨ããã®ã¯ãã¢ããªã±ã¼ã·ã§ã³ãèµ·åãããã¨ã§ããããã¾ã§ã®å¸¸èã ã¨ãã¢ããªã±ã¼ã·ã§ã³ã®èµ·åæã«å¤å°æéãããã¦ããªã¯ã¨ã¹ãã®å¦çãæ©ããªããªãããã£ã¡ã®ã»ããåªå
ããã¦ãã¾ããã
ããããApp Engineã§ã¯ãè² è·ã®ç¶æ³ã«ãããã¾ããã2,3åã¢ã¯ã»ã¹ããªãã¨ç´ãã«ã¢ããªã±ã¼ã·ã§ã³ãspin downããã次ã®ã¢ã¯ã»ã¹ã§spin upããã¦ãã¾ãã¾ããspin up(ã¢ããªã±ã¼ã·ã§ã³ã®èµ·å)ã«æéãããããã¬ã¼ã ã¯ã¼ã¯ã¯ãApp Engineã«ã¯åãã¦ãã¾ããã
ã¾ããèµ·åã«æéããããã¨ããªãCPUæéãæ¶è²»ããã®ã§ãè²´éãªãªã½ã¼ã¹ãæ¶è²»(課éã«ãã¤ãªãã)ãã¦ãã¾ãè¸ãã ããã£ããã§ãã
cronã§1,2åãã¨ã«ã¢ã¯ã»ã¹ãããã¨ã§ããç¨åº¦ãspin downã¯é²ãã¾ãããç¡é§ã«CPUãæ¶è²»ããããç¡çããæãããã¾ããããspin upã«æéãããããªããã¨ãApp Engineã§ã¯éè¦ãªã®ã§ãã
Slim3ã¯ããã®ãã¨ãç¥ã£ã¦ããã®ã§ãspin upã®æã«ã¯ã»ã¨ãã©ä½ããã¾ããã
spin upã®ç¹ã§ãAppEngineã«åãã¦ããªã代表ã¯ãSpringã§ããèµ·åã«æéããããããããAppEngine MLã«å¯ãããã¦ããspin upã®åé¡ã®ã»ã¨ãã©ã¯ãSpringã«é¢ãããã®ã§ããSpring3ã®JavaConfig使ãã°ãããç¨åº¦æ¹åããããããããªããã©ã
spin upã¯30ç§ä»¥å ã«çµãããªãããã°ã500 Internal Server Errorã§ããã¾ããspin upä¸ã«æ¬¡ã®ãªã¯ã¨ã¹ããããã¨Queueã«ç©ã¾ãã¾ãããQueueã«ç©ã¾ãã¦10ç§ä»¥å ã«å¦çãããªãã¨ãããã500 Internal Server Errorã§ããspin upãçããããã¨ã¯ãAppEngineã§åããã«ã¯æéè¦èª²é¡ã§ãã
AppEngineã®ãã¼ã¿ã¢ã¯ã»ã¹ã«ã¯ãJDO/JPAã使ãã®ãä¸è¬çã§ãããPersistenceManagerFactory/EntityManagerFactoryã®åæåãã¾ãé
ããã§ãããç¶æ³ã«ããã¨æãã¾ããã3ç§ä»¥ä¸ãããã
spin upã®æã«ãã¼ã¿ã«ã¢ã¯ã»ã¹ãããã¨ãå¤ãã®ã§ããã¶ãã¨ææªã§ãã
JDO/JPAã¯ä½¿ããã¨ãæ¨å¥¨ããã¦ããã«ãããããããAppEngineã«ã¯åãã¦ãã¾ãããã§ã¯ãã©ãããã°ãããã¨ããã¨ãDatastore Low level APIã使ããã¨ã§ããSlim3ã¯ãLow level APIãç´æ¥ä½¿ã£ã¦(JDO/JPAã使ãã)ãBigtableã«ã¢ã¯ã»ã¹ãã¦ãã¾ãã
AppEngineã¸ã®æé©å以å¤ã«ãSlim3ã¯æ¬¡ã®ä¸ã¤ã®ç¹å¾´ãããã¾ãã
- TDD support
- HOT reloading
- Type-safe query
Slim3ã§ã¯ãController, Model, Serviceãä½ãã¨ãã«ããã®TestCaseãåæã«ä½æãã¾ããã¾ããBigtableã«ã¢ã¯ã»ã¹ããå ´åã§ããAppEngineã®æ¹ã§ãããã¨ãã¥ã¬ã¼ãããæ©è½ãããã®ã§ãããã使ããã¢ãã¯ç¡ãã§æ®éã«ãã¹ãã§ãã¾ãã
DIã®ä¸»ãªã¡ãªããã¯ããã¹ãã®ããããã¨å®£è¨çãã©ã³ã¶ã¯ã·ã§ã³ã ã¨æãã¾ãããAppEngineã§ã¯ã¢ãã¯ãªãã§ç°¡åã«ãã¹ããã§ããBigtableã®ä»æ§çã«å®£è¨çãã©ã³ã¶ã¯ã·ã§ã³ã¯ã»ã¨ãã©ä½¿ããªãã®ã§ãAppEngineã§DIã使ãã¡ãªããã¯ä½ããªãããããªããã¨æãã¾ããåã«è¤éã«ãªãã ãã
ããããSlim3ã§DIãã¯ãããçç±ã§ãã
HOT reloadingã¯ãSeasar2ã®HOT deployã¨åãã§ããContainerã使ã£ã¦ãªãã®ã§ãä½åãªãªã¼ãã¼ãããããªãSeasar2ããé«éã«åä½ãã¾ãã
Type-safe queryã¯Bigtableã«å¯¾ãã¦ãS2JDBCã®ããã«ã¢ã¯ã»ã¹ã§ãããã¨ã ã¨æã£ã¦ãã ããããããªæãã
EmployeeMeta e = new EmployeeMeta();
Listlist = Datastore.query(e)
.filter(e.job.equal("ANALYST"), e.salary.greaterThan(5000))
.sort(e.name.asc)
.asList();
JDOã ã¨ãããªæãã
PersistenceManager pm = PMF.get().getPersistenceManager();
Query query = pm.newQuery(Employee.class);
query.setFilter("job == \"ANALYST\") && salary > 5000");
query.setOrdering("name asc");
Listlist = (List ) query.execute();
query.closeAll();
pm.close();
ã¾ããSlim3ã¯ãJDOãããé«éã«åä½ãã¾ããä¾ãã°ã10000件ã®ãã§ããã ã¨3å以ä¸é«éã«åä½ãã¾ãã
Online demoã§å®éã«ç¢ºãããã¨å®æããããã§ãããã
Slim3ã¯ãããã©ã¼ãã³ã¹çã«ã¯ããã¶ãGAE/Jã®ä¸ã§ã¯æéããªããã¨ããã¨ãServlet層ã¯ãããªãèãã©ããã¼ãªã®ã§ãªã¼ãã¼ããããã»ã¨ãã©ãªããDatastore層ã«é¢ãã¦ã¯ãEntityã¨Modelã®mappingãã©ã³ã¿ã¤ã æã«ãªãã¬ã¯ã·ã§ã³ã使ãã®ã§ã¯ãªããã³ã³ãã¤ã«æã«ç´æ¥ã½ã¼ã¹ã³ã¼ãã«æ¸ãåºãã¦ããã®ã§ãä½åãªãªã¼ãã¼ããããã»ã¨ãã©ãªãããã
詳ããã¯ãhttp://sites.google.com/site/slim3appengine/slim3-datastore/defining-data-classes/meta-data-of-model
ãã以ä¸éãããæ¹æ³ããç§çã«æãã¤ããªãã ãã§ããã£ã¨èª°ããããé«éãªæ¹æ³ãæãã¤ãã¨æãã¾ããã
é«éåã§ç´ãã«æãã¤ãã®ã¯memcacheã使ããã¨ã§ãããmemcacheã«ãããã£ãã·ã¥ã¯ããã¬ã¼ã ã¯ã¼ã¯ã«çµã¿è¾¼ããããã¢ããªã±ã¼ã·ã§ã³å´ã§ã³ã³ããã¼ã«ããã»ããããããããã¨æã£ã¦ãã¾ãã
Slim3ã®å
¬å¼ããã¥ã¡ã³ãã¨ãã¦ã¯è±èªã®ã¿ã¨ãªãã¾ãããæ¥æ¬èªã®æ
å ±ã¨ãã¦ã¯ãgluegentããã®Song of Cloudã«åãä¸ããããããã¦ããã®ã§ãå®æçã«ãã§ãã¯ãã¦ã¿ãã¨ããã®ã§ã¯ãªãã§ãããããAppEngineã®ã¤ã£ããã æ
å ±ãæºè¼ã§ãã
http://songofcloud.gluegent.com/2009/11/slim3-datastore1.html
http://songofcloud.gluegent.com/2009/11/slim3-datastore2.html
http://songofcloud.gluegent.com/2009/11/slim3-datastore3.html
ãªã«ãããããªããã¨ãããã°ãtwitterã« #slim3 ã #appengine ãtagã¨ãã¦æ¸ãè¾¼ãã°èª°ããåå¿ãã¦ãããããããªããã¨æãã¾ããSlim3åºæã®ãã¨ã¯#slim3ãSlim3ãAppEngineãè¿·ã£ãã¨ãã¯#appengineã140åãè¶ ããå ´åã¯ãhttp://groups.google.co.jp/group/slim3-user-japan ã¸ã