hupili / snsapi

Cross platform middleware for Social Networking Services: Twitter, Facebook, SinaWeibo, Renren, RSS, Email, Sqlite, ... (more coming)
http://snsapi.ie.cuhk.edu.hk
159 stars 53 forks source link

Just a prototype of comment #117

Open wcyz666 opened 9 years ago

wcyz666 commented 9 years ago

This is a prototype of comment. Could you please give some advice? If you agree with this prototype I will begin to work on specific platform

hupili commented 9 years ago
  1. There are many diffs from Douban. Please pull (or rebase your code) from hupili/dev first
  2. It's hard to parse from the codes what you want to achieve. If it is a new feature, please describe in natural language first for a discussion. We need to know the use case and viability in advance. If you already have running code, a live demo or series of screenshots can also do the job.
wcyz666 commented 9 years ago

OK, what I want to achieve is comment class. This class is almost the same as message except two characteristic

  1. One extra mandatory field in CommentID class: "status_id", tell which status it belongs to.
  2. less optional fields, e,g., no "attachment" field.
hupili commented 9 years ago

Douban's diff is still there. This makes it more difficult to see the incremental part that is only related with comment functions.

hupili commented 9 years ago

If the comment class is almost the same as message class, we need to confirm:

hupili commented 9 years ago

You can also further detail your description in natural language. Instead of "how" you do it, you can think/talk more about "what" you want to achieve. For example, what interfaces should be exposed? what operation can be performed on Comment? can you reply a comment? ...

hupili commented 9 years ago

Of course, you can not get all the answers at once. It's OK to start prototyping a few platforms, so that you can see the common factors and differences. Getting some running code first is usually good. You can iterate a few times before you finalise the design.

Another way is to approach from application. Always put the new features of middleware into your applications so that you know whether it is useful or not.

A precaution is that, this branch is a major upgrade. We may not merge it before it's matured enough.

wcyz666 commented 9 years ago
  1. Message and Comment looks almost the same from both property and method, I think it's a good idea to create a base class for them to inherent. So as the commentID.
  2. More that half of the current channels execute getComment() and have exposed the interface in their respective open platform. Since it's habitual for us to scan the comments after read a feed from others, I think getComment() function is proper for our middleware.
  3. What I want to achieve is an extra method on Message object: getComment(self, message). This method will return a list of Comments of the input message for upper developer. This is the only interface exposed except those inherented from base class. Currently I didn't conceive any method Comment should have.( "reply a comment" is a good suggestion, but I have to check whether more than half of the current channels really support this function. If so, then I will add it. )
wcyz666 commented 9 years ago

Also I think it's May be acceptable if we provide an interface called unsubscribe() such that we can choose not to receive any feeds from a certain person? Well, just a grumble when testing SNSRouter.

wcyz666 commented 9 years ago

Oh, I contemplate and now argue that's a fabulous idea! Nearly all platform support this operation