Hi guys, 

My name is Michael Zhang, and I am very new to Pyramid. I have a quick 
question in designing a large web application backend, and hope the 
community can help me out. I really appreciate your help. It helps me to 
learn and get my job done.

My question is simple: what are some good strategies in organizing common 
methods or classes for operations that we might constantly use in our 
applications? For example, if we have a method to collect all the comments 
belonging to a blog post, where we should put this method/class in our 
application in a clear and organized fashion? To us, there are potentially 
two choices: 

Choice A. We can define our model Blog, and inside Blog, we can define a 
method like getAllComments. 

Choice B. We can separately define BlogCRUD class, that has methods to get 
all comments. 

I actually think both choices might not be the best to do. While Choice A 
clearly define all our methods at one place for one class of object, it 
feels not right - the getAllComments method intuitively should belong to 
the View callable, and should not be at the place where we define basic 
columns of the Blog, correct? And Choice B, though it separates model and 
operations on the models, it will let us loose some functionality provided 
by Sqlalchemy, like jumping from table to table (Blog.Comment.User, etc). 

So I think our choices so far are just not perfect, yet I know that this 
must be a common design problem that people face. So community, what should 
we do in your opinion? Again, I appreciate your help! 

Michael
 

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-devel+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-devel.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to