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

Protocol usage review #23

Open
asmodehn opened this issue Dec 29, 2021 · 1 comment
Open

Protocol usage review #23

asmodehn opened this issue Dec 29, 2021 · 1 comment

Comments

@asmodehn
Copy link
Owner

Protocols are currently a bit misused in the code design... we are using them with a new() function to convert data on callsite.

We should consider Protocol as providing the capability to be "used as a different type of data, regardless the original data structure".
For instance having one function per key of the map we want to emulate.
The struct being one specific, optimized version of this protocol...

This applies specifically for the code in the :xest library where we want to have a "common data format" for our purpose.

It seems it would make the conversion rules clearer, and would mean that we do the conversion only as needed, even if it might be a bit more cumbersome to write the first time...

@asmodehn
Copy link
Owner Author

To this, we could also add data generation strategy/ies leveraging stream_data, as it would be following the specified protocol...

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