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

ASF GitHub Bot commented on METAMODEL-1099:
-------------------------------------------

GitHub user kaspersorensen opened a pull request:

    https://github.com/apache/metamodel/pull/113

    Dynamic DataContext factory (MM 1099)

    This is my attempt at solving METAMODEL-1099. I've leveraged the standard 
[ServiceLoader](https://docs.oracle.com/javase/7/docs/api/java/util/ServiceLoader.html)
 for registering resource factories and data context factories. And I 
implemented this pattern with the various standard resources as well as the CSV 
data context. In my opinion this approach is pretty good, but I'd like to hear 
your feedback!
    
    If you think this approach is good, we should obviously expand it to fit 
all the datacontext implementations. But that would be a rather trivial task I 
think, once we agree on this.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kaspersorensen/metamodel METAMODEL-1099

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/metamodel/pull/113.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #113
    
----
commit 2173aa362a64015878d309a5b661bd5867563ee5
Author: Kasper Sørensen <[email protected]>
Date:   2016-07-04T04:14:51Z

    METAMODEL-1099: Added interfaces and registry for pluggable DC factory

commit 4b2e6a1f2e2daf1edeb4fd4c92d0daa873c697b9
Author: Kasper Sørensen <[email protected]>
Date:   2016-07-04T04:21:35Z

    METAMODEL-1099: Created a CsvDataContextFactory implementation

----


> Externalize DataContext factory from properties from MetaModel-spring to 
> MetaModel-full
> ---------------------------------------------------------------------------------------
>
>                 Key: METAMODEL-1099
>                 URL: https://issues.apache.org/jira/browse/METAMODEL-1099
>             Project: Apache MetaModel
>          Issue Type: New Feature
>    Affects Versions: 4.5.3
>            Reporter: Kasper Sørensen
>            Assignee: Kasper Sørensen
>             Fix For: 4.5.4, 5.0.0
>
>
> While working on the RESTful web application / API for MetaModel [1] I 
> encountered that I was starting to re-invent the work that has already been 
> done in MetaModel-spring to convert a set of properties (in that case in the 
> form of a Spring bean) into instructions for constructing a DataContext.
> I think we need to have this functionality externalized for more general 
> reuse. I was also just now looking into integrating Apache MetaModel with 
> Apache Calcite and see that their APIs take a Map<String,Object> to create 
> their equivalent of a DataContext. So once again I had the need to reuse this 
> functionality. I can think of even more scenarios ...
> So my suggestion with this issue is to make an class called 
> DataContextPropertiesLoader (although I am open to better naming 
> suggestions). It would be serializable and would hold the properties need to 
> construct any datacontext. This class could then be leveraged by 
> MetaModel-spring, by DataContextFactory and other projects.
> [1] https://github.com/apache/metamodel/pull/110



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to