Skip to content

Releases: rschmitt/dynamic-object

DynamicObject 1.6.2

09 Apr 04:01
Compare
Choose a tag to compare

Changes in this release:

  • Validation performance has been improved.
  • Default interface methods from java.util.Map on DynamicObject instances have been fixed.

DynamicObject 1.6.1

21 Feb 02:45
Compare
Choose a tag to compare

Changes in this release:

  • A regression in null value handling has been fixed. This bug was introduced in version 1.6.0 and only affected Fressian serialization.

DynamicObject 1.6.0

29 Nov 00:37
Compare
Choose a tag to compare

Changes in this release:

  • The @Cached annotation has been introduced. When using Fressian encoding, this annotation provides a declarative way to cache the values for a given key, in addition to the keys themselves.
  • DynamicObject key caching has been made slightly more efficient.
  • An NPE will no longer be thrown when calling dynamicObject.equals(null).
  • Issues when running under certain code coverage tools have been fixed.

DynamicObject 1.5.0

15 Jul 21:47
Compare
Choose a tag to compare

Changes in this release:

  • DynamicObjectSerializer has been added, in order to make it easier to register types and tags as part of dependency injection
  • Collider integration has been added

DynamicObject 1.4.3

12 Jun 00:42
Compare
Choose a tag to compare

Changes since 1.4.3:

  • A bug involving initialization of static fields on DynamicObject types has been fixed.
  • invokedynamic-proxy is now pulled in via Maven, not repackaged.
  • The experimental afterDeserialization hook has been added. Don't use it.
  • The proxy classes generated at runtime now have more readable names.

DynamicObject 1.4.2

07 Apr 18:52
Compare
Choose a tag to compare

Changes since 1.4.0:

  • Bugfix: The prettyPrint and toFormattedString methods no longer drop the top-level reader tag.
  • Bugfix: The cons implementation now returns a DynamicObject and not a plain Clojure map.

dynamic-object-1.4.0

05 Apr 23:45
Compare
Choose a tag to compare

This is a major release with loads of new features:

  • Fressian support has been added. Fressian is essentially binary Edn: a self-describing, extensible data encoding that offers high performance and compact output. (more)
  • DynamicObject is now implemented with invokedynamic-proxy, instead of conventional reflection-based Java proxies. Benchmarking has shown that default method invocations on the latest version of DynamicObject are up to 95% faster than the previous version. Additional JMH data is available here.
  • The DynamicObject interface now implements java.util.Map by delegating to the underlying Clojure map. This makes calling DynamicObject#getMap redundant for many use cases, and creates a migration path from maps to DynamicObjects. (Needless to say, the mutating methods like put will throw an UnsupportedOperationException.)
  • All DynamicObject instances now implement Clojure's map interfaces, such as IPersistentMap. This means that a DynamicObject instance, when passed to Clojure code, looks and behaves exactly like an ordinary Clojure map. (The main exception is transient support, which has not been added.)
  • DynamicObject nesting no longer involves wrapping and unwrapping of Clojure maps. In previous versions, a nested DynamicObject was stored as a Clojure map in the parent hash map; now, DynamicObjects are never unwrapped. This makes type-based dispatch (e.g. for Fressian writers and pretty-printing) much more robust and reliable.
  • DynamicObject's :type metadata has been abolished. Metadata is no longer used to control print-method dispatch, or to identify unwrapped DynamicObjects.
  • Support for pretty-printing has been improved substantially: calling toFormattedString or prettyPrint will produce machine-readable output. In previous versions, pretty-printing of DynamicObjects resulted in reader tags being dropped. (Clojure's defrecord has the same problem.)

Internal changes:

  • Classes that are not part of the public API have been moved to the internal package. This leaves a total of eight classes (two interfaces, three classes, three annotations) in the public package.
  • As part of the invokedynamic-proxy changes, reflection has been decoupled from invocation (1, 2, 3). The DynamicObjectInstance class has been introduced; this class is a de facto abstract base class for all DynamicObject types. All calls on a DynamicObject interface (excepting static methods) now delegate to this class, according to a call site binding determined by the invocation handler. (Note that thanks to indy-proxy, methods can now be added to the DynamicObject interface without changing the invocation handler. This is how support for the Map interface was added.)
  • Reflective proxy support has been removed, and DynamicObjectInvocationHandler has been eliminated. Its replacement is InvokeDynamicInvocationHandler, which only runs once per Method (i.e. on the first invocation of a given method for a given DynamicObject type).
  • RecordPrinter has been removed. Printing of all DynamicObject types, whether tagged or not, is now delegated to DynamicObjectPrintMethod or DynamicObjectPrettyPrint, both of which are defined in EdnSerialization.
  • The massive DynamicObjects (plural) class has been broken up into the following classes: Instances, Serialization, EdnSerialization, and FressianSerialization.
  • The Metadata class has been removed. DynamicObject no longer uses metadata in its implementation.
  • As a matter of convention, the type variable D is now used for all DynamicObject types; T is still used for type variables that do not have a DynamicObject upper bound.

dynamic-object-1.3.1

27 Feb 02:48
Compare
Choose a tag to compare

Changes in this release:

  • A performance bug involving default method invocation has been fixed.

dynamic-object-1.3.0

22 Feb 03:20
Compare
Choose a tag to compare

Changes in this release:

  • DynamicObject now comes with a built-in default reader. This reader will handle any unrecognized reader tags. Both the tag and the tagged element will be captured as an instance of com.github.rschmitt.dynamicobject.Unknown, which can be correctly serialized again later.
  • In addition, the default reader can be overridden or disabled. Any BiFunction<String, Object, Object> can be used as an unknown element reader; the default in DynamicObject is Unknown::new.
  • @Key annotations are now supported on builder methods, as well as metadata methods. This allows builder methods to have different names than their corresponding getters, which makes it possible to follow familiar conventions (e.g. getField() can have a corresponding builder named setField() or withField()).

dynamic-object-1.2.1

14 Feb 19:28
Compare
Choose a tag to compare

Changes in this release:

  • EdnTranslatorAdaptor now passes the Writer to the EdnTranslator during serialization. It is an oversight that this change was not included in the previous release.