cancel
Showing results for 
Search instead for 
Did you mean: 

Why does Share use javascript callbacks?

matjazmuhic
Champ on-the-rise
Champ on-the-rise
It was one of the questions in Alfresco certification exam and I have no idea why.

I thought that it decreases the loading time of a web page.

Is this correct?
5 REPLIES 5

mikeh
Star Contributor
Star Contributor
Do you remember the exact question? Seems a little odd…

Thanks,
Mike

matjazmuhic
Champ on-the-rise
Champ on-the-rise
I don't remember the exact question. But I think it was almost exactly like:"Why does Alfresco Share use callbacks?". Something very similar to that.

I remember the possible answers:

- To decrease loading time of a web page
- To decrease number of round trips to a server

mikeh
Star Contributor
Star Contributor
Thanks - I'll try to clarify later this week when I can talk to the training team.

Thanks,
Mike

jpfi
Champ in-the-making
Champ in-the-making
yub, I was wondering about this question, too 😉
It's a question of definitions:

- round trip:
   - a) = full page reload?
   - b) = a HTTP round trip?

Ajax & callbacks should reduce the amount of a) but may increase the amount of b) (but smaller & faster requests…)

- web page loading time:
   - a) whole page rendering is completed
   - b) basic page rendering is completed & some parts may be still missing..

Cheers, Jan

mikeh
Star Contributor
Star Contributor
OK, I spoke to the training team about this question and I think it's worded correctly.

I had initially worried that the question was quite literally "Why does Share use javascript callbacks?" but in fact it talks about asynchronous HTTP requests being consumed by JavaScript in the form of callback functions. Jan is correct that this will actually *increase* the number of round-trip requests, but *does* make the initial page view render quicker. Data is populated from repo queries  (in most cases) and rendered in-page, ensuring the user is not blocked from other UI interactions in the meantime.

I believe it's the "better user experience" angle that the question is aiming at.

Thanks,
Mike