Skip to content

CodeAPI 4

Jonathan edited this page Nov 2, 2017 · 8 revisions

This page describes the changes of CodeAPI 4. I'm writting this because CodeAPI 4 will receive a lot of features during its development, there is no release date and the CodeAPI 4 will grow as needed. Snapshots of CodeAPI 4 may be stable and backward compatible, but compatibility is not guaranted.

Backward incompatibilities

  • Builder, the change probably breaks codes written to CodeAPI 3.

Development releases

We will periodically release nightlies and snapshots.

  • Nightlies: Unstable builds. This is not recommended to be used in production, nightly features are subject to change (and probably will be changed in the next nightly or snapshot)

  • Snapshots: Subject to be stable, and probably have more standardized features. We do not guarantee that these features will not change before the release.

Features before first snapshot

Builders

Now Builder classes are not automatically generated.

Anonymous classes

Yeah, finally anonymous classes.

Dynamic invocation

We will change the way you create dynamic invocations. (at this moment this is only what I can say).

Types change and CodeType Resolution

This is described in #54 and #55.

You do not need to wrap all Class instances into a CodeType using CodeAPI.getJavaType (which only exists for historical reasons) or CodeTypes.getCodeType. All Type will be converted to a CodeType internally.

We also introduced isAssignableFrom, getSuperclass, getInterfaces and a CodeTypeResolver which can resolve a CodeType to any type (Mainly to a Class or a TypeElement, but can be used to translate to any type). Obs: isAssignableFrom, getSuperclass and getInterfaces depends on the CodeTypeResolver.

Validation

I'm not sure how this will be, but this will add validation of CodeAPI structures, some validations will be added directly to init of the CodePart others validations will be made by a class (extensible). See issue #47

Features after first snapshot

Generator changes

More changes on generator, I do not like the way that the generators works, I want a better code, with a better performance.

All generators will be visitor-like and will have overloaded methods for each CodeAPI base types. (We will not remove ability to register custom types, but it will be made in a different way).

Performance improvements

I'm always looking for performance improvements, but I don't like premature optimizations, then I need to profile the code and analyze it strictly to find which parts need improvements (I think that Java itself need improvements).

Builder Information

If you are migrating from 3.0, you will need to change some codes to reference to new builder classes.

More info later