9 Replies Latest reply on Dec 15, 2008 4:50 PM by aguizar

    Fluent interface on Commands

    camunda

      Hi.

      After discussing fluent interfaces in jbpm 4 (http://www.jboss.com/index.html?module=bb&op=viewtopic&t=146922) I was quite motivated to introduce them in the Commands as well. And when using them, it is really much cooler and more easy to have the return values of the setters. So I can say, I really like to have them :-)

      But the problem is, the signature of the existing Commands have changed by it. So I realized, all client libraries using jbpm have to be recompiled. Not changed, but recompiled against the new jbpm-jpdl.jar, right?

      So this may be a show stopper, or what do you think? I tend to reverse all these changes (even if I will miss them), otherwise migration to new jbpm-jpdl.jar caused to much confusion.

      Opinions? Thomas, what do you say?

      Related jira issue: https://jira.jboss.org/jira/browse/JBPM-1905?

      Thanks
      Bernd

        • 1. Re: Fluent interface on Commands
          tom.baeyens

          let's keep the fluent interface updates for jbpm 4. you can refactor the commands in jbpm 4 in the next iteration (jan-feb) if you have the time.

          introducing these kind of changes in 3 might cause unecessary frustration with our current userbase. it being more cool is no reason to break compatibility, i think.

          • 2. Re: Fluent interface on Commands
            kukeltje

             

            introducing these kind of changes in 3 might cause unecessary frustration with our current userbase. it being more cool is no reason to break compatibility, i think.


            You *think*? LOL... normally you are way more sure about things

            • 3. Re: Fluent interface on Commands
              thomas.diesler

              It is funny that this thread pops up right now, because over the weekend I investigated whether possible incompatibilities leaked into the jBPM3 code base.

              The extend of these incompatibilities can be seen running this command in target/classes for both jbpm-3.3.0 and jbpm-3.3.1

              find . -name "*.class" | sort | grep class | sed "s/.class//" | xargs javap -classpath . -protected
              


              I put the result in

              https://svn.jboss.org/repos/jbpm/jbpm3/trunk/modules/core/src/main/etc/

              Obvious incompatibilities are in

              BatchSignalCommand
              ChangeProcessInstanceVersionCommand
              DeleteProcessdefinitionCommand
              HibernateHelper
              


              Customer code that accesses API that has changed in this incompatible way would break.

              Bernd, is it ok for you to roll back these changes until code freeze 20-Dec? If not, please tell me, so we can do it.

              This is a blocking issue for the release.

              https://jira.jboss.org/jira/browse/JBPM-1919



              • 4. Re: Fluent interface on Commands
                thomas.diesler

                Alejandro,

                to change HibernateHelper in a compatible way is probably for you.

                To make a change in a compatible way, essentially means that you can only add stuff. Incompatible change in behaviour is almost impossible to detect unless yo have especially designed compatibility tests, which jbpm3 does not have.

                Hence special care is needed when it comes to behavioural change.

                • 5. Re: Fluent interface on Commands
                  camunda

                  Sure, I will take care of the Commands (since I caused it ;-)).

                  Since the fluent interface is really a cool thing I would add to the "setXxx()" an "xxx()" method with returns the Command itself... This is a compatible change and I hope it is OK for anybody...

                  • 6. Re: Fluent interface on Commands
                    tom.baeyens

                    ok for me.

                    • 7. Re: Fluent interface on Commands
                      camunda

                      Okay, committed. Thomas, maybe you could double check that I haven't missed anything by checking compatibility again?
                      Thanks.

                      • 8. Re: Fluent interface on Commands
                        aguizar

                        I'll restore the missing methods in HibernateHelper, but will not restore the configuration cache. jBPM does not actually use it, so it does nothing but leak memory.

                        • 9. Re: Fluent interface on Commands
                          aguizar

                          Disregard the previous comment, I fully reverted HibernateHelper. Instead, I changed the only invocation to HibernateHelper that enabled configuration caching.