Pylons / pyramid_blogr

Pyramid_blogr is an example implementation of Flaskr app with Pyramid Web Framework
72 stars 39 forks source link

Consider re-organizing by component? #55

Closed pauleveritt closed 8 years ago

pauleveritt commented 8 years ago

This is another very minor nit. I don't know if your goal with this repo is to really help people with "best practices". If so, here's a suggestion that really tortures the application of best practices.

IMO, we need to do a better job of encouraging code organization by component (e.g. pyramid_blogr/blog/models, pyramid_blogr/blog/views) instead of machinery (pyramid_blogr/models/blog, pyramid_blogr/views/blog). Then, each component has an init that does an includeme, pulled into the master init via config.include() with a route prefix.

This demo would only have "home" and "blog". Maybe login. So it is certainly torturing the idea. But at the same time, such a small application might be the best place to introduce this.

ergo commented 8 years ago

I like the approach where I organize application by areas:

-- views/admin/admin_section1.py
-- view/admin/admin_section2.py
-- views/front_index.py
-- views/front_registration.py

I find organizing by component less intuitive especially if some places contain multiple components.

pauleveritt commented 8 years ago

Ok, let's consider this closed.