Summary of the mechanism provided by Model metadata and summary of model metadata
At the very beginning, I have to talk about this part of the situation. At the beginning, I was dizzy by various ModelMetadata and various ModelMetadataProvider. It took me a lot of time to read several pages, after looking at a class chart, I will take a closer look at the relationships between classes and read this part again. I have learned something about it. This is probably a way to read books in the future, look at the code method and first understand the structure so that it will not be confused by a large class library. Then I first listed the class chart, which was adjusted based on my personal preferences.
The left side of the entire graph is the ModelMetadata part, and the right side is the Provider of metadata. Although many attributes of metadata are described earlier in this chapter, the metadata used in MVC is not ModelMetadata, it is a subclass of the class. Next we will introduce the classes one by one. The introduction is divided into two parts: the Model metadata on the left and the metadata Model provider on the right.
Model metadata
- DataAnnotationsModelMetadata: MVC uses declarative definitions based on Annotation features, so this class is defined. Displaycolumnattriute is used in the constructor of this class, which is mainly related to Display. This Attrubute class is used, and its Label value is the value of the corresponding attribute of this class, for example, the Address in the book is displayed with the DisplayText attribute value of Address.
- CachedModelMetadata <TPrototypeCache>: Built in prototype mode or provided by the Provider of the subclass CachedDataAnnotationsModelMetadata to calculate the attributes of all Model metadata. Its examples are also prompted in the book.
- CachedDataAnnotationsModelMetadata: Default metadata type in MVC, inherited from CachedModelMetadata <CachedDataAnnotationsMetadataAttribute>, used to cache the Model metadata information type. This Attribute contains all Model Metadata Annotation features.
Model metadata provider
- ModelMetadataProvider: Abstract base class of all providers, which defines the Get method for obtaining metadata of several metadata.
- AssociatedMetadataProvider: Override three methods of the ModelMetadataProvider base class. Actually, the abstract method CreateMetaData of this class declaration is called internally. This class is inherited by two providers. One is DataAnnotationsModelMetadataProvider, the second is CachedAssociatedMetadataProvider <TModelMetadata>.
- DataAnnotationsModelMetadataProvider: Inherits AssociatedMetadataProvider and defines the constructor of this class. Therefore, this is a actually usable Provder, which overrides the CreateMetaData abstract method defined in ociatedMetadataProvider. To provide the corresponding metadata.
- CachedAssociatedMetadataProvider <TModelMetadata>: Inherits the abstract class of AssociatedMetadataProvider. TModelMetadata integrates ModelMetadata. It also overwrites the CreateMetadata of the parent class and returns the abstract method of the corresponding Model metadata object. The cache function is available. If cache is available, Model metadata is generated in singleton mode. If no cache is available, a new metadata is generated.
- CachedDataAnnotationsModelMetadataProvider: Inherits CachedAssociatedMetadataProvider <TModelMetadata> and implements all the preceding abstract methods.
- ModelMetadataProviders: Get the currently used Provider through Current, which is of the ModelMetadataProvider type. The default value is the CachedDataAnnotationsModelMetadataProvider type.
The book sees this chapter to know that the default Model metadata type used in the framework is not the base class ModelMetadata, but its subclass, however, many attributes related to Model metadata customization are defined in the base class. I recall that the controller only controls the Model in the MVC mode, the entity types used for data storage are not mentioned in the entire Model. All data and business logic processing are attributed to the Model, the Model includes the attributes (Field or Prototype) and behavior (Method) of the Model ). The structure of these classes using Model metadata solves this problem. The data part is defined as the base class, and the behavior part is placed in the subclass. This reduces the confusion between data and behavior, and facilitates data reference.
The metadata-related documents must be translated into English and Chinese.
Metadata can be translated into Metadata to describe data. In geospatial data, metadata is the background information that describes the data content, quality, status, and other relevant features. Metadata is not a new concept. In fact, traditional library cards, copyright descriptions for publishing books, and disk tags are all metadata. The metadata of a paper map mainly includes the map type and map legend, including the Map Name, spatial reference system and map coordinate, map content description, scale and accuracy, preparation of the publishing unit and date or update date, sales information, etc. In this form, metadata is readable and easy to communicate with users. Users can easily determine whether the book or map can meet the needs of their applications.
With the development of computer technology and GIS technology, especially the development of network communication technology, spatial data sharing has become increasingly common. The complexity of managing and accessing large datasets is becoming a prominent problem for data producers and users. Data producers need effective data management and maintenance methods. users need to find faster, more comprehensive, and effective methods, in this way, you can discover, access, obtain, and use the geographical data with high current, precision, ease of management, and accessibility. In this case, metadata information such as content, quality, and status of spatial data becomes more important and becomes an important means for effective management and application of information resources. Geographic Information metadata standards and operational tools have become an important component of the national spatial data infrastructure.
In GIS applications, the main functions of metadata can be summarized as follows:
1) Help data production units effectively manage and maintain space data, establish data documents, and ensure that they do not lose their understanding of the data even when their main staff members leave;
2) provides information on data storage, data classification, data content, data quality, data exchange network, and data sales of data production units, so that users can easily query and retrieve geospatial data;
3) helps users understand the data so as to make a correct judgment on whether the data can meet their needs;
4) Provide relevant information for users to process and convert useful data.
It can be seen that metadata is one of the important conditions for making full use of data. It can be used in many aspects, including data document creation, data publishing, data browsing, and data conversion. Metadata plays an important role in promoting data management, use, and sharing.
4.1 concepts and types of metadata
4.1.1 metadata Concept
Metadata is descriptive data information about data. It should reflect the characteristics of the data set as much as possible, so that users can accurately, efficiently, and fully develop and utilize the data set, the metadata of databases in different fields varies greatly. Metadata allows you to retrieve and access databases, effectively use computer system resources, and process and develop data.
So far, the scientific community has a common understanding of metadata: the purpose of metadata is to promote efficient use of datasets and to serve Computer-Aided Software Engineering (CASE. Metadata includes:
1) Description of the dataset; description of each data item, data source, data owner, and data sequence (data production history) in the dataset;
2) description of data quality, such as data precision, logical consistency of data, data integrity, resolution, and metadata scale;
3) description of data processing information, such as dimensional conversion;
4) description of the data conversion method;
5) Description of database updates and integration.
4.1.2 metadata type
The purpose of metadata classification research is to fully understand and better use metadata. The classification principles are different, and the metadata classification system and content are very different.
1) classification based on the metadata content
The metadata content required for data of different properties and fields is different, and the metadata content of databases built for different purposes varies greatly, therefore, metadata is divided into three types:
(1.1) Research-type metadata: its primary goal is to help users obtain data from various sources and related information, it not only includes traditional, library-managed metadata such as the data source name, author, and subject content, but also contains the data topology. The task of this type of metadata is to help researchers efficiently obtain the required data.
(1.2) Evaluation-type metadata: It mainly serves the evaluation of data utilization, including the initial collection of data, the instrument used for data collection, and the number of data... the remaining full text>
I cannot find the metadata file "F: \ website \ Model \ bin \ Debug \ NTHJHModeldll" in VS2008 C # error 9"
Check the generated path.
You can reference the dll file to your project. Right-click-> Add reference-> (put the dll file under debug and select this Dll file)