check this out to give you some ideas about the history service..

http://code.google.com/p/handlebars/wiki/PlaceServiceOverview

On Jun 2, 8:08 am, ping2ravi <[email protected]> wrote:
> Ya this approach looks good, thanks kozura.
> Now my app will look like this.
>
> myapp.html#type=profile&id=100               call server and get data
> myapp.html#type=profile&id=234               call server and get data
> myapp.html#type=profile&id=100               get data from cache and
> refresh panel with this data
> myapp.html#type=profile&id=234               get data from cache and
> refresh panel with this data
>
> Thanks all, i guess now i can start writing a basic framework around
> this approach.
>
> On Jun 1, 10:25 pm, kozura <[email protected]> wrote:
>
>
>
> > I recommend you use a single widget with a method to change the data
> > showing in it (user profile, whatever).  You have to be able to
> > populate it anyway, so that's no extra code.  Caching panels is
> > generally a bad idea and a lot of overhead.
>
> > As for limiting server calls, you can cache the data returned to avoid
> > having to recall the server.  Easiest way is a simple map id->data;
> > check it when you need an id, if you have it then call the async
> > callback immediately, otherwise make the RPC call and be sure to stick
> > the result into the cache map when it gets returned.  Of course if the
> > data is dynamic you probably want some mechanism to know when a
> > particular piece of data gets changed and needs re-sent..
>
> > Also you might look at one of the models built on top of GWT which do
> > this for you in various ways.
>
> > On Jun 1, 2:36 pm, ping2ravi <[email protected]> wrote:
>
> > > Thanks Shaffer/Sri,
> > > I think i will go with GWT, the only thing is that i will have to
> > > implement History which usually i dont do while writing the
> > > websites(jsp/html page based). May be thats the reason i thought
> > > writing history is overhead but i guess this over head will give me
> > > good webapp/website.
> > > now with GWT also i have few question like.
> > > e.g. i am on a user profile (some other user) screen i created a
> > > panel(grand parent of every widget inside it) say the url is
> > > myapp.html#type=profile&id=100
> > > then i go to another user's profile and url is now
> > > myapp.html#type=profile&id=234.
>
> > > Question, what is the best approach here. Shall i create a brand new
> > > that grand panel and fill the data from server or shall i reuse the
> > > exisitng panel, clean it and then refill the data from server.
> > > Option 1) If i create always new panel, can i trust GWT that it will
> > > never go out of memeory or after some time user;s browser wont feel
> > > that something heavy has been loaded?  By using this approach i can
> > > make sure that if user come to link myapp.html#type=profile&id=100
> > > again, i wont go to server and will just display the existing Panel.
> > > It will be quickest thing on the earth and user may feel better to see
> > > a page faster then anything.
>
> > > My Server calls will be like
>
> > >  myapp.html#type=profile&id=100               call server and get data
> > >  myapp.html#type=profile&id=234               call server and get data
> > >  myapp.html#type=profile&id=100               ======No need to call
> > > server as one panel already exists which can show profile for user 100
> > >  myapp.html#type=profile&id=234               ======No need to call
> > > server as one panel already exists which can show profile for user 234
>
> > > Probelm which i see in this approach:
> > > 1) Memory can be a problem in this approach. Exp GWT developer may be
> > > able to give me some insight here.
> > > 2) Client view might be bit older then server, but panels can be
> > > removed from history cache using timers say 1 minute etc. But still
> > > older.
>
> > > Option 2) Reruse the existing Panel again and again. Basically create
> > > all main panels which need to have history as singleton(although its
> > > javascript, but in java write code like that) and reuse the panel and
> > > whenevr history changes reset all panels/widgets inside it and reload
> > > the data from Server
> > >  myapp.html#type=profile&id=100               call server and get data
> > >  myapp.html#type=profile&id=234               call server and get data
> > >  myapp.html#type=profile&id=100               call server and get data
> > >  myapp.html#type=profile&id=234               call server and get data
>
> > > In this approach i guesss i will have less problem with memory and
> > > data will always be latest. But Server calls will be increased.That
> > > means extra load on server and user's every click(Back and forward)
> > > will go to server
>
> > > Is there any ther option available here?. If not then out of these
> > > which one of you think will be better. SOmehow i am inclined to option
> > > 1 but need to know if memory will be a problem.
> > > Thanks,
> > > Ravi.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to