wiki:GROUP_PERSISTENCE_R0

Version 2 (modified by boyan, 16 years ago) (diff)

--

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Error: Macro TicketQuery(summary=GROUP_PERSISTENCE_R0, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|) failed
current transaction is aborted, commands ignored until end of transaction block

Analysis

Overview

This group of tasks is about improving the base.persistence module and providing a well-designed, easily usable and extensible persistence library. After this task is complete, the following will be true:

  • The base.persistence module will provide all the commons needed for persistence.
  • The intermediate storage format will be improved where needed.
  • A format registry tracking all current formats and their abilities to save/load will be present.
  • Functionality for saving immutables and pro-things will be present.
  • Extensions and extension points will be introduced to simplify the usage of the library.
  • All the code related to persistence will conform to our code standards.

Task requirements

  • Try to devise a way the SharedLoader and SharedSaver to be consistent (currently they are not - see the notes on the persistence discussion that was held on 2009-02-18).
    • Another option is to rename them so that people don't get confused by the similarity in their names.
  • See how and where the intermediate storage format will be used and improve where needed.
  • Define how properties and immutables will be persisted (a good idea is to store the immutables as string).
  • Implement the annotations that were discussed - @Persist, @Immutable (see the video of the discussion for more information on these):
    • @Persist allows saving of pro-things in different formats.
    • @Immutable handles persistence of immutables.
    • Both annotations are used by the savers to track what and how should be saved.
    • An annotation for things not to be persisted might be needed.
    • (Optional) Provide a class that handles all immutables coming from the JDK.
  • Provide extension points for registering formats and for savers and loaders.
  • Design and implement a format registry that keeps track of all formats and their features and limitations:
  • Ensure backward compatibility.
  • Consider forwards compatibility in the design.
  • (Optional) Provide a wiki page - BASE_PERSISTENCE with detailed documentation on the library created so that everyone can easily get into it.

Task result

  • Source code
  • (Optional) Wiki page

Implementation idea

Watch the design discussion on persistence to get an idea of how things should be done.

BASE_PERSISTENCE_COMMONS_R0
BASE_PERSISTENCE_INTERMEDIATE_STORAGE_R0
BASE_PERSISTENCE_FORMAT_REGISTRY_R0
BASE_PERSISTENCE_PROPERTY_FORMAT_R0
BASE_PERSISTENCE_IMMUTABLES_R0
BASE_PERSISTENCE_FORMAT_POINT_R0
http://asteasolutions.net/videos/

How to demo

  • Explain the ideas of the library.
  • Show the source code.
  • Run the tests/demos.
  • (Optional) Show the created wiki page.

Design

The org.sophie2.base.persistence module will provide an extension point for formats via the BasePersistenceModule class. Each format should inherit PersistFormat and implement its abstract methods. Two additional methods will be provided - getSaver(Class<T extends Resource> saverClass) which returns a saver for a given type of resource and createLoader(Class<T extends Resource> loaderClass) which returns a loader for each resource of type T. Saving and loading of books should be implemented via the getSaver(Book.class) and createLoader(Book.class) methods. A default saver and loader might be provided in the future. The format registry should be easy to implement - it just has to track the registered extensions.

Implementation

Describe and link the implementation results here (from the wiki or the repository).

Testing

Place the testing results here.

Comments

Write comments for this or later revisions here.