# registerSingleton abstract method

Future<void> registerSingleton(

1. String name,
2. Class type, {
3. ObjectHolder<Object>? object,
4. ObjectFactory<Object>? factory,

})

Register a new `pod` under the given `name`.

This method adds a pod to the registry with the specified name. The pod name must be unique within the registry and follow the naming conventions established by the implementation.

`name`: The name to register the pod under. Must be unique and non-empty. Follows typical pod naming patterns. `pod`: The pod object to register. The type `T` depends on the registry implementation (PodDefinition, Object, etc.)

Throws:

- IllegalArgumentException if name is null, empty, or invalid
- PodException if a pod with the same name already exists
- UnsupportedOperationException if the registry is read-only

Example:

    // Register a singleton instance
    final instance = UserService();
    singletonRegistry.registerSingleton(
      'userService',
      object: ObjectHolder<UserService>(instance, packageName: "jetleaf")
    );

    // Register a singleton factory
    singletonRegistry.registerSingleton(
      'userService',
      factory: ObjectFactory<UserService>(() => ObjectHolder<UserService>(UserService(), packageName: "jetleaf"))
    );

## Implementation

    Future<void> registerSingleton(String name, Class type, {ObjectHolder<Object>? object, ObjectFactory<Object>? factory});