Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-2192

Solution autodiscovery by default if there is no @PlanningScore annotation

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • None
    • 2023 Week 06-08 (from Feb 6)
    • 5
    • Undefined
    • NEW
    • NEW

      To reduce boilerplate code in the examples,
      we should make auto discovery enabled by default if there is no @PlanningScore annotation present.
      Proposal B) if there is no @PlanningScore and no @PlanningEntity(Collection)Property annotation present

      Then all field xor getters [1] get autodiscovered, unless they have a @PlanningIgnore annotation.

      Notes from discussion with Lukas:

      scan solution class
      for field/methods that return a subclass of Score.
      
      if (2 score): fail fast
          unless one has a @PlanningIgnore
      
      if (score field or method has @PlanningScore annotation)
         old behavior
         => any annotated field and/or getter is picked up
         rest is ignored.
         if (@PlanningIgnore) => fail fast
      else auto discovery - field or getter?
          What does Jackson do?
          What does JSON-B do? Guess: getters (ignore fields)
          What does JAXB do?
          What does JPA do? Requires @Id => which defines rest
          What does XStream do?
      
      
      (cloner does ignore @PlanningIgnore)
      

      First TODO is to determine what Jackson, etc do.

              Unassigned Unassigned
              gdesmet@redhat.com Geoffrey De Smet (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: