# PodScope class abstract

Interface for pod scopes that manage object lifecycle and contextual storage.

A Scope defines a contextual boundary for pod instances, controlling their lifecycle, visibility, and destruction. Different scope implementations provide various lifecycle strategies such as singleton, prototype, request, session, and custom scopes.

Key responsibilities:

- Object creation and caching based on scope semantics
- Lifecycle management and destruction callbacks
- Contextual object resolution
- Thread-safe scope operations
- Conversation/context identification

Scope implementations can provide:

- Singleton: One instance per container (default)
- Prototype: New instance for each request
- Request: One instance per HTTP request
- Session: One instance per user session
- Custom application-specific scopes

Example usage with custom scope:

    class RequestScope implements Scope {
      final Map<String, Object> _objects = {};
      final Map<String, List<Runnable>> _destructionCallbacks = {};

      @override
      Object get(String name, ObjectFactory factory) {
        return _objects.putIfAbsent(name, () => factory());
      }

      @override
      Object? remove(String name) {
        _runDestructionCallbacks(name);
        return _objects.remove(name);
      }

      // ... other interface implementations
    }

    final requestScope = RequestScope();
    final userService = requestScope.get('userService', () => UserService());

## Constructors

PodScope.new()

## Properties

hashCode → int
  The hash code for this object.
  no setter inherited
runtimeType → Type
  A representation of the runtime type of the object.
  no setter inherited

## Methods

get(String name, ObjectFactory<Object> factory) → Future<ObjectHolder<Object>>
  Return the object with the given name from the underlying scope, creating it if not found in the underlying storage mechanism.
getConversationId() → String?
  Return the conversation ID for the current underlying scope, if any.
noSuchMethod(Invocation invocation) → dynamic
  Invoked when a nonexistent method or property is accessed.
  inherited
registerDestructionCallback(String name, Runnable callback) → void
  Register a callback to be executed on destruction of the specified object in the scope (or at destruction of the entire scope, if the scope does not destroy individual objects but rather only terminates in its entirety).
remove(String name) → ObjectHolder<Object>?
  Remove the object with the given name from the underlying scope.
resolveContextualObject(String key) → Object?
  Resolve the contextual object for the given key, if any.
toString() → String
  A string representation of this object.
  inherited

## Operators

operator ==(Object other) → bool
  The equality operator.
  inherited