Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Just a prototype of comment #117

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Just a prototype of comment #117

wants to merge 3 commits into from

Conversation

wcyz666
Copy link
Contributor

@wcyz666 wcyz666 commented Aug 1, 2014

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
Copy link
Owner

hupili commented Aug 1, 2014

  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
Copy link
Contributor Author

wcyz666 commented Aug 1, 2014

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
Copy link
Owner

hupili commented Aug 2, 2014

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

@hupili
Copy link
Owner

hupili commented Aug 2, 2014

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

  • Is it a special type of Message? If so, we may consider derive the class from Message. If not, should Message and Comment be derived from some intermediate common base, for they already have many similarities.
  • Same for CommentID.
  • How common is the comment function/ object available? The middleware tries to find common denominator of different platforms. You already see that we throwed many things away because they are not so common. If there is no comment function, can you find any substitute? e.g. Twitter does not have it and it even does not separate the "reply" from "status update"; However, by using some special format, it can represent "reply" and add in-reply-to field. You need to do this research before mass production.

@hupili
Copy link
Owner

hupili commented Aug 2, 2014

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
Copy link
Owner

hupili commented Aug 2, 2014

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
Copy link
Contributor Author

wcyz666 commented Aug 3, 2014

  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
Copy link
Contributor Author

wcyz666 commented Aug 3, 2014

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
Copy link
Contributor Author

wcyz666 commented Aug 3, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants