# PodDefinition constructor

PodDefinition({

1. String name = "",
2. required Class type,
3. bool isPodProvider = false,
4. String? description,
5. DependencyCheck dependencyCheck = DependencyCheck.NONE,
6. ScopeDesign? scope,
7. DesignDescriptor? design,
8. LifecycleDesign? lifecycle,
9. List<DependencyDesign> dependsOn = const [],
10. MutablePropertyValues? propertyValues,
11. FactoryMethodDesign? factoryMethod,
12. AutowireCandidateDescriptor? autowireCandidate,
13. ConstructorArgumentValues? constructorArgumentValues,

})

Creates a PodDefinition with the provided configuration.

Default values:

- `dependencyCheck` → `DependencyCheck.NONE`
- `scope` → `ScopeType.SINGLETON`
- `design` → `DesignRole.APPLICATION`
- `lifecycle` → defaults to no init/destroy methods
- `autowireCandidate` → enabled with `AutowireMode.NO`
- `factoryMethod` → empty placeholder
- `propertyValues` → empty
- `constructorArgumentValues` → empty

Defines the blueprint of a pod (component) in the dependency injection system.

A PodDefinition encapsulates all metadata required to configure a component:

- Its name and type (Class)
- How dependencies are checked ({@macro dependency_check})
- Its scope ({@macro scope_type})
- Its design role ({@macro design_role})
- Lifecycle behavior ({@macro lifecycle_design})
- Dependency relationships (DependencyDesign)
- Property values (MutablePropertyValues)
- Method overrides (`MethodOverrides`)
- Factory methods (FactoryMethodDesign)
- Autowiring configuration ({@macro autowire_mode})
- Constructor arguments (ConstructorArgumentValues)

This abstraction allows the system to define, manage, and wire components consistently.

### Example

    final pod = MyPodDefinition(
      name: "userService",
      type: Class<OtherService>(),
      scope: ScopeDescriptor(
        type: ScopeType.SINGLETON,
        isSingleton: true,
        isPrototype: false,
      ),
      design: DesignDescriptor(
        role: DesignRole.APPLICATION,
        isPrimary: true,
        isInfrastructure: false,
      ),
      lifecycle: LifecycleDesign(
        isLazy: true,
        initMethods: ["initialize"],
        destroyMethods: ["dispose"],
      ),
      dependsOn: [DependencyDescriptor("databaseService")],
      factoryMethod: FactoryMethodDescriptor("UserServicePod", "create"),
      autowireCandidate: AutowireCandidateDescriptor(
        autowireCandidate: true,
        autowireMode: AutowireMode.BY_TYPE,
      ),
    );

    print(pod.name); // "userService"
    print(pod.scope.type); // ScopeType.SINGLETON

## Implementation

    PodDefinition({
      this.name = "",
      required this.type,
      this.isPodProvider = false,
      this.description,
      this.dependencyCheck = DependencyCheck.NONE,
      ScopeDesign? scope,
      DesignDescriptor? design,
      LifecycleDesign? lifecycle,
      this.dependsOn = const [],
      MutablePropertyValues? propertyValues,
      FactoryMethodDesign? factoryMethod,
      AutowireCandidateDescriptor? autowireCandidate,
      ConstructorArgumentValues? constructorArgumentValues,
    }) : scope = scope ?? ScopeDesign(
          type: ScopeType.SINGLETON.name,
          isSingleton: true,
          isPrototype: false,
        ),
        design = design ?? DesignDescriptor(
          role: DesignRole.APPLICATION,
          isPrimary: false,
        ),
        lifecycle = lifecycle ?? LifecycleDesign(
          isLazy: false,
          initMethods: const [],
          destroyMethods: const [],
          enforceInitMethod: true,
          enforceDestroyMethod: true,
        ),
        autowireCandidate = autowireCandidate ?? AutowireCandidateDescriptor(
          autowireCandidate: true,
          autowireMode: AutowireMode.NO,
        ),
        propertyValues = propertyValues ?? MutablePropertyValues(),
        executableArgumentValues = constructorArgumentValues ?? ConstructorArgumentValues(),
        factoryMethod = factoryMethod ?? FactoryMethodDesign('', '')
    {
      final visited = <Class>{};

      annotatedClasses.add(type);
      _collectAnnotations(type, visited);
    }