Open-source ASP. NET e-commerce platform/Enterprise Library 5.0 development wizard-Introduction (1)

Source: Internet
Author: User
Tags connectionstrings

Enterprise Library 5.0Development wizard-Introduction (1)

  • Microsoft Enterprise Library 5.0 is officially released !!!
    Applications developed based on the Microsoft. NET FrameworkProgramEnterprise Library can be used for enterprise-level business programs, WPF, WCF, or ASP. NET applications. This seriesArticleIt will help you quickly master the Enterprise Library and Application of sample programs, making it easier for you to use Enterprise Library during development.

    You canWhat do you get?

    Enterprise Library is composed of a series of application blocks. Each Application Block is a reusable component that helps developers solve the common challenges faced by enterprise-level development.

    Assembly to be referenced

    In any application that uses the Enterprise Library, the following five assemblies must be referenced: General Assembly, unity dependency injection container, and service location assembly.

    Microsoft. Practices. enterpriselibrary. Common. dll

    Microsoft. Practices. Unity. dll

    Microsoft. Practices. Unity. configuration. dll

    Microsoft. Practices. Unity. Interception. dll

    Microsoft. Practices. servicelocation. dll

    In addition to the necessary assembly, you also need to reference the application blocks Assembly used in the program. Each application block has several sets. Generally, it contains a major assembly. The Assembly and block have the same name (such as Microsoft. practices. enterpriselibrary. caching. DLL), there are some additional assemblies that implement specific handler or functions. If you need to use these functions, you need to apply these additional assembly. For example, Microsoft. Practices. enterpriselibrary. caching. database. dll is required to cache data in the caching block. To encrypt the cached data, Microsoft. Practices. enterpriselibrary. caching. cryptography. dll is required. If you only cache unencrypted data in the memory, you do not need to reference these sets.

    ConfigurationEnterprise Library

    The configuration management interface of the Enterprise Library is displayed.

    Encryption configuration item

    The following is the configuration of a simple unencrypted data access block.

    <Dataconfiguration defaultdatabase = "connection string"/>

    <Connectionstrings>

    <Add name = "connection string"

    Connectionstring = "database = theimportantone; server = wehaveliftoff;

    User ID = secret; Password = donttellne1"

    Providername = "system. Data. sqlclient"/>

    </Connectionstrings>

    When you specify the dataprotectionconfigurationprovider option, the encrypted configuration information is as follows.

    <Dataconfiguration

    Configprotectionprovider = "dataprotectionconfigurationprovider">

    <Encrypteddata>

    <Cipherdata>

    <Ciphervalue> aqaaancmnd8bfderjhoawe/Cl + sbaaac8hvtgvqb0quqi81ya0uh

    ...

    Jyeadytibvtcbmvxefun5mwt/T </ciphervalue>

    </Cipherdata>

    </Encrypteddata>

    </Dataconfiguration>

    <Connectionstrings

    Configprotectionprovider = "dataprotectionconfigurationprovider">

    <Encrypteddata>

    <Cipherdata>

    <Ciphervalue> aqaaancmnd8bfderjhoawe/Cl + sbaaac8hvtgvqb0quqi81ya0uh

    ...

    Zbjp7sqxvsas = </ciphervalue>

    </Cipherdata>

    </Encrypteddata>

    </Connectionstrings>

    The Enterprise Library can automatically decrypt and read configuration information.Code.

    Instantiate Enterprise LibraryObject

    In most applications, the Enterprise Library application block has been loosely coupled to use components. Generally, you need to use the dependency injection mode to create a component or fa c Ade instance. By default, Enterprise Library uses the unity dependency injection container to inject objects in application configuration.

    Unity is a lightweight, flexible, configurable, and scalable dependency injection container that supports constructor, attribute setting, and method call injection. To effectively use the Enterprise Library, you should be familiar with the basic methods for creating Enterprise Library objects, and inject Enterprise Library objects to application classes and components.

    if you use an earlier version of Enterprise Library, you may be more familiar with the method for creating objects. Early enterprise libraries generally support or recommend the use of static fa C Ade, or directly instantiate Enterprise Library objects. In the current Enterprise Library 5.0, these methods are still supported to be compatible with existing applications, but are not recommended and may not be supported in future versions.

Related Article

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.