Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

God class codegen #202

Closed
wants to merge 6 commits into from
Closed

Conversation

kitlith
Copy link
Contributor

@kitlith kitlith commented Nov 16, 2020

This is basically my first working version of stuff. depends on #201 , as it uses an annotationProcessor defined in a subproject and makes use of the precompiled script plugins to make it easier to e.g. disable checkstyle for a particular module.

Where to go from here: (ideas listed in order of most to least tempting)

  • We should probably throw away generation of the json files (and thus the annotation processor?), i think it's an intermediate step that is simply complicating things.
    • Alternatively, the annotation processor generates a set of class files per module, which are later merged into a single set of class files in god-classes, see generating bytecode below
  • switch source generation libraries? I'm currently using jcodemodel from https://github.com/eclipse-ee4j/jaxb-ri, but javapoet may be better/more popular and may address some of the issues i was running into.
  • Glitch suggested generating bytecode instead of source files (which I think may smooth some things out)
    • NuclearFarts claims that this would mesh well with IDEs. (personally, i don't see why it would work any worse than source generation but hell if i know)
  • VFMADDSUBPD brought up the possibility of just using Mixins for all of this, but I think we all agree that codegen is more graceful.
  • I brought up the possibility of going in the middle, and basically having some sort of "code fragment" system -- we still write all the parts of the god-classes manually, we just divide it up between all of the modules and bring it together later.

@kitlith
Copy link
Contributor Author

kitlith commented Nov 17, 2020

Before I forget, I'm gonna change the annotation next time I work on this so you always include the name of the item you're adding, to make it easier to search for the items.

basically the biggest upside to this method is also its biggest downside, in that everything is spread everywhere.

@kitlith
Copy link
Contributor Author

kitlith commented Nov 17, 2020

Closing in favor of #203. I wouldn't mind revisiting this again another time, but at the moment I feel the biggest upside of this is also it's biggest disadvantage, and the other method is less likely to bite us in the ass later. i think. i hope.

@kitlith kitlith closed this Nov 17, 2020
@kitlith
Copy link
Contributor Author

kitlith commented Nov 17, 2020

reopening i guess since at least @famous1622 is still interested in this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants