directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trustin Lee <trus...@gmail.com>
Subject [apacheds] Idea on refactoring Database, ContextPartition, and RootNexus
Date Sun, 19 Jun 2005 04:15:04 GMT
Hi folks,

I thought over simplifying Database and ContextPartition, and here's my idea:

1) Do we need that much modification operations (add, delete, move
...) in Database?

No we don't need that much, all we need is:

* Put (used to add and replace entries)
* Remove (used to delete entries)

We could be able to combine put and remove operation to move or rename
entries, and therefore rename and move operation is splitted into many
small operations, so we need transaction here:

Database db = ...;
Transaction tx = db.beginTransaction();
tx.delete( entryWithOldName );
tx.put( entryWithNewName );
tx.commit();

2) Let's remove ContextPartition

If once the behavior of Database is defined in detail, we will be able
to create concrete implementation of
frontend to Database, and users won't need to reimplement it and just
use it.  So we can hide it easily:

ContextPartitionConfiguration cfg = ...;
cfg.setDatabase( new InMemoryDatabase() );

3) DatabaseNexus and RootNexus

The role of DatabaseNexus is similar to that of RootNexus.  We could
forward any operations to appropriate Database implementation.  Using
DatabaseNexus, we will be able to make RootNexus just a frontend to
DatabaseNexus that translates complex JNDI operations into small
Database operations.

Plus we'll need to expose DatabaseNexus to Interceptors for
interceptors that need a fine-grained control over database.

I attached class diagram and sequence diagram for this change to help
you understand this easily.

Any feedbacks are welcome!

Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/

Mime
View raw message