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

Make the serializer JSON independent to further comply with "clean architecture" #53

Open
Createdd opened this issue Aug 10, 2018 · 3 comments
Labels
enhancement 🚀 New feature or request

Comments

@Createdd
Copy link
Member

See file here

See the discussion on this issue on Slack

Right now the Response is JSON dependent (end of the file):

return Response(
        json.dumps(response.value, cls=ser.ArxivDocEncoder),
        mimetype="application/json",
        status=STATUS_CODES[response.type],
    )
@Createdd Createdd added the enhancement 🚀 New feature or request label Aug 10, 2018
@Createdd
Copy link
Member Author

One way to let objects interact is to use composition. This can be a good way to decouple functions.
See this article to fresh up the ideas of delegation in OOP in Python

@liadmagen
Copy link
Member

I would also add this source for how to refactor python properly

@liadmagen
Copy link
Member

And regarding the serialization method itself, json is quite slow. ujson is already faster, and there are also other alternatives in the benchmark competition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🚀 New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants