Вопрос

Currently, XML file based repositories have been used in Apache ACE. Can we change them to make DBMS based? If yes, any guidelines are available?

Это было полезно?

Решение

ACE uses two layers of abstraction when it comes to storage:

Repository

I'll start at the bottom. Here, ACE introduces the notion of a Repository, which is nothing more than a versioned BLOB of data. Each repository starts versioning at 1, and every time you commit a new BLOB, that version gets bumped. There are multiple such repositories, which can be addressed by name.

Writing a different implementation of this Repository interface is fairly straightforward, and you can use any back-end that supports some form of BLOB, including a DBMS. Do note that at this level, there is no notion of what's inside these BLOBs, so depending on your reasons for using a DBMS here, that might or might not be what you want.

Object Graph

On top of this Repository, ACE uses an in-memory object graph of POJOs to represent its state. The POJOs hold metadata like for an artifact its URL, bundle symbolic name, version, etc. The POJOs are currently persisted and restored using XStream (that's where the XML comes from). At this level you could opt for storing the graph in a completely different way as well (maybe even completely bypassing the underlying Repository in favor of something else). Note though that ACE in general assumes that this whole graph of objects is versioned every time it is persisted (so we're not overwriting any old data).

Hopefully this explains a bit more about what's involved. If you want to discuss this some more, don't hesitate to subscribe to the ACE dev mailing list (see http://ace.apache.org/get-involved/mailing-lists.html for information on how to subscribe).

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top