Design mode used by the qpmail Project

Source: Internet
Author: User

1. Distribute messages (or requests) to different classes for processing: similar to front controler in MVC Architecture, write a handler class to distribute various messages, then, use the command mode for related processing.
A specific concrete command is returned using a simple factory, but different concrete commands are cached with hashtable or dictionary when each concrete command is created to reduce loading.ProgramSets and uses reflection to create a concrete command, resulting in performance consumption.
2. when processing a message (or request), how can we ensure that the message processing is not strongly coupled by dynamic and unknown subprocesses?
There are two solutions: You can use the observer mode, such as the application of event and delegate in the Asp.net module; you can also use the composit mode, but the height of the tree is 2.

3. Handle the changes in message processing in two directions: "Message Type Distribution" and "Message Processing plug-in" can also be designed in Bridge Mode.

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.