Rapid Java Application    Development        JUG.ru       25.02.2012
Turnaround CycleMake a change                Check the change            Build, deploy, wait
Technology Zoo
VendorsStandards            Operations      dev <<    PROD
Turnaround CycleMake a change                Check the change            Build, deploy, wait
Turnaround Time Sink                  Navigation         OOMApplication              deploymentContainer boot time
Container Startup Timehttp://dow.ngra.de/2010/12/14/jee-oss-container-startup-times-apples-vs-oranges/
http://zeroturnaround.com/java-ee-productivity-report-2011/
Build     Resolve dependencies     Copy static resources        Compile classes   Package modules into JARsPackage everyth...
Exploded Directory Deployment
Jetty Launcherpublic class Launcher {    public static void main(String[] args) {        Server server = new Server();    ...
“…I know about JRebel, but I cannotpay for it, so I tried Maven…”                          - Stackoverflow
This works:mvn jetty:run  others?
getResource(“hello.html”)   read(“src/main/.../hello.html”)
Build     Resolve dependencies     Copy static resources        Compile classes   Package modules into JARsPackage everyth...
Build     Resolve dependencies     Copy static resources     Compile classes   Package modules into JARsPackage everything...
Why Code Reloading is Hard?Externalized     Temporary           StateSerializable     Derivative
OldClassLoader         NewClassLoader MyObject.class                     MyObject.class                  Recreate objectMy...
Serialize/deserialize                                                      init()       Session                           ...
Twin ClassLoader IssuesClasses                 Classes             Objects                Objects            and Code     ...
Component State                   New        NewClass     Object                   Class     Object Old Component      New...
HotSwap               Make changes in IDE      OldClassLoader  MyObject.class   New                       HotSwap   Code c...
JRebel vs HotSwap                               HotSwap   JRebelChanging method bodies           +         +Adding/removin...
JRebel          Make changes in IDE                  OldClassLoaderFramework              MyObject.class               Cod...
in action
Oh ...The Acid is Kicking In     Take a break!
Rapid java application development @ JUG.ru 25.02.2012
Rapid java application development @ JUG.ru 25.02.2012
Upcoming SlideShare
Loading in …5
×

Rapid java application development @ JUG.ru 25.02.2012

6,539 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Rapid java application development @ JUG.ru 25.02.2012

  1. 1. Rapid Java Application Development JUG.ru 25.02.2012
  2. 2. Turnaround CycleMake a change Check the change Build, deploy, wait
  3. 3. Technology Zoo
  4. 4. VendorsStandards Operations dev << PROD
  5. 5. Turnaround CycleMake a change Check the change Build, deploy, wait
  6. 6. Turnaround Time Sink Navigation OOMApplication deploymentContainer boot time
  7. 7. Container Startup Timehttp://dow.ngra.de/2010/12/14/jee-oss-container-startup-times-apples-vs-oranges/
  8. 8. http://zeroturnaround.com/java-ee-productivity-report-2011/
  9. 9. Build Resolve dependencies Copy static resources Compile classes Package modules into JARsPackage everything into WAR/EAR
  10. 10. Exploded Directory Deployment
  11. 11. Jetty Launcherpublic class Launcher { public static void main(String[] args) { Server server = new Server(); SelectChannelConnector connector = new SelectChannelConnector(); connector.setPort(8080); server.addConnector(connector); WebAppContext context = new WebAppContext("war", "/"); server.setHandler(context); server.start(); }}
  12. 12. “…I know about JRebel, but I cannotpay for it, so I tried Maven…” - Stackoverflow
  13. 13. This works:mvn jetty:run others?
  14. 14. getResource(“hello.html”) read(“src/main/.../hello.html”)
  15. 15. Build Resolve dependencies Copy static resources Compile classes Package modules into JARsPackage everything into WAR/EAR
  16. 16. Build Resolve dependencies Copy static resources Compile classes Package modules into JARsPackage everything into WAR/EAR
  17. 17. Why Code Reloading is Hard?Externalized Temporary StateSerializable Derivative
  18. 18. OldClassLoader NewClassLoader MyObject.class MyObject.class Recreate objectMyObject MyObject
  19. 19. Serialize/deserialize init() Session Session Sevlet New SevletClasses Classes App App New StateLibraries State Libraries OldClassLoader NewClassLoader
  20. 20. Twin ClassLoader IssuesClasses Classes Objects Objects and Code and CodeLibraries Libraries OutOfMemoryError ClassCastException OldClassLoader … NewClassLoader JVM
  21. 21. Component State New NewClass Object Class Object Old Component New Component ClassLoader ClassLoader
  22. 22. HotSwap Make changes in IDE OldClassLoader MyObject.class New HotSwap Code code Debugger 111000100 101000101 101010010 100010010 New code 111000100 101010010MyObject
  23. 23. JRebel vs HotSwap HotSwap JRebelChanging method bodies + +Adding/removing methods - +Adding/removing constructors - +Adding/removing fields - +Adding/removing classes - +Adding/removing annotations - +Replacing superclass - -Adding/removing implemented - -interfaces
  24. 24. JRebel Make changes in IDE OldClassLoaderFramework MyObject.class Code 101000101 New code JRebel 100010010 111000100 101010010 MyObject Configuration (XML, annotations,..)
  25. 25. in action
  26. 26. Oh ...The Acid is Kicking In Take a break!

×