Data access patterns (Chapter 1)

Source: Internet
Author: User

(If you read the original version, please note that English is too bad. Do not resend it)

Chapter 4 patterns
1.1 decoupling patterns
★Data accessor
Encapsulate the details of physical data access into an independent component, and only expose the logical operation methods (logical operations ). This mode contains the application of the underlying data model.ProgramCodeMaintenance knowledge to reduce data access coupling.
★Active domain object
Encapsulate the data model and data access details into the implementation of the corresponding domain object. Active domain objects removes code for direct database access from applications.
★Object/relations Map
Encapsulate the ing between the domain object and the relational data into a separate component. An object/relational map (Object/relational map) frees application code and domain objects from the underlying data model and data access details (decouples ).
★Layers
Focus on data access methods at various abstract levels and stack application features at various levels. (Stack orthogonal application features that address data access issues with increasing levels of each action ).

1.2 Resource patterns
★Resource decorator
dynamically loads affiliated behaviors to an existing resource with minimal impact on application code. A resource decorator makes it possible to "extend the functions of a resource without subclass or change its implementation.
★Resource Pool
reuse resources to minimize initial consumption. A resource pool effectively manages resources and allows them to be freely allocated using program code.
★Resource timer
Automatically releases invalid resources. A resource timer reduces the impact of application or user allocation on specified resources.
★Resource descriptor
isolates platform and data source behaviors to a separate component. A resource descriptor exposes the features of a specified platform and involves the generalization of unique database resources. It provides logical operation methods and makes the vast majority of data access code irrelevant to the physical environment.
★Retryer
assume that the operation that fails is automatically retried under the defined conditions. This mode makes the fault tolerance redundancy of data access operations possible.

1.3 input and output patterns
★Selections factory
generates query Selection Based on the identifier of the object. Gernerates query selections based on identity object attributes.
★Domain object factory
is a domain object based on the query result data. Populates domain objects based on query result data.
★Update factory
Update operations are generated based on improved domain object attributes. Generates update operations based on modified domain object attributes.
★Domain object aggreger
uses a unified factory framework (Uniform factory framework) to assemble, persist, and delete domain objects (domain objects ).
★Paging iterator
describes query results through a collection of domain objects (iterates) domain objects ).

1.4 cache patterns
★Cache accessor
Removes the buffer logic from the data model and data access details.
★Demand cache
assemble a cache lazily to become the request data of the application. A request buffer (demand cache) is very effective for frequent reads of unpredictable data (a demand cache is useful for data that is read frequently but unpredictably ).
★Primed cache
explicitly fills in a cache containing a group of data. A pre-Cache (primed cache) is very effective for data that is predictable and frequently accessed.
★Cache search sequence
Insert the shortcut cut entires to a cache to optimize a set of operations to be queried in the future.
★Cache collector
items in the merged cache that do not provide any performance benefits (entires whose presence in the cache ).
★Cache replicator
the replication operation is multiplied by the cache. (Replicates operations extends SS multiple caches)
★Cache Statistics
use the unified presentation layer (using a consistent structure for uniform presentation) to record and publish the statistics of cache and pool.

1.5 concurrency patterns
★Transaction
atomicity (atomic), consistent, isolation (isolated), and durable manner to execute concurrent units. Almost all database platforms support transactions from the very beginning.
★Optimistic lock
maintain version information to prevent Missing database updates. Optimistic locks use the application semantics to verify a working copy version before updating the database.
★Pessimistic lock
attaches the lock information to the data to prevent Missing database update operations. A clear pessimistic lock is achieved by providing application diagnostics better than native transaction support ).
★Compensating transaction
when this unit is not part of a native database transaction, roll back the Unit by defining an explicit compensation operation.

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.