<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Could you explain the "where" clause in more detail here? I have
    seen this a few times in your examples, but I'm not entirely clear
    on what it is doing. :)<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 05/05/2014 10:33 AM, Lincoln Baxter,
      III wrote:<br>
    </div>
    <blockquote
cite="mid:CAEp_U4H+JK9PqbPzdBeo9kc6Jsnj1hUJ+AL51AZPE4c4x18sQA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div style="font-family:arial,sans-serif;font-size:13px">.addRule()&nbsp;</div>
        <div style="font-family:arial,sans-serif;font-size:13px">.when()
          // if</div>
        <div style="font-family:arial,sans-serif;font-size:13px">
          .perform() // then</div>
        <div style="font-family:arial,sans-serif;font-size:13px">.otherwise()
          // else</div>
        <div style="font-family:arial,sans-serif;font-size:13px">.where("paramName1").configuredBy(...).where("paramName2")
          // configure parameters</div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Mon, May 5, 2014 at 10:23 AM,
          Lincoln Baxter, III <span dir="ltr">&lt;<a
              moz-do-not-send="true"
              href="mailto:lincolnbaxter@gmail.com" target="_blank">lincolnbaxter@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div class=""><span
                  style="font-family:arial,sans-serif;font-size:13px">1)
                  The &nbsp;(when, perform) structure would be basic for all
                  rules?</span>
                <div>
                  <br>
                </div>
              </div>
              <div>Yes, there are actually a few more structures:</div>
              <div><br>
              </div>
              <div>.addRule()&nbsp;</div>
              <div>.when() // if</div>
              <div>.perform() // then</div>
              <div>.otherwise() // else
                <div class=""><br>
                  <br
                    style="font-family:arial,sans-serif;font-size:13px">
                  <span
                    style="font-family:arial,sans-serif;font-size:13px">2)
                    This seems like it will build object tree, which
                    will then be</span><br
                    style="font-family:arial,sans-serif;font-size:13px">
                  <span
                    style="font-family:arial,sans-serif;font-size:13px">processed,
                    right? No space for custom code?</span><br
                    style="font-family:arial,sans-serif;font-size:13px">
                  <br>
                </div>
                You can already do exactly what you just suggested :)
                Custom code is no problem, it just accepts an object
                like any normal Java code - it's just Java.
                <div class="">
                  <br>
                  <br
                    style="font-family:arial,sans-serif;font-size:13px">
                  <span
                    style="font-family:arial,sans-serif;font-size:13px">3)
                    Isn't that a fluent API overuse? How about something
                    like:</span></div>
              </div>
              <div><font face="arial, sans-serif"><br>
                </font></div>
              <div><font face="arial, sans-serif">I don't know what you
                  are referring to here as overuse, but yes, I am
                  exaggerating&nbsp;the use of the fluent API to make a
                  point. The rules could be completely un-fluent and
                  still use these same APIs. I'm not sure I see the
                  point/difference of the sample you've shown.<br>
                </font>
                <div class="">
                  <div><span
                      style="font-family:arial,sans-serif;font-size:13px"><br>
                    </span></div>
                  <div><span
                      style="font-family:arial,sans-serif;font-size:13px">4)
                      .withDoctype("</span><a moz-do-not-send="true"
                      href="http://maven.apache.org/POM/4.0.0"
                      style="font-family:arial,sans-serif;font-size:13px"
                      target="_blank">http://maven.apache.org/POM/4.0.0</a><span
style="font-family:arial,sans-serif;font-size:13px">") ?</span><br
                      style="font-family:arial,sans-serif;font-size:13px">
                    <span
                      style="font-family:arial,sans-serif;font-size:13px">doctype
                      is a property... &nbsp;Better .with(PropNames.DOCTYPE,</span><br
style="font-family:arial,sans-serif;font-size:13px">
                    <span
                      style="font-family:arial,sans-serif;font-size:13px">"</span><a
                      moz-do-not-send="true"
                      href="http://maven.apache.org/POM/4.0.0"
                      style="font-family:arial,sans-serif;font-size:13px"
                      target="_blank">http://maven.apache.org/POM/4.0.0</a><span
style="font-family:arial,sans-serif;font-size:13px">") ?</span></div>
                  <div><br>
                  </div>
                </div>
                <div>I agree, some kind of more general structure here
                  would probably be better.
                  <div class=""><br
                      style="font-family:arial,sans-serif;font-size:13px">
                    <br
                      style="font-family:arial,sans-serif;font-size:13px">
                    <span
                      style="font-family:arial,sans-serif;font-size:13px">5)
                      Could the variable be filled outside .when () ?
                      But perhaps just a</span><br
                      style="font-family:arial,sans-serif;font-size:13px">
                    <span
                      style="font-family:arial,sans-serif;font-size:13px">matter
                      of taste.</span><span
                      style="font-family:arial,sans-serif;font-size:13px"><br>
                    </span></div>
                </div>
              </div>
              <div><span
                  style="font-family:arial,sans-serif;font-size:13px"><br>
                </span></div>
              <div><span
                  style="font-family:arial,sans-serif;font-size:13px">Absolutely
                  you could - and yes, it's all a matter of taste :)</span></div>
            </div>
            <div class="gmail_extra">
              <div>
                <div class="h5"><br>
                  <br>
                  <div class="gmail_quote">
                    On Fri, May 2, 2014 at 7:26 PM, Ondrej Zizka <span
                      dir="ltr">&lt;<a moz-do-not-send="true"
                        href="mailto:ozizka@redhat.com" target="_blank">ozizka@redhat.com</a>&gt;</span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
                      <br>
                      WRT rules API, as proposed at<br>
                      <a moz-do-not-send="true"
href="https://github.com/windup/windup/blob/master/engine/config/api/src/main/java/org/jboss/windup/addon/config/example/MavenExampleConfigurationProvider.java#L22"
                        target="_blank">https://github.com/windup/windup/blob/master/engine/config/api/src/main/java/org/jboss/windup/addon/config/example/MavenExampleConfigurationProvider.java#L22</a><br>
                      <br>
                      It's nice, with some comments.<br>
                      <br>
                      I know it was typed in a hurry, but anyway:<br>
                      <br>
                      1) The &nbsp;(when, perform) structure would be basic
                      for all rules?<br>
                      <br>
                      2) This seems like it will build object tree,
                      which will then be<br>
                      processed, right? No space for custom code?<br>
                      <br>
                      3) Isn't that a fluent API overuse? How about
                      something like:<br>
                      <br>
                      new ConfigBuilder( ... ){{<br>
                      &nbsp; &nbsp; &nbsp;addRule( new MavenPomRule( this, ... ){<br>
                      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; boolean when( &nbsp;) { return
                      Selection.exists(XMLFile.class,<br>
                      "xmls").with("doctype", DOCTYPE_POM); }<br>
                      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; void perform( MavenPomInfo mpi ){
                      ... }<br>
                      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
                      &nbsp; &nbsp; &nbsp;);<br>
                      }}.run();<br>
                      <br>
                      It's verbose now but with Java 8 lambdas, it would
                      be less.<br>
                      <br>
                      While it's a bit more verbose, it would have
                      obvious benefits of better<br>
                      debuggability, and would better leverage Java's
                      features like<br>
                      inheritance (imagine AbstractXmlFileRule and it's
                      subclasses for<br>
                      whatever one would want to do with a XML file,
                      having few of its<br>
                      properties passed as parameters.<br>
                      <br>
                      Btw this code above is inspired by Wicket and GWT.<br>
                      <br>
                      4) .withDoctype("<a moz-do-not-send="true"
                        href="http://maven.apache.org/POM/4.0.0"
                        target="_blank">http://maven.apache.org/POM/4.0.0</a>")
                      ?<br>
                      doctype is a property... &nbsp;Better
                      .with(PropNames.DOCTYPE,<br>
                      "<a moz-do-not-send="true"
                        href="http://maven.apache.org/POM/4.0.0"
                        target="_blank">http://maven.apache.org/POM/4.0.0</a>")
                      ?<br>
                      <br>
                      5) Could the variable be filled outside .when () ?
                      But perhaps just a<br>
                      matter of taste.<br>
                      <br>
                      More later when we have some more examples.<br>
                      <br>
                      Nice!<br>
                      Ondra<br>
                      _______________________________________________<br>
                      windup-dev mailing list<br>
                      <a moz-do-not-send="true"
                        href="mailto:windup-dev@lists.jboss.org"
                        target="_blank">windup-dev@lists.jboss.org</a><br>
                      <a moz-do-not-send="true"
                        href="https://lists.jboss.org/mailman/listinfo/windup-dev"
                        target="_blank">https://lists.jboss.org/mailman/listinfo/windup-dev</a><br>
                    </blockquote>
                  </div>
                  <br>
                  <br clear="all">
                  <div><br>
                  </div>
                </div>
              </div>
              <span class="HOEnZb"><font color="#888888">-- <br>
                  Lincoln Baxter, III<br>
                  <a moz-do-not-send="true" href="http://ocpsoft.org"
                    target="_blank">http://ocpsoft.org</a><br>
                  "Simpler is better."
                </font></span></div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        Lincoln Baxter, III<br>
        <a moz-do-not-send="true" href="http://ocpsoft.org"
          target="_blank">http://ocpsoft.org</a><br>
        "Simpler is better."
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
windup-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:windup-dev@lists.jboss.org">windup-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/windup-dev">https://lists.jboss.org/mailman/listinfo/windup-dev</a></pre>
    </blockquote>
    <br>
  </body>
</html>