subfuzion / dart-flutter-fullstack-demo

Apache License 2.0
43 stars 14 forks source link

API Types in a common package #6

Closed MisterJimson closed 3 years ago

MisterJimson commented 3 years ago

We could have the API types in a common package to reduce duplication. One of the benefits of doing full stack with one language is code sharing.

MisterJimson commented 3 years ago

I am seeing this note here where you advise against it.

the JSON serializer code is maintained separately from the code in the backend. Tightly coupling client and server code through shared libraries (packages) is considered an anti-pattern with microservice architecture.`

Not sure I completely agree. May as well define DTO models in one place. Domain or client specific models should be separate, but I don't see a reason not to share pure DTO models.

Anyway I have it implemented here, I won't PR it if you don't want it: https://github.com/MisterJimson/dart-flutter-fullstack-demo/tree/shared