Project

General

Profile

feature request #8257

Remove factory methods for term node creation

Added by Patrick Plitzner 14 days ago. Updated 6 days ago.

Status:
Feedback
Priority:
New
Category:
cdmlib
Target version:
Start date:
05/06/2019
Due date:
% Done:

50%

Severity:
normal
Tags:

Description

Currently it is possible to create a FeatureNode on its own, e.g. with a given term

 public static <T extends DefinedTermBase<T>> FeatureNode<T> NewInstance(T term){
        FeatureNode<T> result = new FeatureNode<>(term.getTermType());
        result.setTerm(term);
        return result;
    }

It should only be possible to create a term node based on its parent or its term tree.

AM: Aus einem ähnlichen Grund hatte ich bei TaxonNodes glaube ich mal grundsätzlich keine alleinstehende Instanzerzeugung zugelassen, weil es gefährlich ist, einen Knoten ohne seinen Baum zu erzeugen.
Ich denke, in diesem Fall sollten wir das auch anpassen. Erzeugen von Knoten sollte nur über Parent oder den Baum möglich sein mittels add-Methoden oder ähnlichem. In diesem Fall ist dann der termType des Baums immer bekannt und wird immer korrekt gesetzt.

Associated revisions

Revision 48e5bbde (diff)
Added by Patrick Plitzner 13 days ago

fix #8257 Remove factory methods for term node creation

Revision 7691ed2a (diff)
Added by Andreas Müller 13 days ago

ref #8257 remove factory method for term node creation in app-import

History

#1 Updated by Patrick Plitzner 14 days ago

  • Status changed from New to In Progress

#2 Updated by Patrick Plitzner 13 days ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 50

#3 Updated by Patrick Plitzner 6 days ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Patrick Plitzner to Andreas Müller

@Andreas M.: Can you please have look at the last remaining factory method which is used in one last spot:

    @Deprecated
    public static FeatureNode<Feature> NewInstance(){
        return new FeatureNode<>(TermType.Feature);
    }

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)