Releases: rschmitt/dynamic-object
Releases · rschmitt/dynamic-object
DynamicObject 1.6.2
DynamicObject 1.6.1
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
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
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
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
Changes since 1.4.0:
- Bugfix: The
prettyPrint
andtoFormattedString
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
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 implementsjava.util.Map
by delegating to the underlying Clojure map. This makes callingDynamicObject#getMap
redundant for many use cases, and creates a migration path from maps to DynamicObjects. (Needless to say, the mutating methods likeput
will throw anUnsupportedOperationException
.) - 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 controlprint-method
dispatch, or to identify unwrapped DynamicObjects. - Support for pretty-printing has been improved substantially: calling
toFormattedString
orprettyPrint
will produce machine-readable output. In previous versions, pretty-printing of DynamicObjects resulted in reader tags being dropped. (Clojure'sdefrecord
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 aDynamicObject
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 theDynamicObject
interface without changing the invocation handler. This is how support for theMap
interface was added.) - Reflective proxy support has been removed, and
DynamicObjectInvocationHandler
has been eliminated. Its replacement isInvokeDynamicInvocationHandler
, 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 toDynamicObjectPrintMethod
orDynamicObjectPrettyPrint
, both of which are defined inEdnSerialization
.- The massive
DynamicObjects
(plural) class has been broken up into the following classes:Instances
,Serialization
,EdnSerialization
, andFressianSerialization
. - 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
Changes in this release:
- A performance bug involving default method invocation has been fixed.
dynamic-object-1.3.0
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 isUnknown::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 namedsetField()
orwithField()
).
dynamic-object-1.2.1
Changes in this release:
EdnTranslatorAdaptor
now passes theWriter
to theEdnTranslator
during serialization. It is an oversight that this change was not included in the previous release.