Git Product home page Git Product logo

dtonator's People

Contributors

ianvkoeppe avatar stephenh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dtonator's Issues

Expected Location of the dtonator.yaml File

Perhaps I'm just being dense, but I can not seem to figure out where this project expects to find the dtonator.yaml config. In the features example, I can see that the file is located in the src/main/java folder, but when I try that with my project I keep getting the error "org.yaml.snakeyaml.error.YAMLException: java.io.IOException: Stream closed" when I try to run. Is there something I'm missing?

'isEntity' and 'isDomainObject' Misnamed

The 'isEntity()' and 'isDomainObject()' method of the DtoConfig class appear the have their names reversed. 'isEntity()' is currently checking the package of the domain class and 'isDomainObject()' is looking for an 'id' property.

DTO Generation Failing for Extensions

The generation of the DTO classes produces results with invalid syntax for DTOs with inheritance, where the 'properties' config is not explicitly set. If the properties config is missing, the copyOf method of the child DTO will be invalid. If the properties config is set to '*' the constructor of the child class will have duplicate parameters.

example configs from dtonator-features:

Working

AccountDto:
  domain: Account
  properties: id, name
  tessellModel: true
  forceMapperMethods: name

RedAccountDto:
  extends: AccountDto
  domain: RedAccount
  properties: foo
  tessellModel: true

Invalid 'copyOf'

AccountDto:
  domain: Account
  tessellModel: true
  forceMapperMethods: name

RedAccountDto:
  extends: AccountDto
  domain: RedAccount
  tessellModel: true

Duplicate Constructor Parameters

AccountDto:
  domain: Account
  properties: '*'
  tessellModel: true
  forceMapperMethods: name

RedAccountDto:
  extends: AccountDto
  domain: RedAccount
  properties: '*'
  tessellModel: true

Expected Behavior for Getters With No Field

Currently, dto properties will be generated for all methods that follow the T getX() or setX(T t) pattern. This includes 'generator' methods where the property does not correspond to and field of the domain class. For example, given the class

public class Brother {
  public Long id;
  public String getGender() {
    return "male";
  }
}

the generated DTO will have two properties;

Long id

and

String gender

.

In a simple case like this the behavior is harmless. It becomes a problem however if the domain getter performs an expensive operation like a database query. There is also the potential for conflicts with mapping references as Ids.

Is this the expected behavior, and if so would it be worthwhile to have a config setting to allow the user to include/exclude these properties?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.