On Tue, Dec 15, 2009 at 3:43 AM, Paul MERLIN <[email protected]> wrote:

> It seems to me that I have the two following options:
> 1. use Entity composites, persisted in EntityStore using UnitOfWork lifecycle
> 2. use Transient composites, explicitely persisted by Repositories, more 
> DAOish
>
> First option seems to be the Qi4j/DDD way but I cannot see clearly how to
> implement it. I could split my Domain Layer in three Modules, each one using a
> dedicated EntityStore. From what I've understood reading the Qi4j code I won't
> be able to use EntityFinder and the Query API as it is currently "limited" to
> SPARQL.

First choice is exactly what the EntityStore SPI is all about. I think
you will get the most bang for the buck, so to speak, by going that
route. You can either put each store in the module of the domain
layer, but you can also utilize Layers, but that depends a lot on your
overall model. Finally, if you plead really nicely, we could enable a
planned feature a little early, which allows each entity to have a
declared EntityStore. At the moment, all entities in the same Module
share an EntityStore.

As for Indexing/Querying; The whole point in Qi4j is that we separate
the storage from indexing (like the world wide web does), to enable
easier storage implementations and cross storage searches. Yes it
means that more space is 'wasted', but is rarely an issue these days.
Another upside is that the index can be tossed and recreated at any
time, so even if you already have data in your stores, if you
implement the EntityStore SPI correctly, the Indexer can be told to do
a reindex of that data.

There is an additional case, where external systems update the same
store, and for that I recommend you to "NOT DO IT". The biggest reason
is that of responsibility and audit... "Who did it?" when something
went wrong. Instead, I like the messaging approach with 'local store'.
This makes collaboration across projects/systems a lot easier, and one
is not very constrained to "other people's work", which is a major
efficiency inhibitor.


Cheers
-- 
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java

I  live here; http://tinyurl.com/2qq9er
I  work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to