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.

Thanks

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/3n1xsudtZ-IJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment