1

Up to now, the com.ibm.jscript.std.FunctionObject does not implement Serializable. In my opinion, when working with server-side JavaScript (SSJS) it would be very beneficial if it could be serialized. Since I'm no Java expert, I'd like to ask if there is a special reason why the FunctionObject does not implement Serializable, while other SSJS objects (like the ObjectObject) do. Will it never be serializable?

xpages-noob
  • 1,569
  • 1
  • 10
  • 37

1 Answers1

4

I suspect it's because FunctionObject is intended not as an SSJS version of a Java object but more as an SSJS version of a Java static class, so just a set of utility functions and so a single object per NSF. I doubt it will ever be serializable.

In my opinion SSJS is a limbo language for those getting started with XPages and coming from a Domino background. It allows easy access to Formula Language, global objects (like context and database), LotusScript-style Domino Object Model and client-side JavaScript-style libraries (e.g. i18n).

I think the expectation is that if developers are familiar enough with things like serialization and developing using objects, they are probably ready to go down the road of Java classes as managed beans or Data Objects, plus validators, converters, or even a full MVC model. That also leads the way to moving cross-database components and utilities out of the NSF and into an OSGi plugin or extension library. There are more and more examples of that on OpenNTF now.

Paul Stephen Withers
  • 15,699
  • 1
  • 15
  • 33
  • We are waiting for SSJS to be ported to Nashorn. Other than that: Amen to Paul – stwissel Aug 27 '14 at 09:22
  • @stwissel: Since Nashorn is part of JDK 8, I guess we will have to wait at least until Notes 10 for it to be natively implemented/supported, right? – xpages-noob Aug 27 '14 at 10:44