Mod4j: Modeling for Java using Domain Specific Languages

Default values for attributes on domain classes have no effect on dto's

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0.0, 1.0.1
  • Fix Version/s: 1.1.0
  • Component/s: DSL for Data Contract
  • Labels:
    None
  • Number of attachments :
    0

Description

Default values for attributes on domain classes should also be applied to their corresponding dto-attributes.
Now the defaults are ignored.

Issue Links

Activity

Hide
Johan Vogelzang added a comment - - edited

Changes to DatacontractDsl meta model:

  • Added "hasDefault" attribute to DtoDataType
  • Added "defaultValue" attribute to all dto property types

By default, the attribute-values of dto's are initialized with the default values from their corresponding business classes of the businessdomain model.

XDto a = new XDto (); // Initialized with default values for attributes.
XDto b = new XDto(false); // Initialized with nulls for attributes.
b.setDefaults(); // Sets default values
Show
Johan Vogelzang added a comment - - edited Changes to DatacontractDsl meta model:
  • Added "hasDefault" attribute to DtoDataType
  • Added "defaultValue" attribute to all dto property types
By default, the attribute-values of dto's are initialized with the default values from their corresponding business classes of the businessdomain model.
XDto a = new XDto (); // Initialized with default values for attributes.
XDto b = new XDto(false); // Initialized with nulls for attributes.
b.setDefaults(); // Sets default values

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: