gothinkster / golang-gin-realworld-example-app

Exemplary real world application built with Golang + Gin
https://realworld.io
MIT License
2.52k stars 497 forks source link

Add views similar to `django` like structure #11

Open vrongmeal opened 6 years ago

wangzitian0 commented 6 years ago

@vrongmeal Thank you for your work. I think gin was more likely to Flask, installed of Django. Django offer us a Generic editing views https://docs.djangoproject.com/zh-hans/2.1/ref/class-based-views/generic-editing/, and then we could inherit the view class in view.py. But we don't have that or golang interface. Why we need split them?

vrongmeal commented 6 years ago

This sample application seemed quite similar to that of any Django app. Even I think gin is more like Flask but architecture of this app seemed quite similar to that of Django or I should say the MVT architecture. Also, I felt there is no harm in keeping different things in separate files. :)