I am new to Eclipse RAP and have no experience with SWT or Eclipse RCP. But I understand that the developer is responsible to dispose SWT widgets because they have native peers which would block resources of the operating system.
But what about "dispose" in a RAP application? It is the browser's problem to manage operating system resources (a file dialog, maybe). So "dispose" seems unnecessary for an application that is purely RAP, correct?
Now, if I wanted to have single-sourcing with SWT and RWT, i.e. the same source code runs as a standalone RCP application and as a RAP web application. What would be a best practice regarding "dispose"? How should it be triggered? What needs to be disposed?
There is no difference between SWT and SWT/RAP when it comes to disposing of widgets.
While SWT widgets hold native OS/window system resources while not disposed, RAP widgets hold browser resources i.e. DOM nodes as long as they live. Dispose of widgets when they are no longer needed and create widgets lazily if possible.