The service area cluster is designed around four core classes: ServiceAreaCluster, Instance, StorageDelegate, and Delegate.
ServiceAreaCluster is the code-driven cluster implementation. It extends DefaultServerCluster and implements the Matter data model (ReadAttribute, InvokeCommand, and related methods). List attribute storage is delegated to StorageDelegate; device-specific business logic lives in Delegate.
Instance is a backwards-compatible wrapper around ServiceAreaCluster. Existing applications (such as rvc-app) can continue to use ServiceArea::Instance and Instance::Init() without modification. New code should prefer ServiceAreaCluster directly.
Storage management is delegated to the StorageDelegate class, which provides a list of virtual methods for the user to implement. These methods are straightforward and do not require input validation, but they should not be used directly.
The business logic specific to the device is encapsulated in a second Delegate class. This class can access the Instance through the GetInstance() method, enabling it to utilize all the attribute access methods provided by the Instance class. This design allows for a clear separation of concerns, with each class handling a specific aspect of the cluster's functionality.
ServiceArea::StorageDelegate class.ServiceArea::Delegate class.Instance class using the delegate instances.Instance's Init() method after the root Server::Init().emberAfServiceAreaClusterInitCallback function.