Registration

  • 消除了对遗留注解包的依赖,该包即将被弃用。

  • 允许提供与使用编程模型相同的功能集。

  • 使该部分的重新设计和现代化成为可能,而不会破坏现有应用程序。

有两种不同的方式来定义命令:通过注解模型和通过编程模型。在注解模型中,你可以在一个类中定义你的方法,并使用特定的注解注释这个类和方法。在编程模型中,你使用更低层的方法,定义命令注册(以 bean 的形式或通过动态地使用命令目录进行注册)。

There are two different ways to define a command: through an annotation model and through a programmatic model. In the annotation model, you define your methods in a class and annotate the class and the methods with specific annotations. In the programmatic model, you use a more low level approach, defining command registrations (either as beans or by dynamically registering with a command catalog).

3.1.x 开始,添加了使用 annotations 定义命令的更好支持。首先,因为最终提供 legacy annotations 的标准包将被弃用并移除。其次,以便我们能够提供与使用底层 CommandRegistration 相同的特性设置。创建新的注解模型让我们能够重新思考和现代化该部分,而不中断现有应用程序。

Starting from 3.1.x a better support for defining commands using annotations were added. Firstly because eventually standard package providing legacy annotations will get deprecated and removed. Secondly so that we’re able to provide same set of features than using underlying CommandRegistration. Creating new a annotation model allows us to rethink and modernise that part without breaking existing applications.