Coding xpages – best practice!?

Domino developers coming from classic domino development are used to coding LotusScript, @Functions and maybe a little Java. Structuring code can be achieved by using Libraries to store the code. Code maintenance is another advantage of Libraries.

Now xpages entered the scene and with them come new ways of coding and with JavaScript a „replacement“ for LotusScript. The Java Perspective offers sophisticated java coding features. Java Business Logic can be used by SS JavaScript. JavaScript can either be coded in the xpages or in JavaScript Libraries.

So with all these new capabilities at hand what is the best way to code Business Logic in xpages? Favor JavaScript over Java or vice versa? Code Java in the Java Perspective or rather in Java Libraries? Since I’ve been developing classic domino apps for ages and just started with xpages, I am really interested in „best practice“. From what I’ve learned so far I’d say favor SS JS over Java where appropriate. What do you think or how do you code?