You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@predictionio.apache.org by Sebastiaan de Man <sd...@salesforce.com> on 2016/10/25 18:53:19 UTC

Best way to implement description of expected events and queries

Hi all,

I'm building a GUI for PredictionIO that allows for easy sending of events
and querying the engine. It will have to be able to talk different Engines,
which all expect different event properties and have their own queries and
responses.

What would be the best way to implement a mechanism that will provide a
json description, with expected types of the Query and PredictedResults?
I'm thinking it could either be done using scala.reflect, with maybe
annotations, however it should be easy to add it, maybe as a trait, to any
existing custom built engines.

Any suggestions? Ideas?

Many thanks!

Sebastiaan de Man

Re: Best way to implement description of expected events and queries

Posted by Donald Szeto <do...@apache.org>.
No problem! I recommend http://www.artima.com/shop/programming_in_scala_3ed.

On Tue, Nov 1, 2016 at 1:43 AM, Sebastiaan de Man <sd...@salesforce.com>
wrote:

> Thanks Donald, that really helps! I'm finding it hard to get clear, simple
> examples of Scala. Maybe I should buy a book :)
>
> On Mon, Oct 31, 2016 at 6:41 PM, Donald Szeto <do...@apache.org> wrote:
>
>> Hi Sebastiaan,
>>
>> Would this be sufficient for your use case: http://stackoverflow.com
>> /questions/26500539/scala-getting-field-and-type-of-field-of-a-case-class
>>
>> This can be put in a trait as a method and mix in to different case
>> classes. If the name of the type signature is enough for your GUI that
>> would be great.
>>
>> Regards,
>> Donald
>>
>> On Tue, Oct 25, 2016 at 11:53 AM, Sebastiaan de Man <
>> sdeman@salesforce.com> wrote:
>>
>>> Hi all,
>>>
>>> I'm building a GUI for PredictionIO that allows for easy sending of
>>> events and querying the engine. It will have to be able to talk different
>>> Engines, which all expect different event properties and have their own
>>> queries and responses.
>>>
>>> What would be the best way to implement a mechanism that will provide a
>>> json description, with expected types of the Query and PredictedResults?
>>> I'm thinking it could either be done using scala.reflect, with maybe
>>> annotations, however it should be easy to add it, maybe as a trait, to any
>>> existing custom built engines.
>>>
>>> Any suggestions? Ideas?
>>>
>>> Many thanks!
>>>
>>> Sebastiaan de Man
>>>
>>
>>
>

Re: Best way to implement description of expected events and queries

Posted by Sebastiaan de Man <sd...@salesforce.com>.
Thanks Donald, that really helps! I'm finding it hard to get clear, simple
examples of Scala. Maybe I should buy a book :)

On Mon, Oct 31, 2016 at 6:41 PM, Donald Szeto <do...@apache.org> wrote:

> Hi Sebastiaan,
>
> Would this be sufficient for your use case: http://stackoverflow.
> com/questions/26500539/scala-getting-field-and-type-of-
> field-of-a-case-class
>
> This can be put in a trait as a method and mix in to different case
> classes. If the name of the type signature is enough for your GUI that
> would be great.
>
> Regards,
> Donald
>
> On Tue, Oct 25, 2016 at 11:53 AM, Sebastiaan de Man <sdeman@salesforce.com
> > wrote:
>
>> Hi all,
>>
>> I'm building a GUI for PredictionIO that allows for easy sending of
>> events and querying the engine. It will have to be able to talk different
>> Engines, which all expect different event properties and have their own
>> queries and responses.
>>
>> What would be the best way to implement a mechanism that will provide a
>> json description, with expected types of the Query and PredictedResults?
>> I'm thinking it could either be done using scala.reflect, with maybe
>> annotations, however it should be easy to add it, maybe as a trait, to any
>> existing custom built engines.
>>
>> Any suggestions? Ideas?
>>
>> Many thanks!
>>
>> Sebastiaan de Man
>>
>
>

Re: Best way to implement description of expected events and queries

Posted by Donald Szeto <do...@apache.org>.
Hi Sebastiaan,

Would this be sufficient for your use case:
http://stackoverflow.com/questions/26500539/scala-getting-field-and-type-of-field-of-a-case-class

This can be put in a trait as a method and mix in to different case
classes. If the name of the type signature is enough for your GUI that
would be great.

Regards,
Donald

On Tue, Oct 25, 2016 at 11:53 AM, Sebastiaan de Man <sd...@salesforce.com>
wrote:

> Hi all,
>
> I'm building a GUI for PredictionIO that allows for easy sending of events
> and querying the engine. It will have to be able to talk different Engines,
> which all expect different event properties and have their own queries and
> responses.
>
> What would be the best way to implement a mechanism that will provide a
> json description, with expected types of the Query and PredictedResults?
> I'm thinking it could either be done using scala.reflect, with maybe
> annotations, however it should be easy to add it, maybe as a trait, to any
> existing custom built engines.
>
> Any suggestions? Ideas?
>
> Many thanks!
>
> Sebastiaan de Man
>