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

Design question about storrs and drivers #123

Open
wlandau opened this issue Mar 15, 2020 · 0 comments
Open

Design question about storrs and drivers #123

wlandau opened this issue Mar 15, 2020 · 0 comments

Comments

@wlandau
Copy link
Contributor

wlandau commented Mar 15, 2020

I am curious about your overall design considerations of the storr/driver implementation, how well you think they played out, and what you might do differently if you were to rewrite storr today.

In #122, the clear() method of the base storr class first looks for a clear() method in the driver and defaults to a backup method if none is found. This would be far more natural with sub-classes and inheritance. However, I am not saying sub-classes would have been better. Far from it: here in drake, I too use the decorator pattern for storrs. In drake's case, I thought object composition would be less brittle than inheritance for the implementation of specialized formats, given that the base class comes from another package, and I am satisfied with the result.

Was the thought process similar for storr itself? Did you originally envision external packages like thor and judge object composition to be better than exposing a class definition?

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