Slim3 Gwt In Action

2,784 views
2,652 views

Published on

#kanjava Apr 7 2010

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,784
On SlideShare
0
From Embeds
0
Number of Embeds
124
Actions
Shares
0
Downloads
30
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Slim3 Gwt In Action

  1. 1. Slim3 + GWT in Action Go Tanaka Thursday, April 8, 2010
  2. 2. Thursday, April 8, 2010
  3. 3. Introduction Thursday, April 8, 2010
  4. 4. Introduction Thursday, April 8, 2010
  5. 5. - - http://d.hatena.ne.jp/nowokay/20100305 Thursday, April 8, 2010
  6. 6. Thursday, April 8, 2010
  7. 7. http://www.ipa.go.jp/about/research/2009cloud/pdf/100324_cloud.pdf Thursday, April 8, 2010
  8. 8. Thursday, April 8, 2010
  9. 9. Google App Engine? Thursday, April 8, 2010
  10. 10. Google App Engine? Thursday, April 8, 2010
  11. 11. Google App Engine? Thursday, April 8, 2010
  12. 12. Google App Engine? Thursday, April 8, 2010
  13. 13. Google App Engine? Thursday, April 8, 2010
  14. 14. Google App Engine? Thursday, April 8, 2010
  15. 15. Google App Engine? API API URL API API Memcache API Thursday, April 8, 2010
  16. 16. Google App Engine? Thursday, April 8, 2010
  17. 17. GWT? Thursday, April 8, 2010
  18. 18. GWT? Thursday, April 8, 2010
  19. 19. GWT? Thursday, April 8, 2010
  20. 20. GWT? Thursday, April 8, 2010
  21. 21. GWT? Thursday, April 8, 2010
  22. 22. GWT? http://www.youtube.com/watch?v=uExEw3OVMd0 Thursday, April 8, 2010
  23. 23. GWT? Thursday, April 8, 2010
  24. 24. GWT? Thursday, April 8, 2010
  25. 25. GWT? Thursday, April 8, 2010
  26. 26. GWT? Thursday, April 8, 2010
  27. 27. GWT? Thursday, April 8, 2010
  28. 28. GWT? Thursday, April 8, 2010
  29. 29. GWT? Thursday, April 8, 2010
  30. 30. GWT?     Button b = new Button("Click me", new ClickHandler() {       public void onClick(ClickEvent event) {         GWT.runAsync(new RunAsyncCallback() {           public void onFailure(Throwable caught) {             Window.alert("Code download failed");           }           public void onSuccess() {             Window.alert("Hello, AJAX");           }         });       }     }); Thursday, April 8, 2010
  31. 31. GWT? Thursday, April 8, 2010
  32. 32. GWT? Thursday, April 8, 2010
  33. 33. GWT? Thursday, April 8, 2010
  34. 34. GWT? http://code.google.com/p/google-web-toolkit-incubator/ Thursday, April 8, 2010
  35. 35. Slim3 Spin Up HOT reloading JDO, JPA Global Transaction Thursday, April 8, 2010
  36. 36. Slim3 HOT reloading Slim3 Controller Validation Global Transaction Slim3 DataStore Slim3 JSP Thursday, April 8, 2010
  37. 37. Slim3 Thursday, April 8, 2010
  38. 38. HOT reloading Thursday, April 8, 2010
  39. 39. HOT reloading ClassCastException IllegalAccessException Thursday, April 8, 2010
  40. 40. HOT reloading HOT reloading Slim3 CoolBridge Thursday, April 8, 2010
  41. 41. HOT reloading Bootstrap • Bootstrap classes of your JVM System • System class loader classses • /WEB-INF/classes of your web application Common • /WEB-INF/lib/*.jar of your web application • $CATALINA_HOME/lib Application • $CATALINA_HOME/lib/*.jar Tomcat6 http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html Thursday, April 8, 2010
  42. 42. HOT reloading Bootstrap HotReloadingClassLoader →Request System ※Cool Common Request Application HotReloadingClassLoader HotReloadingClassLoader Request Thursday, April 8, 2010
  43. 43. HOT reloading Static Bootstrap Web HOT reloading System HOT reloading Common COOL cool Application HotReloadingClassLoader ※ Thursday, April 8, 2010
  44. 44. HOT reloading Bootstrap COOL HOT reloading ClassCastException System Web Application Common HotReloadingClassLoader Application COOL HOT reloading CoolBridge HotReloadingClassLoader Thursday, April 8, 2010
  45. 45. HOT reloading cool Interface Interface HOT reloading “.cool” CoolBridge Thursday, April 8, 2010
  46. 46. HOT reloading COOL interface HOT reloadable implementation class package root.cool.service; package root.service; public interface EeeService { import root.cool.service.EeeService;    void foo(); } public class EeeServiceImpl implements EeeService {     public void foo() {         Bbb bbb = new Bbb();         ...     } } EeeService service = CoolBridge.create(EeeService.class); service.foo(); http://sites.google.com/site/slim3documentja/documents/hot-reloading Thursday, April 8, 2010
  47. 47. HOT reloading HOT reloading ClassCastException IllegalAccessException CoolBridge Thursday, April 8, 2010
  48. 48. *.gwt.xml entry-point Service Slim3 Validation Slim3 DataStore Thursday, April 8, 2010
  49. 49. Web Application Project Slim3 Google Code (http:// code.google.com/p/slim3) Slim3-blank- x.x.x.zip Zip Java Build Path, Factory Path, web.xml Thursday, April 8, 2010
  50. 50. Factory Path Meta http://sites.google.com/site/slim3documentja/getting-started/getting-blank-project Thursday, April 8, 2010
  51. 51. GWTServiceServlet <servlet> <servlet-name>GWTServiceServlet</servlet-name> <servlet-class>org.slim3.gwt.server.rpc.GWTServiceServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>GWTServiceServlet</servlet-name> <url-pattern>*.s3gwt</url-pattern> </servlet-mapping> Thursday, April 8, 2010
  52. 52. <inherits name='org.slim3.gwt.emul.S3Emulation' /> ※ S3Emulation client Key Thursday, April 8, 2010
  53. 53. Thursday, April 8, 2010
  54. 54. Service Thursday, April 8, 2010
  55. 55. Service Thursday, April 8, 2010
  56. 56. Service build.xml Run As ... -> Ant build Target gen-gwt-service Thursday, April 8, 2010
  57. 57. Service Thursday, April 8, 2010
  58. 58. Service GWT GWT S3Emulation inherit source- path Thursday, April 8, 2010
  59. 59. Service Enum name Thursday, April 8, 2010
  60. 60. Service IsSerializable Serializable final, transient GWT1.5 GWT2.0 Thursday, April 8, 2010
  61. 61. Slim3 Validation ByteTypeValidator, DateTypeValidator, DoubleTypeValidator, FloatTypeValidator, IntegerTypeValidator, LongTypeValidator, NumberTypeValidator, ShortTypeValidator DoubleRangeValidator, LongRangeValidator MaxlengthValidator, MinlengthValidator, RegexpValidator, RequiredValidator Thursday, April 8, 2010
  62. 62. Slim3 Validation Controller Validators v = new validators(request); v.add(“arg1”, v.required(), v.maxlength(200)); if(v.validate()){ // OK } Service Map<String, Object> params = // Dto Map Object // Service Errors params.put(ControllerConstants.ERRORS_KEY, new Errors()); v.add(“arg1”, v.required(), v.maxlength(200)); if(v.validate()){ // OK } Thursday, April 8, 2010
  63. 63. Slim3 Validation AbstractValidator getMessageKey() validate() Validators Thursday, April 8, 2010
  64. 64. Slim3 Validation AbstractValidator import org.slim3.controller.validator.AbstractValidator; public class BooleanValidator extends AbstractValidator { } Thursday, April 8, 2010
  65. 65. Slim3 Validation getMessageKey() Validation ※ Constructor application(_locale).properties ( ) @Override protected String getMessageKey() { return "validator.xxxxx"; } Thursday, April 8, 2010
  66. 66. Slim3 Validation validate() String null public String validate(Map<String, Object> parameters, String name) { if(// ){ if (message != null) { return message; } return ApplicationMessage.get(getMessageKey(), getLabel(name)); } return null; } Thursday, April 8, 2010
  67. 67. Slim3 Validation getMessageKey() validator.required={0} is required. validator.xxxxx={0} is xxxxx. label.arg1=ARG_1 Thursday, April 8, 2010
  68. 68. Slim3 Validation Validators public BooleanValidator condition(boolean condition){ return new BooleanValidator(condition); } Thursday, April 8, 2010
  69. 69. Slim3 DataStore DataStore.put() DataStore DataStore GAE Thursday, April 8, 2010
  70. 70. Slim3 DataStore Thursday, April 8, 2010
  71. 71. Slim3 DataStore Google App Engine Transaction Slim3 Global Transaction Transaction Entity Group Transaction Slim3 Global Transaction ※ Entity Group Transaction Global Transaction Thursday, April 8, 2010
  72. 72. GWT Java HTML5 GAE/J Slim3 DataStore Thursday, April 8, 2010
  73. 73. Thursday, April 8, 2010
  74. 74. Thursday, April 8, 2010

×