Saturday, 27 February 2016

Basics of Repository API

Any E-commerce application needs a front end to display user, source code to manage why/what/ how we display content to user and also takes care of what to do with the data entered by the user.



Basic user interaction


Data base layer can be of any type, it can be LDAP, SQL or File System Connector. When ever there is a change in these DB selection, to avoid source code or java changes ATG introduced a concept called Data any where architecture, which is also known as ATG Repository API.

In Short, A Repository API is a data access layer that defines a generic representation of a data store.
A data store may contain many diverse types of objects. The repository is not the data store itself; instead, it is a collection of Java Beans whose properties can be found and stored in the data store.

With the ATG Data Anywhere, the application logic created by developers uses the same approach to interact with data regardless of the source of that data. One of the most powerful aspects of this architecture is that the source of the data is hidden behind the ATG Repository abstraction. It is easy to change from a relational data source to an LDAP directory as none of the application logic needs to change. After data is retrieved from a data source, it is transformed into an object-oriented representation. Manipulation of the data can be done using simple getPropertyValue and setPropertyValue methods.

High-level overview of ATG repository API


The ATG Data Anywhere Architecture offers several advantages over the standard data access
methods such as Java Data Objects (JDO), Enterprise Java Beans (EJB), and Java Database Connectivity (JDBC).

Data Source independence
Fewer lines of java code
Unified view of all data
Simplified transaction control
Integration with other ATG product suites
Maximum performance
Fine-grained access control

The following Repository models exist in ATG :

SQL Repositories - use ATG’s Generic SQL Adapter (GSA) connector to perform a mapping between ATG and data stored in a SQL database. can be used to access content, user profiles, application security information, and more.

SQL Profile Repository -  included in the ATG Personalization module.  Uses the Generic SQL Adapter connector to perform a mapping for user data contained in a SQL database.

LDAP Repository -  Uses the Dynamo LDAP connector to access user data in an LDAP directory.

Composite Repository - provides a means for using more than one data store as the source for a single repository.

Versioned Repositories - an extension of the GSA used in ATG Publishing.



Repository Architecture

The repository provides a mechanism to retrieve the data elements, and creates a run-time representation of the available metadata for each object. This goal is achieved through three main conceptual parts of the Repository API:

   1. Repository Items
                   A repository is a collection of repository items. A repository item is a JavaBean component that  implements atg.repository.RepositoryItem or one of its sub-interfaces, and corresponds to the smallest uniquely identifiable entity in the underlying data store. In the SQL repository, for example, a repository item often corresponds roughly to a row in a table.
  
Properties:

 Each repository item is composed of named properties that store the item’s data—for example, id, firstName, and lastName. In the SQL repository, these properties generally correspond to table columns.

   2. Item Descriptors

                     Each repository item belongs to an item type that is defined by a Repository item descriptor. An item descriptor implements the atg.repository.RepositoryItemDescriptor interface and can subclass atg.repository.ItemDescriptorImpl. An item descriptor provides the following information:
  • The item type’s name
  • Item type properties
  • The class of the Java object used to represent the item type—for example, Integer or String
Repository item descriptors depend on a combination of the underlying data store and the configuration of the repository.

   3. Repository Queries
                   All repositories have the ability to execute queries. A query is a request to find all items of a particular item type that fits a certain set of criteria. Those criteria are specified in terms of the item type’s properties.
The Repository API can express a wide variety of queries, including queries that match patterns in text, query through collections, or even query through complex values. Queries can also specify the order in which to return results, and can specify which results from a large result set to return.
Queries can be built and executed with the Repository API. For complex queries, this can be a tedious task. In these cases, or in cases where the Repository API should not be used directly, queries can be represented in a textual form called Repository Query Language (RQL).

0 comments:

Post a Comment

 
;