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

Is everything an adapter ? #40

Closed
jpic opened this issue Mar 9, 2018 · 1 comment
Closed

Is everything an adapter ? #40

jpic opened this issue Mar 9, 2018 · 1 comment

Comments

@jpic
Copy link
Contributor

jpic commented Mar 9, 2018

Another possibility is to make everything an adapter, which can have adapters who know about their parent, in which case steps just adapters methods or plain callbacks, which can orchestrate other steps of other adapters which are in a mapping structure, and defining a step is just defining a method or setting callbacks which may depend on methods priorly executed without errors because going through .steps.method() creates a safe clone (thanks @Ian-Foote !)

A step is a callback, but steps is a magic python object, it just calls a step callback(s) in an safe (clone) adapter context.

https://gist.github.com/jpic/9f9ef74e5ab739b4ffd04ecc373d1d55

In this case everything is an adapter, and executing a method through steps do a safe clone before actually calling the callback, that's why we need not to worry about it from the callbacks themselves. But if you want to code like this, jeez, there will be a lot of python magic ....

Is this more what it should look like ?

@jpic
Copy link
Contributor Author

jpic commented Mar 27, 2018

Closing for now.

@jpic jpic closed this as completed Mar 27, 2018
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