Java does not have instant turnaround for code changes due to challenges reloading classes and preserving object state between classloader instances. Frameworks like Play, Tapestry and Grails, and tools like JRebel, help enable faster development cycles by supporting class reloading and state migration without full redeploys. JRebel in particular integrates with IDEs, build tools, containers and frameworks to allow changes to classes, methods and fields to take effect instantly in production.
5. Why Java is heavier than others?
Vendors
Standards
Operations
Dev << Prod
twitter.com/ekabanov
6. A typical web application build
Resolve dependencies
Copy static resources
Compile classes
Package modules in JARs
Package everything in a WAR/EAR
twitter.com/ekabanov
9. Deployment by linking
Linux symbolic links
âą ln -s
âą Symlinks can point to any file
Windows symbolic links
âą Sysinternals junction utility on NTFS
partitions, included in Windows 7
âą Can only link to local directories and must
be careful when deleting
twitter.com/ekabanov
11. 2008 => 2011
this works:
mvn jetty:run
others?
twitter.com/ekabanov
12. App Server
Workspace
getResource(âhello.htmlâ) read(âsrc/main/.../hello.htmlâ)
twitter.com/ekabanov
13. A typical web application build
Resolve dependencies
Copy static resources
Compile classes
Package modules in JARs
Package everything in a WAR/EAR
twitter.com/ekabanov
14. Why code reloading is so hard?
Externalized Temporary
State
Serializable Derivative
twitter.com/ekabanov
15. Reloading an Object
OldClassLoader NewClassLoader
MyObject.class MyObject.class
Recreate the object
MyObject MyObject
twitter.com/ekabanov
16. Web Deployment
Serialize/deserialize
init()
Session Session
Sevlet New Sevlet
Classes
Classes
App App
New State
Libraries State
Libraries
OldClassLoader NewClassLoader
twitter.com/ekabanov
21. Component State
New New
Class Object
Class Object
Old Component New Component
ClassLoader ClassLoader
twitter.com/ekabanov
22. JVM Languages
Class-based
languages have same
limitations as Java
Groovy
Jython
Non-class based
languages can have
better support
JRuby
Clojure
twitter.com/ekabanov
23. HotSwap
User saves class
from IDE
OldClassLoader
MyObject.class
New Code
Code
HotSwap
111000100
101000101 Debugger
101010010
100010010 New Code
111000100
101010010
MyObject
twitter.com/ekabanov
31. Q: Why Doesnât Java Have
Instant Turnaround?
A1: Other languages/platforms arenât
much better!
A2: Reloading code is easy, preserving
state is hard!
A3: Itâs better than it used to be!
A4: Play!, Tapestry 5 and Grails do that!
A5: But what about JRebel?
twitter.com/ekabanov