Let’s say If I have an application where I have been keeping all my XPages, most not necessarily related to each other. If I define several beans in the faces-config file for some of these XPages, what is the effect on memory and performance in the other XPages that do not use any of these managed beans? Aren’t they instantiated and kept in memory (even if empty) for all the XPages in this application?
If so, then would it be best practice to keep the related XPages that will use a managed bean (and maybe share them) in their own NSF vs. having a single store for all the XPages for a site?
Howard
Managed bean is constructed only if referenced in EL/SSJS. Its scope defines, when it is discarded.
So from performance standpoint it does not matter (sort of) how many beans are defined in faces-config.
What you must take into account, though, is performance of methods. Especially setters/getters, which are called usually more times per request. Also avoid any excessive code in constructor of request scoped beans. Applies to memory demands too – try not to keep vast amount of data (arrays, maps…) in beans.
I would recommend to split XPages into more databases. Reason is different from beans performance – application logic. It is better to keep related functions together (into single NSF) and separated from others (don’t mix them all at the same place).