BlogEngine.NET Architecture and source Code Analysis series PART8: Extending

Source: Internet
Author: User
Tags blogengine

Datastore analysis

In the fourth article in this series, I've given you an analysis of blogengine.net global configuration. In this article I will do a simple analysis of the more classical part of the blogengine.net Datastore, this datastore mainly completes the blogengine.net three major extension features (Extension,widget,theme) Data storage section, which provides a unified storage model for extended features. Datastore is based on the provider storage (introduced in the third article in this series), the content of this article will be related to the extension of the following section of the article has some connection, I hope you continue to pay attention to.

Most of the three extended features of BlogEngine.NET are done by developers, that is, most of them are later added to the blogengine.net, so these stores must be completed separately and are important for the uniformity of the model. Since developers are developers, these standards are particularly important so that the parts that are developed can be well integrated with the parts of the system. The datastore mentioned here refers to the type of BlogEngine.Core.DataStore space.

How to design the datastore in the BlogEngine.NET

Let's look at an inheritance chart first:

From the above we can see that extensionsettings and widgetsettings are direct subclasses of Settingbase. Extensionsettings is mainly for the implementation of the settingbase for extension, widgetsettings is for the widget and the realization of the settingbase, For theme the entire blogengine.net is not currently involved.

Extensionsettingsbehavior,stringdictionarybehavior,xmldocumentbehavior these three classes all implement the Isettingsbehavior interface, Isettingsbehavior only loads the configuration and saves the configuration two method declarations. In addition ExtensionType is a type of enumeration used to represent the extension.

Settingbase also has two methods for loading and saving configurations, in addition to a reference to Isettingsbehavior in Settingbase. and settingbase load and save the interior is also through the Isettingsbehavior to save and load completed, which seems to be a bridge mode. From the above analysis we can know that for extension data loading and saving is done through the extensionsettings, concrete implementation is done by Extensionsettingsbehavior, Extensionsettingsbehavior internal use of Blogservice call provider complete. The loading and saving of the widget's data is done through widgetsettings, and the implementation is done by Stringdictionarybehavior, The interior of the Stringdictionarybehavior is also done using the Blogservice call provider, Note that serializablestringdictionary inherits from StringDictionary and implements IXmlSerializable to complete the serialization and deserialization of Dictionary objects.

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.