The ServiceLocator is one of the core singleton classes of the Cairngorm framework. According to a previously cited article, "Flex 3: Introducing Cairngorm" (Adobe Customer Training/Partner Enablement Group, Burleson, Shuman, and Boles), the ServiceLocator has the following characteristics:
The ServiceLocator pattern is used to create a global singleton registry to centralize all instances of Flex RDS components used in an application. These include:
It supports easy lookup of services by name.
It should never be used outside the control layer.
In a standard Flex project, services may be instantiated as needed by individual components. This can cause them to be scattered across the application. In Cairngorm all services are created in and accessed by the ServiceLocator. Because the ServiceLocator provides a centralized location for registering and accessing services, individual components no longer have to instantiate services themselves and services can all be configured in a single location.