Ticket #683 (closed Enhancement: fixed)

Opened 5 years ago

Last modified 5 years ago

Core API: CompositeValue does not load child topics on-demand

Reported by: jri Owned by: jri
Priority: Major Milestone: Release 4.4
Component: DeepaMehta Standard Distribution Version: 4.3
Keywords: Cc: dgf, Malte, carolina
Complexity: 3 Area: Application Framework / API
Module: deepamehta-core

Description

The CompositeValue? convenience accessors do not load the respective child topics on-demand as the canonic CompositeValue? accessors do. This makes the API non-orthogonal and thus non-intuitive.

Change History

comment:1 Changed 5 years ago by jri

  • Status changed from new to accepted

comment:2 Changed 5 years ago by Jörg Richter

comment:3 Changed 5 years ago by Jörg Richter

Core: fix on-demand child topic loading (#683).

The CompositeValue? convenience accessors load the respective child
topics on-demand, just as the canonic CompositeValue? accessors do.

See #683.

comment:4 Changed 5 years ago by Jörg Richter

Core: strip CompositeValue? API (#683).

BREAKING CHANGE

The CompositeValue accessor methods which take a defaultValue parameter are dropped.
In conjunction with on-demand child topic loading (introduced in DM 4.1, see #411) the notion of a default value become pointless.
To check weather a certain child topic(s) is already loaded, use CompositeValue?'s has(childTypeUri).

Dropped methods in CompositeValue?:

Accessors:

  • Topic getTopic(String childTypeUri, Topic defaultTopic)
  • List<Topic> getTopics(String childTypeUri, List<Topic> defaultValue)

Convenience accessors:

  • String getString(String childTypeUri, String defaultValue)
  • int getInt(String childTypeUri, int defaultValue)
  • long getLong(String childTypeUri, long defaultValue)
  • double getDouble(String childTypeUri, double defaultValue)
  • boolean getBoolean(String childTypeUri, boolean defaultValue)
  • Object getObject(String childTypeUri, Object defaultValue)
  • CompositeValue getCompositeValue(String childTypeUri, CompositeValue defaultValue)

See #683.

Last edited 5 years ago by jri (previous) (diff)

comment:5 Changed 5 years ago by Jörg Richter

comment:6 Changed 5 years ago by Jörg Richter

Core: fix on-demand child topic loading (#683).

The CompositeValue? convenience accessors load the respective child
topics on-demand, just as the canonic CompositeValue? accessors do.

See #683.

comment:7 Changed 5 years ago by Jörg Richter

Core: strip CompositeValue? API (#683).

BREAKING CHANGE

The CompositeValue accessor methods which take a defaultValue parameter are dropped.
In conjunction with on-demand child topic loading (introduced in DM 4.1) the notion of a default value become pointless.
To check weather a certain child topic(s) is already loaded, use CompositeValue?'s has(childTypeUri).

Dropped methods in CompositeValue?:

Accessors:

  • Topic getTopic(String childTypeUri, Topic defaultTopic)
  • List<Topic> getTopics(String childTypeUri, List<Topic> defaultValue)

Convenience accessors:

  • String getString(String childTypeUri, String defaultValue)
  • int getInt(String childTypeUri, int defaultValue)
  • long getLong(String childTypeUri, long defaultValue)
  • double getDouble(String childTypeUri, double defaultValue)
  • boolean getBoolean(String childTypeUri, boolean defaultValue)
  • Object getObject(String childTypeUri, Object defaultValue)
  • CompositeValue getCompositeValue(String childTypeUri, CompositeValue defaultValue)

See #683.

comment:8 Changed 5 years ago by jri

  • Status changed from accepted to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.