Continuations
I've been reading this morning about continuations on the JVM (Java Virtual Machine). Gilad Bracha posted a blog entry a while back, when he was still at Sun Microsystems, about adding continuations to the JVM and why he didn't want to do it. The part that stuck out was:
IAP and IAL address the problem that Gilad describes. IAP has the concept of state built into it. It is not connection-based entirely, but has concepts of connection-based protocols inside IAP transactions. However, it still maintains the concept of session within the protocol.
Second, IAP defines a simple principle of ultimate idempotence. Every time you request a view (HTML file is the HTTP equivalent) with a specific version (HTTP doesn't have versioning) it must be the same byte for byte. This rule means that views cannot be generated on the server. A view is the code that generates the GUI. It would be as if you were passing back to the browser the JSP file. This concept has wide spread effects but the main effect is that the server is no longer managing all the state. Instead the browser now manages state because when it executes the view code to create the GUI it must return to the server to request data for that view. That data is downloaded and then managed by the browser and can be manipulated client side without requiring requests to the server.
Lastly, IAP defines a requirement for languages built on top of it that any and all actions the user performs must be handled first by the view code running in the browser. This is a no surprises approach in that the browser cannot do something that would surprise the code on the server or the client. This means that if a user opens a new window or tab the application is the first to know. From there the application can decide how best to allow the user to control two windows into the same application.
In the end, continuations will not be needed on servers that run IAP and IAL. Instead, if anything, IAL could benefit from continuations by making multiple client side sessions simple to manage. Whether or not we will be adding continuations is still open for discussion, but the fact that they are not required on the server is a step in the right direction.
The other important point is that the future of web apps is going to be different. Ajax is a sign of things to come (though it’s only a symptom, not a real solution - but that is another story). In time, entire applications will be downloaded and provide a full GUI in the context of a single page. The primitive dialog we see today will return to the ash heap of history where it belongs.I completely agree (and I can safely assume James does as well) on this point. Every time I look at modern web frameworks they are either in one of two camps:
- Sessionless
- Continuation based
IAP and IAL address the problem that Gilad describes. IAP has the concept of state built into it. It is not connection-based entirely, but has concepts of connection-based protocols inside IAP transactions. However, it still maintains the concept of session within the protocol.
Second, IAP defines a simple principle of ultimate idempotence. Every time you request a view (HTML file is the HTTP equivalent) with a specific version (HTTP doesn't have versioning) it must be the same byte for byte. This rule means that views cannot be generated on the server. A view is the code that generates the GUI. It would be as if you were passing back to the browser the JSP file. This concept has wide spread effects but the main effect is that the server is no longer managing all the state. Instead the browser now manages state because when it executes the view code to create the GUI it must return to the server to request data for that view. That data is downloaded and then managed by the browser and can be manipulated client side without requiring requests to the server.
Lastly, IAP defines a requirement for languages built on top of it that any and all actions the user performs must be handled first by the view code running in the browser. This is a no surprises approach in that the browser cannot do something that would surprise the code on the server or the client. This means that if a user opens a new window or tab the application is the first to know. From there the application can decide how best to allow the user to control two windows into the same application.
In the end, continuations will not be needed on servers that run IAP and IAL. Instead, if anything, IAL could benefit from continuations by making multiple client side sessions simple to manage. Whether or not we will be adding continuations is still open for discussion, but the fact that they are not required on the server is a step in the right direction.
