GFramework/GFramework.Core/architecture/ArchitectureOptions.cs
GwWuYou 3e672cf56f refactor(architecture): 重构架构基类以支持依赖注入和服务配置
- 将Architecture类重构为使用构造函数注入IArchitectureConfiguration、IArchitectureServices和IArchitectureContext
- 移除泛型参数和单例模式,改为使用依赖注入容器管理实例
- 添加异步初始化方法InitializeAsync支持异步初始化场景
- 引入ArchitectureOptions类统一管理架构配置选项
- 创建DefaultArchitectureConfiguration和DefaultArchitectureServices默认实现
- 新增IArchitectureContext接口提供统一的上下文访问
- 添加IAsyncInitializable接口支持异步初始化能力
- 简化架构生命周期阶段,移除Created、BeforeInit和AfterInit阶段
- 更新事件系统为ITypeEventSystem接口实现
- 重构命令和控制器接口,统一使用IContextAware替代多个能力接口
- 移除FunctionalArchitectureOptions和相关委托配置方式
- 优化日志记录使用配置中的LoggerFactory实例
2025-12-24 23:09:17 +08:00

20 lines
660 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

namespace GFramework.Core.architecture;
/// <summary>
/// 架构选项配置类,用于定义架构行为的相关配置选项
/// </summary>
public sealed class ArchitectureOptions(
bool strictPhaseValidation = true,
bool allowLateRegistration = false
)
{
/// <summary>
/// 严格阶段验证开关当设置为true时启用严格的阶段验证机制
/// </summary>
public bool StrictPhaseValidation = strictPhaseValidation;
/// <summary>
/// 允许延迟注册开关当设置为true时允许在初始化完成后进行组件注册
/// </summary>
public bool AllowLateRegistration = allowLateRegistration;
}