Top "Decorator" questions

Decorator is an object-oriented design pattern that allows adding behavior to existing classes in a dynamic fashion.

Webpack babel 6 ES6 decorators

I've got a project written in ES6 with webpack as my bundler. Most of the transpiling works fine, but when …

javascript webpack ecmascript-6 babeljs decorator
How to decorate a method inside a class?

I am attempting to decorate a method inside a class but python is throwing an error. My class looks like …

python decorator
When to Use the Decorator Pattern?

I am going over my design patterns, and one pattern I have yet to seriously use in my coding is …

design-patterns decorator
Ruby on Rails patterns - decorator vs presenter

There is all sorts of talk lately in the Ruby on Rails community about decorators and presenters. What is the …

ruby-on-rails design-patterns decorator presenter
Decorator execution order

def make_bold(fn): return lambda : "<b>" + fn() + "</b>" def make_italic(fn): return lambda : "<…

python decorator python-decorators
How to decorate all functions of a class without typing it over and over for each method?

Lets say my class has many methods, and I want to apply my decorator on each one of them, later …

python wrapper decorator
Python memoising/deferred lookup property decorator

Recently I've gone through an existing code base containing many classes where instance attributes reflect values stored in a database. …

python decorator
How to inject variable into scope with a decorator?

[Disclaimer: there may be more pythonic ways of doing what I want to do, but I want to know how …

python scope closures decorator python-decorators
Difference between the Composite Pattern and Decorator Pattern?

What is the difference between the Composite Pattern and Decorator Pattern?

design-patterns decorator composite
How to get all methods of a python class with given decorator

How to get all methods of a given class A that are decorated with the @decorator2? class A(): def method_…

python class methods decorator inspect