I am a complete newbie here, so please forgive my total ignorance of Node.js.
I have a Java applet which also has a main() so it can also be run as an application. The user interacts with the applet on a web page, the applet fetches specific classes from the server on demand, and when everything has been sorted out the applet serializes the state of the internal data model and squirts it to the server, where the same code running as an application takes the serialized state and processes it. This is very convenient because the classes that the user interacts with are fetched dynamically, so new classes can be added and existing ones upgraded very easily, and there is a single code base to maintain for both the client-side and server-side processing -- init() and main() just provide different ways of handling the same internal data model.
Lately Oracle seem to have gone mad. Java applets now have to be digitally signed, and hardly anyone these days seems to bother with installing Java plugins or using applets. Sometimes applets work, sometimes they don't -- "write once, run anywhere" as long as there are no version conflicts. All in all, I'm fed up with the whole mess and am looking for alternate technologies so that I can build something that will just work, period.
I'm considering using something like JSGL for the user interaction and creating a data model based on JS objects, fetching prototypes dynamically from the server as needed. This leaves me with the serialization (I presume I'll be able to convert the objects to JSON or some such to squirt them to the server) and the server-side processing. I need to be able to run a JS engine that can load up the objects (using the same prototype code that was sent to the client end), do the server-side processing, and write the results to a file.
So my questions are:
(a) does this sound feasible,
(b) can Node.js do the trick for me,
(c) where can I learn what I need in order to do it, and
(d) are there any pitfalls I need to be aware of?
Many thanks for any help you can give me...