Remote aggregation is one major goal of RAIN. The simplified explanation is we want to allow users to write and hold applications / pages without software constraints. For instance we want to avoid cases were we tell developers: use wicket because RAIN can not use something else.
Following RAIN guidelines, we want to be able to render remote markup fragments.
In the above diagram you can see how remote fragments will be aggregated by RAIN.
In the above diagram you can see how a requests to a page that contains remote fragments is solved by RAIN. For the first request remote server holding the fragment will create a new session. The session id will be pushed back to the RAIN server along with the fragment generated markup.
For ulterior requests, the session id for the same remote fragment will be sent to the remote server.
On the RAIN server there will be an association between RAIN remote module and session id. This information will live within RAIN session. Fragments sessions are hidden from client side code executed within client browser.
Because RAIN is intended to support remote fragments there are several points in which things go wrong. Below you can find a list of common exceptions we want to handle:
Exception | Possible solution |
---|---|
Remote server is not available. | A default image will be displayed to indicate something is not available. |
Remote server responds really slow. | RAIN is processing each fragment in parallel. If the processing of a fragment will not end in a timely manner (< 300ms for instance) RAIN will automatically stop the process and it will display a predefined image instead. |
Remote server responds with 401 / 403 / other HTTP error code. | RAIN might display a predefined image for this instead of the fragment. |
Fragments might define the same css classes in markup thus resulting a name clash. | This is solved automatically by RAIN. |
Fragments might define the same javascript functions in global space thus resulting a name clash. | This should not be the case because all fragments should write javascript using requirejs. |