Alex G Rothberg
2015-01-21 15:35:45 UTC
What (if any) is the best architectural pattern to describe DRF? Is it MVC,
MVVM <https://en.wikipedia.org/wiki/Model_View_ViewModel>, or some other
pattern?
In trying to describe how the various components (models, views, routers,
serializers and parsers/ renderers) of DRF map to the more traditional
roles of MVC, the best I came up with is:
DRF MVC
-------------------------
model M
serializer+renderer V
router + view C
In the case of DRF, the DRF/Django "view" looks at the header, etc to
determine the Rendering / Parsing needed. The render+the serializer does
the actual "view" part of MVC. That being said, MVVM might be a more
accurate architecture.
the flow looks like:
Model --(Serializer)--> python dict/list --(Renderer)--> json/xml/yaml/html
or
Model <--(Serializer)-- python dict/list --(Parser)<-- json/xml/yaml/html
MVVM <https://en.wikipedia.org/wiki/Model_View_ViewModel>, or some other
pattern?
In trying to describe how the various components (models, views, routers,
serializers and parsers/ renderers) of DRF map to the more traditional
roles of MVC, the best I came up with is:
DRF MVC
-------------------------
model M
serializer+renderer V
router + view C
In the case of DRF, the DRF/Django "view" looks at the header, etc to
determine the Rendering / Parsing needed. The render+the serializer does
the actual "view" part of MVC. That being said, MVVM might be a more
accurate architecture.
the flow looks like:
Model --(Serializer)--> python dict/list --(Renderer)--> json/xml/yaml/html
or
Model <--(Serializer)-- python dict/list --(Parser)<-- json/xml/yaml/html
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.