Hi, Am Montag, den 21.03.2011, 15:34 +0000 schrieb Bertrand Delacretaz (JIRA): > FWIW, I've been bitten by this as well and it took quite a while to > figure out. I haven't studied the details yet but adding a doNotCache > parameter to the adaptTo call might help make things more explicit.
I don't really like this because it adds connotations which might not be valid and may even indicate wrong usage of the adaptTo method/mechanism. The idea of adapTo is to return adapted object in disguise. As such it is probably irrelevant whether the object returned from adaptTo is the same everytime or not. In fact, I would even expect to get the same object each time (if not the same object reference but at least an "equals" object). If a different object is expected on each call to adaptTo, this method is probably misused as a factory method. If there is a general need for such factory functionality, we should probably devise an explicit factory mechanism. Regards Felix
