-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Create macros to minimise boilerplate when defining new records & zomes #22
Comments
Rather than working this into the spec branch, this probably wants its own branch. Agreed? |
Yes of course. Ideally every issue should have its own branch. |
For clarity: this is about reducing the boilerplate within each VF record definition file by taking out the repetition currently needed in defining entry / create request / update request / response structs and the logic inbetween them. It does not cover pulling common field definitions out to reduce the boilerplate needed in eg. defining A good way to approach this is probably to come to agreement on what the final record definition should look like, and then work backwards from there to implement the macro which will translate that into something similar to the current verbose record definition code. |
Something else to note: we are likely moving to a pattern where referenced fields have separate methods for manipulating them, rather than being editable as fields of the main record structures. As such, it's likely that the only wiring of link fields into a record is in the READ phase. It's also likely that we will want other types of non-editable "derived" fields in addition to link-based ones (eg All this being the case, my suggestion would be to implement derived fields as callbacks which accept the input |
Looking good after implementing |
Once #18, #19, #20 & #21 are completed we will have covered most of the data structures needed for VF records. This would be a good time to take the thus-far unavoidable field duplication and verbose
impl
definitions in the core VF modules and turn those into macros so that the code is kept as DRY as possible.The text was updated successfully, but these errors were encountered: