Skip to content

Releases: miho/VMF

v0.2.6.3: Fixed effectively-immutable test...

01 May 20:24
Compare
Choose a tag to compare
...which determines the only valid case where
the read-only interface is allowed to implement
the modifiable interface

the problem was that delegation methods where not taken into account.
they are not allowed in read-only and immutable cases because they are
likely breaking the immutability contract

v0.2.6.2: this release contains several fixes:

01 May 15:23
Compare
Choose a tag to compare
- overriding getter-only properties
   works even if the overriding property
   is a model-type and the super-types
   property is an external type, e.g., Object

- type resolution and utility methods improved
- property-order bugs fixed

v0.2.6.1

14 Apr 09:51
Compare
Choose a tag to compare
new minor release with stability improvements and better containment …

Model Documentation Support

08 Apr 19:17
Compare
Choose a tag to compare

Models can be documented via the newly introduced @Doc("The documentation"). This documentation will be added to the generated API documentation, see issue #27 .

Example:

@Doc("A finite state machine.")
interface FSM {

    @Doc("The current state of this FSM.")
    State getCurrentState();

    ...
}

Fixed custom toString()

05 Apr 22:41
Compare
Choose a tag to compare
v0.2.5

next ver

Cross References

05 Apr 22:20
Compare
Choose a tag to compare

Cross references are finally fully supported via @Refers. Example:

package eu.mihosoft.vmftest.complex.account.vmfmodel;

import eu.mihosoft.vmf.core.Container;
import eu.mihosoft.vmf.core.Contains;
import eu.mihosoft.vmf.core.InterfaceOnly;
import eu.mihosoft.vmf.core.Refers;

interface AccountModel {

    @Contains(opposite="model")
    Customer[] getCustomers();
    @Contains(opposite="model")
    Account[] getAccounts();
}

interface Account {
    String getName();

    @Refers(opposite="accounts")
    Customer[] getAuthorizedSignatories();

    @Container(opposite="accounts")
    AccountModel getModel();
}

@InterfaceOnly
interface Customer {
    
    @Refers(opposite="authorizedSignatories")
    Account[] getAccounts();

    @Container(opposite="customers")
    AccountModel getModel();
}

interface PrivateCustomer extends Customer {
    String getFirstName();
    String getLastName();

    Address getResidentialAddress();
}

interface BusinessCustomer extends Customer {

    String getCompanyName();

    Address getCompanyAddress();
}

interface Address {
    String getStreet();
    String getCity();
    String getPostal();
}

Improved Safety for ImmutableTypes

10 Feb 16:24
Compare
Choose a tag to compare
  • Immutable types with common base types with mutable types are much safer due to additional type checks
  • Fixed issues #21 and #22.
  • improved tests (some threw the wrong exception but were still accepted)

Several Bugs fixed, Improved Immutability & InterfaceOnly

07 Feb 12:53
Compare
Choose a tag to compare
  • So far, it was difficult to declare common super-types for immutable and mutable types. This is now possible:
package mypkg.vmfmodel;
import eu.mihosoft.vmf.core.*;

@InterfaceOnly
interface WithName {

    @GetterOnly
    String getName();
}

interface ImmutableObj extends WithName { }
interface MutableObj extends WithName { }
  • Fixed: builder pattern could corrupt default values (#16 )

  • Fixed: interface-only inheritance can lead to broken code (#13 )

  • Documentation improved (javadoc & tutorials)

Fixed issue #12 (immutable types)

24 Jan 16:11
Compare
Choose a tag to compare
v0.2.0.1

prepare new version

Annotations, Reflection Improvements and new Gradle plugin

24 Jan 14:09
Compare
Choose a tag to compare

Annotations:

Models can now be annotated, e.g.,

@Annotation(key = "key 1", value = "my value")
interface AnnotatedModel {

    @Annotation(key="prop key 1", value = "my prop value")
    String getName();
} 

This makes querying specific objects or properties much easier.

Reflection:

Reflection works now directly on a type, e.g.:

Reflection r = MyParent.type().reflect()

Additionally, properties can be observed via the reflection API:

prop.addChangeListener(change ->
  // react to changes
);

Gradle Plugin:

The gradle plugin registers vmf properly now, just like java and resources are registered. Each source set can use its own dependencies for model generation.

Support for IntelliJ IDEA and VS Code has been improved (vmf folder is recognized as source root). The property

ext.vmfPluginIntelliJIntegration = true

enables the additional support (vmf folders are added ass source root and generated src dirs are marked as being generated, i.e., intellij will warn whenever a change is made to the generated file).