Thursday, August 30, 2012

Some newbie questions regarding resources and ClientBundle.

Say I've got an app which includes a lot (more than 100) images to be used. For instance these images could be part of a game of some sort. Within a page the user will only need to fetch about 5 to 10 images.

What's a good way to implement that?
Should I build a single ClientBundle class which has all of the 100 resources? (I reckon that would be a bad design)

Basically I want to do something like this:
Resources imageResources = GWT.create(Resources.class);
Image img = new Image(imageResources.image(635));

Which would return a reference to the image of id 635.

I thought of this design, I create an interface eg. HasAppResource which has some methods eg. getXImage(). Then the relevant entities would implement this interface and make the method return the ImageResource. I'm not even sure how to do this though.


You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment