CoolãªURIã§JSONãè¿ãURLã¯ã©ã表ç¾ããã å é¨çã«ã¯ã/user/get?id=12345&type=jsonãã¨ãªããããªURIï¼idã12345ã®ã¦ã¼ã¶æ å ±ã®JSONå½¢å¼ï¼ããCool URIã§ã¯ã©ã®ããã«è¡¨ç¾ããã®ãé©åãæ©ãã§ãããã/user/json/12345ããã/user/12345/jsonãã¯ãªããéãæ°ããããã ãããããWebãæ¯ããæè¡ -HTTPãURIãHTMLãããã¦REST (WEB+DB PRESSãã©ã¹ã·ãªã¼ãº)ãã«ãã®çããæ¸ãã¦ãã£ãã ä¾ãã°ï¼ã¤ã®ãªã½ã¼ã¹ãHTMLã¨ããã¹ãã¨JSONã§è¡¨ç¾ã§ããå ´åã«ã¯ãããããã.htmlãã.txtãã.jsonãã¨ããæ¡å¼µåãä»ãã¦ããã®è¡¨ç¾ãåããã¨è¯ãã§ãããã ãWebãæ¯ããæè¡ã p.062 å è¿°ã®ä¾ã§è¨ãã°ãã/user/12345.jsonãã¨ãªãããªãã»ã©ç¢ºãã«ããã¯ãã£
ãã¼ã«ã«ã®ã¦ããããã¹ãã§ãcom.google.appengine.api.users.Userã®ã¤ã³ã¹ã¿ã³ã¹ãåå¾ãããã¨ãã¦ããããã©ã«ãã»ã³ã³ã¹ãã©ã¯ã¿ã¯ãã©ã¤ãã¼ãã§ããããUserServiceã®getCurrentUser()ã¡ã½ãããnullãè¿ããããç°¡åã§ã¯ãªãã 以ä¸ã®ãªã³ã¯ãåèã«ããã°ãgetCurrentUser()ã¡ã½ããã§ä»»æã®userIdãæã¤Userã®ã¤ã³ã¹ã¿ã³ã¹ãåå¾ãããã¨ãå¯è½ã Local Unit Testing with UserService: userId==null problem ã¾ããslim3ãå©ç¨ããå ´åã¯ãä¸è¨ã®ããã«tester.environmentããorg.slim3.tester.TestEnvironmentãå©ç¨ãããããã public class UserTest extends AppEngineTestC
ãã¡ãã®ãã¼ã¸ã¯ç§»è»¢ãã¾ããã ãã®åº¦ãæ§ä¼ç¤¾åã·ã¢ãã«ã³ã³ãµã«ãã£ã³ã°æ ªå¼ä¼ç¤¾ããï¼ï¼¥ï¼´ï¼¡ï¼´ï¼¥ï¼¡ï¼æ ªå¼ä¼ç¤¾ã¸ã¨ç¤¾åå¤æ´ããã³ãå¼ç¤¾ã³ã¼ãã¬ã¼ããµã¤ãããªãã¥ã¼ã¢ã«ãããã¾ããã ãã®ãã¼ã¸ã¯5ç§å¾ã«ãæ°ããã³ã¼ãã¬ã¼ããµã¤ãã«èªå転éããã¾ãã é·ç§»ããªãå ´åã¯ãã¡ãã
AppEngineã¯ãã¢ã¯ã»ã¹ããã£ãã¨ãã«ã¢ããªã±ã¼ã·ã§ã³ãèµ·åãããã°ããã¢ã¯ã»ã¹ãç¡ããã°ã¢ããªã±ã¼ã·ã§ã³ãçµäºãããã¾ã次ã®ãªã¯ã¨ã¹ãã§åèµ·åããã¨ããä»çµã¿ãå°å ¥ãã¦ãã¾ãã ãã®ãããã¢ããªã±ã¼ã·ã§ã³ãèµ·å(spin-up)ããæéãã¨ã¦ãéè¦ã«ãªã£ã¦ãã¾ãããã®spin-upã®æéã¯python(webapp)ã§60cpu_ms以ä¸ã(cpu_msã¯cpuã使ãä»®æ³çãªæéã§ããmsã¨åãæãã§æãã¦ããã£ã¦ãã¨ããããã¯å¤§ä¸å¤«ã§ã)Javaã®Servletã ã¨600cpu_msãããã§ããPythonã§ãDjangoãããªå¤§ããªãã¬ã¼ã ã¯ã¼ã¯ã ã¨1000cpu_msããã(ã¢ããªã«ãã)ãããã¾ããã許容ç¯å²å ãJavaã ã¨Slim3ã§1300cpu_msãSpringã ã¨æ©ãã¦7000cpu_msã¨ããæãã§ãSlim3ãã®ãªã®ãªè¨±å®¹ç¯å²å ã§ãããããã»ãã¨ãã¯ã1000
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}