Discuz dismantling! One of NT: cache Module

Source: Internet
Author: User

I have been changing discuz recently! NT, discuz! NT was made to let others change it. Haha, although it is perfect, there is always something unsatisfactory in actual use. If you want to change it, you must have a good understanding of it, otherwise, I changed the version to 2.5, and there is already version 2.6, but there is no way to upgrade and use it because there are too many changes.

Change discuz! NT really makes people learn a lot of things. This stuff contains the necessary technologies for most system development. Although I still cannot tell it clearly, at least I can take discuz! NT is split, just like a child who liked to split toys, one by one, and one by one small module. Can it be used directly when necessary? It's a rock!

Always curious about discuz! NT cache module. I will learn about it this time, discuz! A large amount of cache is used in NT, so the performance is so good.

The first is the way to organize cache objects in this cache module. It seems that the cached object has a certain level of structure, which uses XML to save this structure, you can use XPath to obtain the node of a cache object. This node caches the key value of the object and uses this key value to obtain or delete the object in the cache.

XML is indeed better organized. When you need to update the cache in batches, for example, in discuz! The NT background provides the cache update function. You can obtain a node set through XPath, so that you can easily update the cache objects you want to update.

Second, the policy mode is also used here, discuz! NT uses more design patterns, including factory methods, template methods, and policyholders,

The policy-owner mode is used to separate the modules of the actually organized objects from those of the stored objects. net cache for a new version, you can easily expand, instead of modifying the original writeCode, Very good.

: Discuz.cache.rar

 

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.