What is encapsulation?

 
 
 

Assets promote encapsulated design. Encapsulation refers to the act of hiding information the user doesn’t necessarily need to know. For example, you may want to keep the node structure of an object hidden from people who might tamper with it, or you may want to keep the node structure flexible in case a future requirement changes.

With an asset, you can place all the nodes related to an object in a single asset node, then publish a subset of those internal node attributes to the asset itself. This creates a custom interface that exposes only the information you want to expose (for more information see Publish or Unpublish attributes).

Assets act as a black box between what its contents do and how they do it. An asset’s interface acts like a contract promising that, no matter how the asset is arranged internally, it will offer a concrete set of inputs and outputs. Using the interface, artists know the exact capabilities of an asset without knowing the details of the asset’s internal structure. This allows them to do their work regardless of how the asset is set up.

Encapsulation maintains a scene’s integrity. The internal structure of each asset may change but, as long as its interface isn’t violated, the objects in the scene that rely on it remain unaffected.

Maya Assets provides a number of locking and hiding mechanisms to enforce the benefits of encapsulated design.

Related topics