I understand the difficulties involved with implementing this due to the various layers involved. The bit I don't understand is how the adaptable pattern would make those go away. To me that pattern is just another way to implement this but it would also need to deal with all those layers.

Michael

On 24.08.17 11:08, Chetan Mehrotra wrote:
As explained in previous mail adaptable pattern requirement is to
enable such a support within Oak itself. due to multiple layers
involved.

If it doesnt exist then perhaps Oak could add a Service interface that
deals with conversions, rather than expose a second adaptable pattern in
Sling, or require type casting and instanceof.

We can expose such a service also if that helps. That service
implementation internally would anyway have to use adaptable pattern.

public class OakConversionService{
     <AdapterType> AdapterType adaptTo(Binary b, Class<AdapterType> type) {
         if (b instanceof Adaptable) {
             return (type)b.adaptTo(type);
         }
         return null
     }
}

So just another level of abstraction.

Chetan Mehrotra

Reply via email to