You get a bonus - 1 coin for daily activity. Now you have 1 coin

Patterns of Processing Object-Relational Metadata Metadata Mapping, Query Object, Repository

Lecture



Metadata Mapping (Distribution Based on Metadata)

Patterns of Processing Object-Relational Metadata Metadata Mapping, Query Object, Repository

Metadata Mapping Design Pattern

Metadata Mapping Description

Stores object-relational distribution data in metadata

In most cases, the code that controls the object-relational distribution describes how the fields in the database correspond to the fields in the objects. This code is very repetitive and boring. The Metadata Mapping pattern allows developers to define distribution rules (mapping) in a simple tabular form that can be processed by common code that receives data about the rules for writing and reading data from the database.

Query Object ( Query Object )

Patterns of Processing Object-Relational Metadata Metadata Mapping, Query Object, Repository

Query Object Design Pattern

Query Object Description

The object representing the query to the database

SQL is often a conjugate language and many developers are not very good at it. Moreover, you need to know what the database structure looks like in order to create queries. You can avoid this by creating special search methods that contain all the SQL in it and are controlled by a limited set of parameters. This approach makes it difficult to create and configure queries for specific situations. It also leads to duplication in SQL expressions.

The Query Object pattern is an object structure that can be interpreted in a SQL query. You can create such a query by referring to classes and fields as well as tables and columns. Thus, a developer’s independence from the database structure and the specific implementation of the database is created.

Repository

Patterns of Processing Object-Relational Metadata Metadata Mapping, Query Object, Repository

Design Pattern Repository

Repository Description

Intermediates between domain and data mapping layers using an interface similar to collections for accessing domain definition objects.

A system with a complex domain model can be simplified using an additional level, for example, the Data Mapper, which would isolate objects from the database access code. In such systems, it may be useful to add another layer of abstraction on top of the data mapping layer (Data Mapper), in which the code for creating queries would be collected. This becomes even more important when there are many classes in the definition domain or with complex, heavy queries. In such cases, the addition of this level especially helps to reduce duplication of the request code.

The Repository pattern mediates between the domain of definition and the data distribution layer, working like a regular collection of objects of the domain of definition. The client objects create the request description declaratively and send them to the repository object (Repository) for processing. Objects can be added or removed from the repository as if they form a simple collection of objects. And the data distribution code, hidden in the Repository object, will take care of the corresponding operations in the unnoticed by the developer. In a nutshell, the Repository pattern encapsulates the objects represented in the data warehouse and the operations performed on them, providing a more object-oriented view of the actual data. The Repository also aims to achieve a complete separation and one-sided dependence between the levels of data definition and distribution.


Comments


To leave a comment
If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Web site or software design

Terms: Web site or software design