Skip to content
This repository has been archived by the owner on Jan 4, 2020. It is now read-only.

Separation of the client and store concerns (major change) #40

Merged
merged 16 commits into from Dec 6, 2014

Conversation

bcogrel
Copy link
Member

@bcogrel bcogrel commented Dec 6, 2014

This PR introduce an important separation of concerns between the client and the store part. The two sides have now distinct models. The main (mid-term) objective is to allow a client model to interact with multiple (heterogeneous) stores.

Because the models differ on the client and store sides, Resources attribute values have to be converted when passing from one side to the other (e.g. during the get() and save() operations). These conversions are made by ModelConverters that are defined for each pair client/store models.

The available converters only deal with direct mapping. The current client models are usually imported from the store models. In the future, more complex converters should be introduced for supporting better data integration scenarii.

See https://github.com/oldm/OldMan/blob/master/examples/quickstart.py for an example of the new API.

Main changes:

  1. Each of them have their own Models and ModelManager
  2. The ResourceManager is now a ClientResourceManager and only concerns the client part. Some of its code have been delegated to the ModelManager.
  3. ModelConversionManager and ModelConverter introduced.
  4. Resource has now two sub-classes: StoreResource and ClientResource.
  5. Model is extended by the ClientModel subclass. Models are now independent of the data store.
  6. ModelManager (used by the DataStore and the ClientResourceManager) is extended by the ClientModelManager sub-class.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling bfc3e1d on new-resource-manager into * on master*.

bcogrel added a commit that referenced this pull request Dec 6, 2014
Separation of the client and store concerns (major change)
@bcogrel bcogrel merged commit da1e1f3 into master Dec 6, 2014
@bcogrel bcogrel deleted the new-resource-manager branch December 6, 2014 14:39
@bcogrel bcogrel added this to the v0.2 milestone Aug 16, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants