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

Leo Neumeyer commented on S4-5:
-------------------------------

I had to add a couple of elements.

# To define a stream we need the event type and the property name. The property 
name needs to match exactly the property name used by a ProcessingElement that 
consumes this stream. I dont' think there is a way around that and of course it 
is not type safe. 
# Concrete PEs need configuration properties. To pass them using a generic API, 
I use the method property(String key, Object value).

Let ne know what you think. Will this be easy to understand given the required 
conventions?

{code:title=S4 Fluent API|borderStyle=dashed}
package org.apache.s4.appmaker;

public class MyApp extends AppMaker {

    @Override
    protected void configure() {

        PEMaker pez, pey;
        StreamMaker s1;
        StreamMaker s2, s3;

        pez = addPE(PEZ.class);

        s1 = addStream("stream1", EventA.class).withName("My first 
stream.").withKey("{gender}").to(pez);

        pey = addPE(PEY.class).to(s1).property("duration", 
4).property("height", 99);

        s2 = addStream("stream2", EventB.class).withName("My second 
stream.").withKey("{age}").to(pey).to(pez);

        s3 = addStream("stream3", EventB.class).withKey("{height}").to(pey);

        addPE(PEX.class).to(s2).to(s3).property("keyword", "money");
    }
}
{code} 

                
> Prototype app builder
> ---------------------
>
>                 Key: S4-5
>                 URL: https://issues.apache.org/jira/browse/S4-5
>             Project: Apache S4
>          Issue Type: New Feature
>    Affects Versions: 0.5
>            Reporter: Leo Neumeyer
>            Priority: Minor
>             Fix For: 0.5
>
>
> Extend Guice AbstractModule to create a simple application builder layer. The 
> idea is to evaluate if we can use Guice to do all the wiring including PEs 
> and Streams and Apps.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to