Task System Development

Source: Internet
Author: User
Task System mode

RT, the company needs to add a task system to the original site, that is, when the user to meet a certain requirements can receive a certain reward, I now have two ideas:
1 Modify other parts of the code, in the user to do tasks related to the place to add code, record the user's action.
2 Almost does not modify the original code, as far as possible by querying the database to determine whether the user reached a task completion requirements.
May I ask which of the two methods is good, why, and ask the experienced predecessors to answer the following.


Reply to discussion (solution)

Modify existing code as few as possible + database storage task completion status

Encapsulates the task system, leaving an interface to query the completion state of the task (and, of course, the task, and so on.

Call this interface at the critical operational location to query the user's task completion status and processing in the task system (you can pass the current position as a parameter to the task system, the task system according to the location (page) and the different tasks and task completion of the different to carry out the corresponding processing)

Otherwise the code will be more and more chaotic? New systems on the existing system personal recommendations are in a similar way, the existing system to modify the code, add an interface to correspond to the new system

The condition that the user reaches a certain requirement is not very clear.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.