users@jpa-spec.java.net

[jpa-spec users] [jsr338-experts] Re: Proposal for EntityGraphs, fetch plans, etc...

From: Linda DeMichiel <linda.demichiel_at_oracle.com>
Date: Sun, 09 Dec 2012 15:06:39 -0800

On 12/7/2012 12:01 PM, Linda DeMichiel wrote:
> Hi Ollie,
>
> On 12/7/2012 10:29 AM, Oliver Gierke wrote:
>> Am 07.12.2012 um 18:57 schrieb Gordon Yorke<gordon.yorke_at_oracle.com>:
>>
>>> It was removed from an earlier draft version to reduce the clutter in the NamedEntityManager annotation as
>>> NamedAttributeNode serves the same purpose. It also eliminates any confusion about when to use the String[] vs the
>>> NamedAttributeNode[] and how they interact.
>>> --Gordon
>>
>> I guess you mean NamedEntityGraph, right? I don't think an additional simple attribute is clutter actually. Also, I
>> can't see any confusion as the String[] can easily be evaluated like an @NamedAttributeNode with a plain name
>> attribute and would be added to other @NamedAttributeNode declarations. Simple rule, no corner cases. Especially in
>> scenarios where you'd simply list a couple of Strings this would actually *reduce* clutter and complexity on the
>> definition side. Make the simple things simple, complex things possible.
>>
>> The examples you showed were referring to a few properties only and already consumed quite a bit of space. Assuming
>> real world scenarios, this overhead would even grow beyond that. It's yet another annotation per property to refer to.
>> I'd actually would be interested in seeing an XML definition example because it feels like the annotation based
>> definition might actually be more verbose than the XML equivalent.
>>
>> I strongly recommend to favor conciseness on the definition / user side of things over a few more lines of
>> implementation code. Parts of the spec already do a suboptimal job in this regard and I think we do the users and the
>> spec a favor if we make it as usable as possible.
>>
>
> While I sympathize with your ease-of-use argument here, I do think that having 3 ways of specifying
> attributes in NamedEntityGraph would be a bit much.
>

OK, I've been mulling this over some more and I have to admit I am really torn about this issue in
view of Ollie's verbosity argument.

Can we have some more feedback on this point, please?

Keep in mind that if we don't add such an element in now, we still have the option of doing so
in a future draft or future release.

thanks,

-Linda


> -Linda
>
>
>> Cheers,
>> Ollie
>>
>> - Sent while on the run...
>>
>>> On 07/12/2012 12:58 PM, Oliver Gierke wrote:
>>>> Am 07.12.2012 um 15:20 schrieb Gordon Yorke<gordon.yorke_at_oracle.com>:
>>>>
>>>>>> I like Oliver's proposal of String[] to list simple types. It makes the
>>>>>> API and annotations much more palatable.
>>>>> Yes, that was in an earlier version of the proposal.
>>>> What exactly does that mean? Was it in there and has been abandoned? If so, why?
>>>>
>>>> Cheers,
>>>> Ollie
>>>>
>>>