actually, it /was/ bad practice. it is now automatically efficient.


if you look at the /very same/ pub example now, you'll see that

       add(new Image("beer"));

and

       <img wicket:id = "beer" src = "Beer.gif"/>

results in this URL

   http://localhost:8080/pub/resources/wicket.examples.pub.Home_Beer.gif

in other words (gili, are you listening?), you don't have to do anything to make your packaged resources cached and efficient now. just attach an Image component to the IMG tag and it will automatically do efficient resource sharing and referencing.

of course, if you want more control, you have it. but this takes care of a very common case (want localized, packaged image resources).

i think this is the beauty of good encapsulation in OO programming. if we exposed URLs all over the place, for example, we couldn't do this kind of thing. since we actually have abstractions for images, resources and resource references... i can go make globally optimizing changes like this without affecting anyone.

Gili wrote:


I don't get it. What is bad practice? Can you rephrase it?

Gili

Johan Compagner wrote:

I will make it so that when caching is not allowed i don't set anything (so also not the last modified time of the file)
But that example is ofcourse wrong.. And we should teach people to never return just images from files under
the same, not shared/static resource url. This is just bad practice.



------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to