Giter VIP home page Giter VIP logo

Comments (5)

jbgi avatar jbgi commented on July 26, 2024

👍 to

a more generic (disable set, disable mod, disable get) generation control

from derive4j.

jbgi avatar jbgi commented on July 26, 2024

I can add an enum
Derivation = Getters | Setters | FluentPatternMatching
and a new attribute Derivation[] omit() default {} to @Data
Also moving all public static methods at the top of the generated file could help get important stuff under the 2500 lines threshold of Idea.
@talios, WDYT?

from derive4j.

talios avatar talios commented on July 26, 2024

Derivation sounds good. as does moving the static methods to the top.

Would it be worth considering genererating the setters/mods/matching into separate classes as well? Having the single class is nice, but may not scale?

Ideally one should probably not have this amount of cases in a single set of cases tho, which is one of the reasons I was looking at switching to derive4j in for this piece of code ( aside from jADT being unmaintained ).

Since we're starting to get a lot of commands/cases in this piece of code ( essentially an immutable set of events in a CQRS style system, but much more minimal ) we're wanting to look at breaking them into smaller set's of cases with a common super interface which dervie4j's syntax offers quite nicely.

from derive4j.

jbgi avatar jbgi commented on July 26, 2024

@talios
I'm going to add the following annotation property in @Derive:

public @interface Derive {
  // ...
  Make[] make() default { lambdaVisitor, constructors, getters, modifiers,
                          lazyConstructor, patternMatching, catamorphism };
  // ...
}

So that one can override the default and make derive4j only generate what is explicitly defined.
Is that ok for you?
(Derive4j will take care of dependencies. ie if you specify only modifiers then constructors will be automatically generated as well even if not mentioned explicitly)

from derive4j.

talios avatar talios commented on July 26, 2024

+10 that looks good to me.

from derive4j.

Related Issues (20)

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.