inveniosoftware / flask-resources

REST APIs for Flask
https://flask-resources.readthedocs.io
MIT License
3 stars 21 forks source link

discussion: loaders, response, serializer and deserializer naming #39

Closed ppanero closed 4 years ago

ppanero commented 4 years ago

@fenekku 's comment:

Making the symmetry between request and response explicit in the name itself would communicate that to the developers. I tried a couple but I am not fully satisfied with any:

request_handler | response_handler request_handler doesn't really handle the request, it handles the parsing/deserializing

request_extractor | response_injector A little too steampunky + injecting is maybe inaccurate

request_disassembler | response_assembler A bit wordy

request_unloader | response_loader (think of the request as a package on a conveyor belt) the fact that unloader replaces former loader is perhaps confusing.

request_maker | response_maker (as in we are making a standardized request/response from what we get) Making in both cases might be iffy.

request_parser | response_unparser "unparser" not great...

Maybe the symmetry doesn't quite work either...

ppanero commented 4 years ago

I am not a fan of inverting loader/deserializers. Mainly because we haver serializer on the other side, then it the counter word (serializer --> deserializer) would mean different things depending on input/output direction. About loaders/response I am open to suggestions :)

fenekku commented 4 years ago

This was originally from my comments and much change has happened since, so I am closing it in favour of: https://github.com/inveniosoftware/flask-resources/issues/73