You define a decorator just like any other method.
定义修饰符与定义其他方法无异。
He is not only a photographer, but also a decorator.
他不仅是一个摄影家,也是一装饰者。
InfoQ: What distinguishes a decorator from an interceptor?
InfoQ:装饰器和拦截器的区别是什么?
A decorator is a wrapper that is called instead of a function.
一个装饰器被称为一个包装器而不是一个函数。
There might be inheritance or a decorator as an alternative solution for you.
有可能是遗传或装饰作为另外一种解决方案。
Their ICONS are shown with a decorator at the top left, as shown in Figure 28.
在它们所显示的图标的左上方有一个小的装饰物,如图28所示。
Their icons are shown with a decorator at the top left, as shown in Figure 28.
在它们所显示的图标的左上方有一个小的装饰物,如图28所示。
The scope of a decorator is limited to the language feature that it decorates.
装饰器的作用域会被限制在它所装饰的语言特性。
It is not hard to create a decorator that "enhances" a regular numerical function.
创建一个可以“增强”普通数值函数的decorator并不困难。
A decorator, being a Python function, can do absolutely anything other Python code can.
作为一个python函数,decorator完全可以实现其他Python代码所实现的任何功能。
But I can make a decorator without adding the extra structure of a class-based approach.
但是,我在创建修饰符时可以不用添加额外的基于类的方法结构。
A decorator might return a function, but one that is not meaningfully associated with the undecorated function.
decorator可能会返回一个函数,但这个函数与未修饰的函数之间不存在有意义的关联。
In this rather long letter the woman said that as she was a decorator and I an architect, we might work together.
在这封挺长的信里,那个女人说她是装潢师我是建筑师,我们没准可以合作做点什么。
Having a certain reflexive elegance, the main component of the decorator module is a decorator called decorator .
decorator模块的主要组件具有某种自反式的优雅,它是一个称为decorator的decorator。
A decorator is a function that adds metadata to a class, its members (properties, methods) and function arguments.
装饰器是一个函数,它将元数据添加到类、类成员(属性、方法)和函数参数。
When Amie Corley and her husband Rob purchased this 1907 St. Louis home in 2004, Amie was just starting her career as a decorator.
当AmieCorley和她的丈夫Rob在2004年在圣路易斯买下这座建于1907年的房子时,她才刚刚成为一位室内设计师。
Plus, because it is a decorator-based JUnit extension framework, you can easily use JUnitPerf to decorate existing JUnit tests.
另外,由于它是一个基于装饰器的JUnit扩展框架,所以可以很容易地用JUnitPerf 装饰现有的 JUnit测试。
Furthermore, why is it important that a decorator object's interface conforms to the interface of the component. it decorates?
进一步说,为什么装饰者对象的接口服从被装饰部件的接口那么重要呢?
He redecorates all the time, and probably it would be greenest to leave things as they are, but he is a decorator and likes things to look a certain way.
他反复地对其装修,而不装潢可能是最环保的了,但是作为一个装潢师他有自己的喜好。
All a decorator does is let you avoid repeating the method name, and put the decorator near the first mention of the method in its definition. For example.
decorator所做的一切就是使您避免重复使用方法名,并且将decorator放在方法定义中第一处提及其名称的地方。
Because JUnitPerf is a decorator-based framework, in order to actually harness it, you must provide a suite method and decorate your existing test with a TimedTest.
由于JUnitPerf是一个基于装饰器的框架,为了真正地驾驭它,必须提供一个suite方法并将现有的测试装饰以TimedTest。
In the filesystem class, you added a transactional method that you will use a decorator to handle the semantics of the commits to the database for filesystem events.
在Filesyste m类中,您添加了一个transactional方法,您将使用一个修饰类来处理将文件系统事件提交给数据库的语义。
This pattern USES late binding to invoke the currently valid version of a decorator process representing the actual human task, and thus it enables late binding to that task.
此模式使用后期绑定来调用表示实际人工任务的装饰流程的当前有效版本,从而实现到该任务的后期绑定。
For example, if a process calls a human task in a late-bound fashion, it calls a decorator process using late binding, and in turn, the decorator process calls the task statically.
例如,如果某个流程以后期绑定方式调用某个人工任务,则它将使用后期绑定调用装饰流程,而装饰流程又静态地调用该任务。
He works as a painter and decorator.
他的职业是油漆匠和装潢师傅。
An advantage of the decorator pattern is that you can easily tack on more than one decorator to the base at a time.
装饰器模式的优点是可以轻松地同时跟踪库的多个装饰器。
The general "decorator pattern" is a design pattern that allows adding new behavior to an existing component dynamically.
一般的“装饰模式”是一种设计模式,允许动态地向现有组件添加新的行为。
The general "decorator pattern" is a design pattern that allows adding new behavior to an existing component dynamically.
一般的“装饰模式”是一种设计模式,允许动态地向现有组件添加新的行为。
应用推荐