You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently using AvroModel requires inheriting from it. Providing a fully functional interface would allow to use the functionality for all dataclasses. Also, this way certain rather generic method-names (like validate) that could clash with other names, would not be on every instance.
Example of this design philosophy is "attrs" the project from which dataclasses were originally derived.
Describe the solution you'd like
Looking through AvroModel, most methods seems to be classmethods - these could be extracted functionally and applied to the class passed as an argument. The instance-methods on AvroModel could be provided as functions applied to instances. The original AvroModel can get the same separately defined methods
Describe alternatives you've considered
Not sure what alternative to use. Enforcing use of AvroModel in an inheritance -schema if I dont control all classes myself seems difficult.
Additional context
None
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Currently using AvroModel requires inheriting from it. Providing a fully functional interface would allow to use the functionality for all dataclasses. Also, this way certain rather generic method-names (like validate) that could clash with other names, would not be on every instance.
Example of this design philosophy is "attrs" the project from which dataclasses were originally derived.
Describe the solution you'd like
Looking through AvroModel, most methods seems to be classmethods - these could be extracted functionally and applied to the class passed as an argument. The instance-methods on AvroModel could be provided as functions applied to instances. The original AvroModel can get the same separately defined methods
Describe alternatives you've considered
Not sure what alternative to use. Enforcing use of AvroModel in an inheritance -schema if I dont control all classes myself seems difficult.
Additional context
None
The text was updated successfully, but these errors were encountered: