T2 framework T2 project http://t-2.googlecode.com/ Shinpei Ohtani(shot6)
Agenda <ul><li>Introduce myself and the team </li></ul><ul><li>An overview of T2 framework </li></ul><ul><li>Current web d...
Introduce myself <ul><li>Shinpei Ohtani </li></ul><ul><li>Open source programmer </li></ul><ul><ul><li>Java/ActionScript/J...
Introduce the T2 team <ul><li>The team are: </li></ul><ul><ul><li>5 committers </li></ul></ul><ul><ul><li>All professional...
Web development situation <ul><li>The time for web application re-invented </li></ul><ul><ul><li>RIA is no more new thing,...
RIP –Rich Internet Platform- <ul><li>RIA to RIP(Rich Internet Platform) </li></ul><ul><ul><li>RIP  is the platform to supp...
Cloudability <ul><li>Cloudability </li></ul><ul><ul><li>Ability to work well at cloud environment </li></ul></ul><ul><ul><...
HTTP matters <ul><li>HTTP/HTTPS it the protocol </li></ul><ul><ul><li>The unified protocol for next generation apps </li><...
To the next level web apps <ul><li>Choose good/simple framework that has some features for: </li></ul><ul><ul><li>RIP </li...
What is T2 framework <ul><li>Simple and modernized java web framework for real developer </li></ul><ul><ul><li>Easy to use...
The big picture Browser HTTP POST JavaScript Client XmlHttp Request Flex/AIR AMF REST-like Client PUT /hoge/foo POJO POJO ...
The motivation <ul><li>The motivation </li></ul><ul><ul><li>All of Java webframework is too difficult to use and maintain ...
The motivation(cont’d) <ul><li>Web framework: </li></ul><ul><ul><li>should be  much more simple . </li></ul></ul><ul><ul><...
The concept <ul><li>Concept </li></ul><ul><ul><li>Do one thing well </li></ul></ul><ul><ul><ul><li>T2 just connects betwee...
The target user <ul><li>Who should use T2? </li></ul><ul><ul><li>Developers who’d like to: </li></ul></ul><ul><ul><ul><li>...
Programming model <ul><li>Page model </li></ul><ul><ul><li>All of T2 application uses page model </li></ul></ul><ul><ul><l...
Programming model(cont’d) <ul><li>Example: </li></ul><ul><li>@Page(&quot;employee&quot;) </li></ul><ul><li>public class Em...
Action method design <ul><li>Funnel-like design </li></ul><ul><ul><li>Page class is created as you put url and its paramet...
Action method design(cont’d) <ul><li>Example: HTTP GET /hoge/foo?bar=2 </li></ul><ul><ul><li>Page class takes /hoge as url...
Action parameter design <ul><li>Action parameter is injected by T2 </li></ul><ul><ul><li>T2 prepared contexts </li></ul></...
Take a look code! <ul><li>@Page(”sample&quot;) </li></ul><ul><li>public class SamplePage { </li></ul><ul><li>@Default </li...
Core components <ul><li>@Page </li></ul><ul><li>HTTP handling using @GET/@POST </li></ul><ul><li>URL pattern matching by @...
@Page <ul><li>The root annotation for T2 Page </li></ul><ul><ul><li>Page must have @Page. </li></ul></ul><ul><ul><li>T2 do...
HTTP matching <ul><li>HTTP matching is the first thing T2 does for action methods </li></ul><ul><ul><li>GET, POST, PUT, DE...
URL matching for action method <ul><li>URL matching for action method </li></ul><ul><ul><li>@ActionPath is the main role t...
Data matching for action method <ul><li>Data matching for action method </li></ul><ul><ul><li>@ActionParam is the main rol...
Request type matching <ul><li>T2 can separate methods for request type. </li></ul><ul><ul><li>@Ajax </li></ul></ul><ul><ul...
Default method for a page <ul><li>Default method is always good to have. </li></ul><ul><ul><li>At least some odd error doe...
Navigation <ul><li>Navigation is the user interface for: </li></ul><ul><ul><li>Telling T2 where the transition goes </li><...
Default prepared navigations <ul><li>Default navigations </li></ul><ul><ul><li>Forward/Redirect/Proceed(Psuedo redirect) <...
ContainerAdapter <ul><li>Dependency Injection is the defacto technology for easy and maintainable development </li></ul><u...
Demos <ul><li>RIA type demo </li></ul><ul><ul><li>PureMVC + T2 + Spring + iBatis </li></ul></ul><ul><ul><li>Complete sampl...
Conclusion <ul><li>Web development will be re-invented by: </li></ul><ul><ul><li>RIP, mostly HTML5 </li></ul></ul><ul><ul>...
Resources <ul><li>Site </li></ul><ul><ul><li>http://code.google.com/p/t-2/ </li></ul></ul><ul><li>Download </li></ul><ul><...
Resources(cont’d) <ul><li>Documents </li></ul><ul><ul><li>http://code.google.com/p/t-2/wiki/Index </li></ul></ul><ul><li>M...
Thanks!!
Upcoming SlideShare
Loading in …5
×

T2 Web Framework

2,229 views

Published on

T2 webframework is simple and modernized java webframework for web2.0 environment.This presentaion tells you the new web development situation is coming to us and how we solve by T2 webframework.

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,229
On SlideShare
0
From Embeds
0
Number of Embeds
126
Actions
Shares
0
Downloads
16
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

T2 Web Framework

  1. 1. T2 framework T2 project http://t-2.googlecode.com/ Shinpei Ohtani(shot6)
  2. 2. Agenda <ul><li>Introduce myself and the team </li></ul><ul><li>An overview of T2 framework </li></ul><ul><li>Current web development situation </li></ul><ul><li>T2 architecture and mechanism </li></ul><ul><li>Demos </li></ul><ul><li>Conclusion </li></ul>
  3. 3. Introduce myself <ul><li>Shinpei Ohtani </li></ul><ul><li>Open source programmer </li></ul><ul><ul><li>Java/ActionScript/JavaScript/C#... </li></ul></ul><ul><li>Works at ISI Dentsu, Ltd </li></ul><ul><li>Blog </li></ul><ul><ul><li>http://d.hatena.ne.jp/shot6/ (Japanese) </li></ul></ul><ul><li>Twitter </li></ul><ul><ul><li>http://twitter.com/shot6/ </li></ul></ul>
  4. 4. Introduce the T2 team <ul><li>The team are: </li></ul><ul><ul><li>5 committers </li></ul></ul><ul><ul><li>All professional programmer, especially Java </li></ul></ul><ul><ul><li>Each of us create both applications and frameworks </li></ul></ul><ul><ul><li>The experiences are the core of creating T2 </li></ul></ul>
  5. 5. Web development situation <ul><li>The time for web application re-invented </li></ul><ul><ul><li>RIA is no more new thing, it is just choice! </li></ul></ul><ul><ul><ul><li>Ajax, Flex, Silverlight, there are just choices. </li></ul></ul></ul><ul><ul><li>Cloud environment is the matter </li></ul></ul><ul><ul><ul><li>Web application needs to deploy to multiple clouds </li></ul></ul></ul><ul><ul><li>HTTP based protocol and format rises up </li></ul></ul><ul><ul><ul><li>AMF, XMPP, reversehttp, pubsubhubbub </li></ul></ul></ul><ul><ul><ul><li>Or, legacy SOAP:P </li></ul></ul></ul>
  6. 6. RIP –Rich Internet Platform- <ul><li>RIA to RIP(Rich Internet Platform) </li></ul><ul><ul><li>RIP is the platform to support multiple RIA environment(HTML5, Ajax, Flex, Silverlight…). </li></ul></ul><ul><ul><li>HTML5 is the flagship of RIP </li></ul></ul><ul><ul><ul><li>Unlike HTML4, HTML5 is the platform for RIA. </li></ul></ul></ul><ul><ul><ul><li>Runtime is the key such as </li></ul></ul></ul><ul><ul><ul><ul><li>WebSockets </li></ul></ul></ul></ul><ul><ul><ul><ul><li>WebStorage </li></ul></ul></ul></ul><ul><ul><ul><ul><li>WebWorker </li></ul></ul></ul></ul><ul><ul><ul><ul><li>CacheManifest </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Geolocation API </li></ul></ul></ul></ul>
  7. 7. Cloudability <ul><li>Cloudability </li></ul><ul><ul><li>Ability to work well at cloud environment </li></ul></ul><ul><ul><li>Work well means: </li></ul></ul><ul><ul><ul><li>Deploy easily </li></ul></ul></ul><ul><ul><ul><li>Scale easily so be stateless </li></ul></ul></ul><ul><ul><ul><li>Interoperable to multiple cloud environment </li></ul></ul></ul><ul><ul><ul><ul><li>Not only for GAE, Amazon, or other, do work with all these. </li></ul></ul></ul></ul>
  8. 8. HTTP matters <ul><li>HTTP/HTTPS it the protocol </li></ul><ul><ul><li>The unified protocol for next generation apps </li></ul></ul><ul><ul><li>The format also matters </li></ul></ul><ul><ul><ul><li>AMF for Flex, XMPP for jabber, pubsubhubbub for WebHook, so many format rises up! </li></ul></ul></ul><ul><ul><ul><li>These formats and mechanism is the key for new interactive web apps </li></ul></ul></ul>
  9. 9. To the next level web apps <ul><li>Choose good/simple framework that has some features for: </li></ul><ul><ul><li>RIP </li></ul></ul><ul><ul><li>Cloudability </li></ul></ul><ul><ul><li>HTTP based multiple format </li></ul></ul><ul><ul><li>is one of the choice for you. </li></ul></ul>
  10. 10. What is T2 framework <ul><li>Simple and modernized java web framework for real developer </li></ul><ul><ul><li>Easy to use and maintain by annotation </li></ul></ul><ul><ul><li>Current version is T2 0.6.1-ga. ASL2 License. </li></ul></ul><ul><ul><li>http://code.google.com/p/t-2/ </li></ul></ul><ul><li>The framework for RIP apps </li></ul><ul><ul><li>Ofcourse support classic web application! </li></ul></ul><ul><ul><li>Extensible and embeddable framework </li></ul></ul>
  11. 11. The big picture Browser HTTP POST JavaScript Client XmlHttp Request Flex/AIR AMF REST-like Client PUT /hoge/foo POJO POJO POJO Serverside java applications …… …… …… Request format doesn’t effect server side POJO-based model.
  12. 12. The motivation <ul><li>The motivation </li></ul><ul><ul><li>All of Java webframework is too difficult to use and maintain </li></ul></ul><ul><ul><li>Also mention none of these follow modernized web clients with one unified model </li></ul></ul><ul><ul><ul><li>Does your framework handle Ajax, AMF, REST request using one unified programming model? </li></ul></ul></ul><ul><ul><ul><li>No clean url, no life. </li></ul></ul></ul><ul><ul><ul><li>No choice of template engine, no life. </li></ul></ul></ul><ul><ul><ul><li>Less configuration without difficult CoC! </li></ul></ul></ul>
  13. 13. The motivation(cont’d) <ul><li>Web framework: </li></ul><ul><ul><li>should be much more simple . </li></ul></ul><ul><ul><li>should give developer loosely-coupled unified model . </li></ul></ul><ul><ul><ul><li>Request type and format doesn’t effect server side. </li></ul></ul></ul><ul><ul><li>should handle modernized web request well </li></ul></ul><ul><ul><ul><li>Ajax, AMF from Flex, REST, POX from Silverlight… </li></ul></ul></ul><ul><ul><li>should give you clean beatiful url </li></ul></ul><ul><ul><li>should give you free to choose template engine </li></ul></ul>
  14. 14. The concept <ul><li>Concept </li></ul><ul><ul><li>Do one thing well </li></ul></ul><ul><ul><ul><li>T2 just connects between multiple HTTP clients to POJO using url pattern gracefully.Doesn’t do things at all. </li></ul></ul></ul><ul><ul><li>Accepts WEB diversity </li></ul></ul><ul><ul><ul><li>100 ways to make web application with technology (browser/RIA/CUI…), and we can’t push developer to one way.Do it freely using T2. </li></ul></ul></ul><ul><ul><ul><li>Only things for sure is using HTTP and URL . </li></ul></ul></ul>
  15. 15. The target user <ul><li>Who should use T2? </li></ul><ul><ul><li>Developers who’d like to: </li></ul></ul><ul><ul><ul><li>Develop and control web application easily. </li></ul></ul></ul><ul><ul><ul><li>Separate clients and server side application gracefully </li></ul></ul></ul><ul><ul><ul><li>Develop his/her framework based on simple and extensible framework and control perfectly </li></ul></ul></ul><ul><ul><ul><li>Develop RIA application quickly using REST like request, Ajax request, or Flex AMF request </li></ul></ul></ul><ul><ul><ul><li>Develop cloud based application </li></ul></ul></ul>
  16. 16. Programming model <ul><li>Page model </li></ul><ul><ul><li>All of T2 application uses page model </li></ul></ul><ul><ul><li>Basically POJO but annotations enhanced for class, method, parameter </li></ul></ul><ul><ul><ul><li>Very unobtrusive model, no one harms for this  </li></ul></ul></ul><ul><ul><li>Page is a class to map an url for a pojo. </li></ul></ul><ul><ul><li>Page has action methods for executing user request. </li></ul></ul><ul><ul><li>Action parameter is injected by T2 </li></ul></ul>
  17. 17. Programming model(cont’d) <ul><li>Example: </li></ul><ul><li>@Page(&quot;employee&quot;) </li></ul><ul><li>public class EmployeePage { </li></ul><ul><li>@Default </li></ul><ul><li>public Navigation index(WebContext context) { </li></ul><ul><li>… ... </li></ul><ul><li>} </li></ul><ul><li>@GET </li></ul><ul><li>@ActionPath(&quot;list/detail&quot;) </li></ul><ul><li>public Navigation detail(WebContext context) { </li></ul><ul><li>…… </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  18. 18. Action method design <ul><li>Funnel-like design </li></ul><ul><ul><li>Page class is created as you put url and its parameter from whole to detail </li></ul></ul><ul><ul><ul><li>Set url for a page </li></ul></ul></ul><ul><ul><ul><li>Set url for an action method </li></ul></ul></ul><ul><ul><ul><li>Set parameter whichever you would like to receive </li></ul></ul></ul>
  19. 19. Action method design(cont’d) <ul><li>Example: HTTP GET /hoge/foo?bar=2 </li></ul><ul><ul><li>Page class takes /hoge as url </li></ul></ul><ul><ul><li>Action method tales /foo as url </li></ul></ul><ul><ul><li>Method args takes bar as String </li></ul></ul><ul><li>So it is like: </li></ul><ul><li>@Page(&quot;/hoge”) </li></ul><ul><li>public YourPage { </li></ul><ul><li>@GET </li></ul><ul><li>@ActionPath(“hoge”) </li></ul><ul><li>public Navigation hoge( @RequestParam(&quot;bar&quot;) String bar ) { </li></ul>
  20. 20. Action parameter design <ul><li>Action parameter is injected by T2 </li></ul><ul><ul><li>T2 prepared contexts </li></ul></ul><ul><ul><ul><li>WebContext/Request/Response… </li></ul></ul></ul><ul><ul><li>Servlet spec contexts </li></ul></ul><ul><ul><ul><li>HttpServletRequest/HttpServletResponse… </li></ul></ul></ul><ul><ul><li>Converted POJO from form data </li></ul></ul><ul><ul><ul><li>From HTTP POST, or from Flex AMF </li></ul></ul></ul><ul><ul><li>Useful parameters </li></ul></ul><ul><ul><ul><li>REST-like some url, or foreach index, upload file… </li></ul></ul></ul>
  21. 21. Take a look code! <ul><li>@Page(”sample&quot;) </li></ul><ul><li>public class SamplePage { </li></ul><ul><li>@Default </li></ul><ul><li>public Navigation index(WebContext context) {… </li></ul><ul><li>@Amf </li></ul><ul><li>public Navigation execute(HogeDto hoge) {… </li></ul><ul><li>@ActionParam </li></ul><ul><li>public Navigation submit(@Form FooDto foo) {… </li></ul><ul><li>@ActionPath(“fuga/{moge}”) </li></ul><ul><li>public Navigation submit( @Var(“moge”) String s) {… </li></ul>
  22. 22. Core components <ul><li>@Page </li></ul><ul><li>HTTP handling using @GET/@POST </li></ul><ul><li>URL pattern matching by @ActionPath </li></ul><ul><li>Request data matching by @ActionParam </li></ul><ul><li>Request type matching by @Ajax/@Amf </li></ul><ul><li>Return type, Navigation </li></ul><ul><li>ContainerAdapter for integrate with DI container </li></ul>
  23. 23. @Page <ul><li>The root annotation for T2 Page </li></ul><ul><ul><li>Page must have @Page. </li></ul></ul><ul><ul><li>T2 does not have any configuration except web.xml and @Page </li></ul></ul><ul><ul><li>Traverse by class path and finds page classes </li></ul></ul>
  24. 24. HTTP matching <ul><li>HTTP matching is the first thing T2 does for action methods </li></ul><ul><ul><li>GET, POST, PUT, DELETE, even HEAD. </li></ul></ul><ul><ul><li>These are distinguished by annotation like @GET or @POST </li></ul></ul>
  25. 25. URL matching for action method <ul><li>URL matching for action method </li></ul><ul><ul><li>@ActionPath is the main role to do </li></ul></ul><ul><ul><li>@Page(“hoge”) + @ActionPath(“foo”) -> /hoge/foo is the url to access to the method </li></ul></ul>
  26. 26. Data matching for action method <ul><li>Data matching for action method </li></ul><ul><ul><li>@ActionParam is the main role to do </li></ul></ul><ul><ul><li>Match submitted request parameter name. </li></ul></ul><ul><ul><ul><li>If it’s @ActionParam(“execute”), execute the action method if request paramete name “execute” exist </li></ul></ul></ul><ul><ul><ul><li>Usually it is used to separate user submit action. </li></ul></ul></ul><ul><ul><ul><ul><li>Data update button, cancel button, things like that. </li></ul></ul></ul></ul>
  27. 27. Request type matching <ul><li>T2 can separate methods for request type. </li></ul><ul><ul><li>@Ajax </li></ul></ul><ul><ul><ul><li>Accept only XmlHttpRequest, not others </li></ul></ul></ul><ul><ul><ul><li>Done by “X-Requested-With” header </li></ul></ul></ul><ul><ul><li>@Amf </li></ul></ul><ul><ul><ul><li>Accept only Flex/AIR AMF request, not others </li></ul></ul></ul><ul><ul><ul><li>Done by content-type header </li></ul></ul></ul><ul><li>Request type is important </li></ul><ul><ul><li>The logic must be different with sync/async. </li></ul></ul>
  28. 28. Default method for a page <ul><li>Default method is always good to have. </li></ul><ul><ul><li>At least some odd error does not happen </li></ul></ul><ul><ul><li>Default behavior takes over and user doesn’t feel uncomfortable </li></ul></ul><ul><li>@Default is for default method </li></ul><ul><ul><li>Usually returns default page transition. </li></ul></ul><ul><ul><li>Sometimes clear states if application contains. </li></ul></ul>
  29. 29. Navigation <ul><li>Navigation is the user interface for: </li></ul><ul><ul><li>Telling T2 where the transition goes </li></ul></ul><ul><ul><li>Telling T2 how view will be rendered </li></ul></ul><ul><li>Navigation is: </li></ul><ul><ul><li>Very simple to use. </li></ul></ul><ul><ul><li>Extensible.Developer can implement easily. </li></ul></ul>
  30. 30. Default prepared navigations <ul><li>Default navigations </li></ul><ul><ul><li>Forward/Redirect/Proceed(Psuedo redirect) </li></ul></ul><ul><ul><li>Json(or SecureJson using json-prefixing) </li></ul></ul><ul><ul><li>Direct(Stream response) </li></ul></ul><ul><ul><li>AmfResponse(Flex AMF) </li></ul></ul><ul><ul><li>CacheManifest(Generate HTML5 manifest) </li></ul></ul><ul><ul><li>In the future: </li></ul></ul><ul><ul><ul><li>CVS, PDF, GoogleMaps, or Charts. </li></ul></ul></ul>
  31. 31. ContainerAdapter <ul><li>Dependency Injection is the defacto technology for easy and maintainable development </li></ul><ul><ul><li>T2 provides adapters for these containers: </li></ul></ul><ul><ul><ul><li>Spring/Guice/Seasar2 or our Lucy </li></ul></ul></ul><ul><ul><li>It can use by settings using web.xml </li></ul></ul><init-param> <param-name>t2.container.adapter</param-name> <param-value>org.t2framework.t2.adapter.SpringAdapter</param-value> </init-param>
  32. 32. Demos <ul><li>RIA type demo </li></ul><ul><ul><li>PureMVC + T2 + Spring + iBatis </li></ul></ul><ul><ul><li>Complete sample for CRUD </li></ul></ul><ul><li>Cloud type demo </li></ul><ul><ul><li>Flex + GAEJ + T2 </li></ul></ul><ul><ul><li>Using T2 AMF3 implementation </li></ul></ul><ul><li>Where is my lovely iPhone? Mushup Demo </li></ul><ul><ul><li>Geolocation(ajax) + T2 + Yahoo local search + iPhone serversman web server </li></ul></ul>
  33. 33. Conclusion <ul><li>Web development will be re-invented by: </li></ul><ul><ul><li>RIP, mostly HTML5 </li></ul></ul><ul><ul><li>Cloud environment </li></ul></ul><ul><ul><li>Multiple HTTP based formats </li></ul></ul><ul><li>T2 framework is the simple framework for working well with these environments. </li></ul>
  34. 34. Resources <ul><li>Site </li></ul><ul><ul><li>http://code.google.com/p/t-2/ </li></ul></ul><ul><li>Download </li></ul><ul><ul><li>http://code.google.com/p/t-2/downloads/list </li></ul></ul><ul><li>Maven site </li></ul><ul><ul><li>http://maven.t2framework.org/maven2/ </li></ul></ul>
  35. 35. Resources(cont’d) <ul><li>Documents </li></ul><ul><ul><li>http://code.google.com/p/t-2/wiki/Index </li></ul></ul><ul><li>Mailing list </li></ul><ul><ul><li>http://groups.google.com/group/t2-users-en </li></ul></ul><ul><li>Source </li></ul><ul><ul><li>http://code.google.com/p/t-2/source/checkout </li></ul></ul>
  36. 36. Thanks!!

×