[ 
https://issues.apache.org/jira/browse/OLINGO-32?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13807908#comment-13807908
 ] 

Georgi commented on OLINGO-32:
------------------------------

I see what you mean. Separation of concerns is plausible practice but let's be 
practical - I think that it's in the best interest of olingo to foster hype 
now. Hype is, among other things, about ease of adoption/assessment. So the 
faster I can create a published olingo-based service from ground (database) up 
and prove that I can do CRUD operations with it, the better for me and olingo.
IMO the fastest way to achieve that is to generate a JPA model and add 
annotations to it where and if needed to change the EDM schema and then use the 
JPA processor to publish the service. Frankly speaking, with such motivation I 
don't expect quite of a need to make changes except for weird data models or 
just to try the option. But should such necessity occur, it would be far more 
appealing to use annotations than managing yet another asset - the xml file. 
Having said that, I realize that this is not the only scenario and annotations 
are not an option, or at least not the best option, when for example the JPA 
model can't be changed (e.g. you don't own it or you don't want dependency to 
the odata framework because it's used in different scenarios too). So what I 
propose is to let both be possible. Pretty much like the JPA persistence 
annotations and the orm.xml.
Ultimately, it's the designer's decision whether to got for tightly coupled 
odata(annotations) and jpa (say because they wouldn't use jpa for anything else 
and that's the fastest way), or decoupled jpa model and a mapping file. In fact 
one has the same choice with JPA - to create a completely technology agnostic 
POJO model and create a mapping orm.xml for it, or couple the java model with 
JPA by means of persistence annotations. 
So, pretty much the same reasoning goes here.
Does that make sense?

> Introduce (Java) Annotations for definition of EDM
> --------------------------------------------------
>
>                 Key: OLINGO-32
>                 URL: https://issues.apache.org/jira/browse/OLINGO-32
>             Project: Olingo
>          Issue Type: New Feature
>            Reporter: Michael Bolz
>            Priority: Minor
>
> The idea is to create your model as POJOs which then can be annotated with 
> special {{@EdmXXX}} (Java) annotations to define the EDM for an OData Service.
> Based on these annotation then the {{edmx}} document ({{$metadata}}) can be 
> generated as well as a generic {{Processor}} ({{ODataSingleProcessor}}) for 
> e.g. {{JSON}} can be written.
> As initial contribution and starting point for discussions about this feature 
> a branch with name {{PocEdmAnnotationsExtension}} is created with a basic 
> Proof of Concept.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to