Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6.12 Creator #4

Open
c71n93 opened this issue Nov 17, 2022 · 0 comments
Open

6.12 Creator #4

c71n93 opened this issue Nov 17, 2022 · 0 comments

Comments

@c71n93
Copy link
Member

c71n93 commented Nov 17, 2022

In the first example is considered that the method(createObject) of the decorator(concreteCreatorA) will overwrite the method with the same name of the decoratee(creator)

[] > creator
  # left to be redefined
  [] > createObject
  # operation over products
  [] > performOperation
    createObject.getWeight.plus 1 > @

[] > concreteCreatorA
  creator > @
  [] > createObject
    productA > @

[] > concreteCreatorB
  creator > @
  [] > createObject
    productB > @

[] > productA
  # let's suppose that this implementation
  # gets value from the production server
  [] > getWeight
    42 > @

[] > productB
  # let's suppose that this implementation
  # gets value from the testing server
  [] > getWeight
          24 > @

Full examples can be found in the paragraph 6.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant