Currently I am re-engineering a bigger application. In the backend I want to use only java
instead of javascript
, therefore, and for many other reasons (cleaner code, separation of concerns, etc.) I am using the XPages Scaffolding project from Jesse Gallagher (thanks to him for this work).
I really like the controller classes
of this project, but one question I have
to this architectural approach:
The controller class has a one-to-one connection to an xpage (.xsp). In the BasicDocumentController
class the following method protected DominoDocument getDoc()
is responsible for getting the corresponding datasource (DominoDocument) but - and here is my challenge - I have more than one datasource in one xpage.
Possible approaches:
a) Overriding the getDoc()
method in MyDocumentController
(make only sense for one datasource)
b) Two controller classes MyDocumentControllerA
MyDocumentControllerB
?
c) etc.
What would be an appropriate approach to handle this requirement?
Thanks in advance for any hint!