Vincent, I feel a little bit puzzled by the idea of attribute linked to reference and how these will have impact of reference comparison and cloning. My understanding is that you provide a Map<String,Object> for attributes on entity reference. Which means that each reference could have some attribute at each level, since a wiki is reference, a space is reference, and a document is a reference ? You add convenience get/setVersion and get/setLanguage on the DocumentReference, which retrieve/set attributes "language" and "version" on document reference ? Then, what happen to compareTo ? does it takes attributes into account ? What happen to clone ? How do you easily convert a document reference with these attributes to a document reference without them, to talk about the document without taking care of language or version ? Maybe you could want to retain only language or version ? Denis On Thu, Sep 15, 2011 at 16:35, Vincent Massol <vincent@massol.net> wrote:
Hi devs,
After much brainstorming with Thomas and with the implementation of the new model I'm doing, we've come to the conclusion that it would be better to add the notions of Locale and Version in EntityReference.
The main reasons are: * otherwise we need to introduce a notion of UniqueEntityReference in the model and it makes it very awkward at an API level (user need to constuct a UniqueEntityReference from an EntityReference depending on the APIs used) * it makes APIs more complex than what they could be.
For example: - getDocument(EntityReference) - getDocument(EntityReference, Locale) - getDocument(EntityReference, Version) - getDocument(EntityReference, Locale, Version)
vs
- getDocument(EntityReference)
(subnote: this is why I introduced UniqueEntityReference in the model)
* It'll mean that anywhere we use an entity reference we'll be able to reference a specific version of that entity and/or a specific language. Some example: including a specific version of a page, referencing a specific version of an attachment in wiki syntax, etc.
In a first version I'd like to only introduce a generic get/setAttributes (to allow extensibility) in EntityReference + get/setLocale/Version (for easiness of access).
ATM I'm not planning to define a textual syntax for attributes (but it could something like: wiki:space.page[name1=value1, … nameN=valueN]). I'm not asking to vote on this.
Here's my +1
Thanks -Vincent
_______________________________________________ devs mailing list devs@xwiki.org http://lists.xwiki.org/mailman/listinfo/devs
-- Denis Gervalle SOFTEC sa - CEO eGuilde sarl - CTO