Uploaded image for project: 'Apache Onami'
  1. Apache Onami
  2. ONAMI-102

Redesign the Modules structure in order to simply APIs usage

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: lifecycle-0.2.0
    • Fix Version/s: lifecycle-0.2.0
    • Component/s: lifecycle
    • Labels:
      None

      Description

      We already started discussing about it in the ML, but let's track progresses on JIRA.

      I detected few areas of approaching the lifecycle design:

      • IIUC, we want to manage a series of annotations which identify the sequence of staging steps in the lifecycle, so IMHO the AbstractLifeCycleModule constructor with just one annotation has to disappear; it would be nice to have a varargs array, which would simplify the signature - and the usage from our users - but it would generate an annoying warning to our users; IMHO it is still acceptable, but in case we don't find an agreement here, Iterable should be the best way to pass the annotations sequence to the module.
      • ListBuilder: as already discussed, this sound too generic: I'd propose something like AnnotationsLifecycleSequenceBuilder (maybe it is too verbose ) but I'd opt for something that gives a precise idea, not a generic one;
      • Again on the list builder, as we discussed, IMHO the wrapped data structure should be a LinkedHashSet: it preserves the sequence and makes efficient the check for duplicates - if the list has a duplicate, I bet the lifecycle event would be handled twice;
      • Builder pattern: the way to get the builder is IMHO a little too verbose: Builder.newBuilder() is not a pattern that makes me particularly happy, I'd rather opt for inner class builder such as new ConcreteClass.Builder() which is used in the AsyncHttpClient - WDYT?

      I can even make a proposal, in order to show you better my ideas, and attach a patch to discuss together

        Attachments

        1. LifeCycleStageModule.java
          6 kB
          Mikhail Mazursky
        2. LifeCycleModule.java
          4 kB
          Mikhail Mazursky

          Activity

            People

            • Assignee:
              ash2k Mikhail Mazursky
              Reporter:
              simone.tripodi Simone Tripodi
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: