-
Notifications
You must be signed in to change notification settings - Fork 185
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
Where do data struct definitions live? #88
Comments
I'm actually in favor of Option 2 even if I inadvertently did Option 1. I think it helps keep the separate concerns of data and functions separate. Struct definitions by themselves do not cause any external code dependencies, even if they may depend on each other. Also, I've seen precedent in monorepos (which are complex undertakings) to keep struct/schema/IDL definitions apart from everything else, which acts as a source of truth for understanding data found in the wild. I think that strategy would work in the small like it does in the big. |
Consensus: start with Option 2. Open question: how do we structure our common crate(s)?
Tentative decision: make separate crates. It allows versioning of each type of common struct/trait to be independent, and prevents us from getting a giant kitchen sink. @Manishearth Does this sound good to you? |
I'm not fond of crate explosions so I'd slightly prefer the first option. If we are to split perhaps we can group things? Have a common one, plus specific crates that contain a lot of related datatypes. I'm not sure. Maybe worth starting off with common and splitting if we see it getting big? |
Yeah, the idea was to create crates around themes.
Does that sound like the right split? |
That seems fine! I don't want to have a bajillion tiny crates is all |
Hmm, I was interpreting our decision here as putting all structs into one component (internal crate), similar to consolidating all protobuf schemas/definitions in one place, and having executable code / But I don't think it's possible to separate struct definitions from their |
Now that #61 is checked in, here's how you can add a new data struct:
The structs do not require a heavy |
My current WIP for the data provider (#61) passes around abstract hunks of data (
Any
in Rust), which can be cast to specific structs using dynamic type checking at runtime.My question is: where does the struct definition
SymbolsV1
live in code? It could live:I'm doing Option 2 in #61. I noticed Elango is doing Option 1 in #86. Because of the extensibility argument, I have a slight preference for Option 1, but I fear it could get unwieldy for data provider implementations.
The text was updated successfully, but these errors were encountered: