On Thu, Nov 13, 2008 at 5:29 AM, Philipp Meier <[EMAIL PROTECTED]> wrote:

>> The EntityStore SPI is created so that types of objects can be fairly
>> dynamic, and even created on the fly. However, Entity composites have
>> compile-time definitions of what properties they have. So what
>> properties an Entity has cannot change in runtime.
>
> Hmm, does the EntityStore rely on the fact that entity type cannot
> change at runtime?

The EntityStore doesn't know of the actual CompositeType, but it gets
a descriptor of the storage requirements, which are derived from the
CompositeType. See EntityState and EntityType in org.qi4j.spi.entity.

Your real problem is same as with Java.

How do you solve;

public interface Person
{
}

is going to get a "spouse" property of type Person in runtime? And how
are you going to change the rest of the domain code to suddenly 'know'
that there is a "Person getSpouse()" method available, and for it to
know the semantics what that really means. All in run-time.


Once you have figured that out, it is the same in Qi4j. You will have
to sacrifice type-safety, domain oriented code and so forth. And I
actually think that you are probably describing the wrong use-case.
Although you say that you want users to change the domain model in
runtime, you are probably talking about "The user must be able to
store additional categorized information of her choosing with Person
instances.", which is not changing domain models.


Cheers
Niclas

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

Reply via email to