Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Why are there 2 Asset classes in 5.6.1? When should you use them?

Avatar

Level 1

I just noticed there are now 2 Asset classes.

http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/dam/api/Asset.html

https://dev.day.com/docs/en/cq/current/javadoc/com/adobe/granite/asset/api/Asset.html

 

Neither is marked deprecated, and it seems you could accomplish the same tasks using either API, granted in different ways.  Is there any reason to use one over the other?  Will the com.day version eventually be deprecated?

1 Accepted Solution

Avatar

Correct answer by
Employee

Sean Steimer wrote...

"... might be deprecated in the future"

 

Not to be difficult, but couldn't you say that about any class, in any api, anywhere?  

Excellent point!

I guess what I'm getting at is why add the new class that accomplishes the same thing, but not mark the old one deprected?  Is this simply an oversight where Adobe engineering forgot to mark it deprecated?  Or are there specific use cases twhere the old day Asset classes is better to use?

 

No one forgot to deprecate anything smiley. The interfaces are in fact not the same. The Granite Asset interface is a subset of the DAM Asset interface.

Without getting into too many details, the reason there are two interfaces is that Granite is a shared platform between different Adobe products and services and those products/services need to (or want to) have a common base definition of what an "asset" is. For a variety of reasons, the existing DAM Asset interface is too broad for this level of interoperability.

In applications built on top of CQ/AEM, you are safe to use either interface. My guess is that you are going to be more likely to use the DAM Asset interface as it provides (easy) access to the asset metadata as well as provides the concept of an "original" rendition. NOTE - both of these are accessible through the Granite Asset interface, the DAM Asset interface is just a bit cleaner for these operations.

HTH,

Justin

View solution in original post

3 Replies

Avatar

Level 1

"... might be deprecated in the future"

 

Not to be difficult, but couldn't you say that about any class, in any api, anywhere?  

I guess what I'm getting at is why add the new class that accomplishes the same thing, but not mark the old one deprected?  Is this simply an oversight where Adobe engineering forgot to mark it deprecated?  Or are there specific use cases twhere the old day Asset classes is better to use?

Avatar

Correct answer by
Employee

Sean Steimer wrote...

"... might be deprecated in the future"

 

Not to be difficult, but couldn't you say that about any class, in any api, anywhere?  

Excellent point!

I guess what I'm getting at is why add the new class that accomplishes the same thing, but not mark the old one deprected?  Is this simply an oversight where Adobe engineering forgot to mark it deprecated?  Or are there specific use cases twhere the old day Asset classes is better to use?

 

No one forgot to deprecate anything smiley. The interfaces are in fact not the same. The Granite Asset interface is a subset of the DAM Asset interface.

Without getting into too many details, the reason there are two interfaces is that Granite is a shared platform between different Adobe products and services and those products/services need to (or want to) have a common base definition of what an "asset" is. For a variety of reasons, the existing DAM Asset interface is too broad for this level of interoperability.

In applications built on top of CQ/AEM, you are safe to use either interface. My guess is that you are going to be more likely to use the DAM Asset interface as it provides (easy) access to the asset metadata as well as provides the concept of an "original" rendition. NOTE - both of these are accessible through the Granite Asset interface, the DAM Asset interface is just a bit cleaner for these operations.

HTH,

Justin