Skip to content

Conversation

@paulk-asert
Copy link
Contributor

…nt GroovyObject

@paulk-asert
Copy link
Contributor Author

DO NOT commit as is. This is still experimental. I need to see if we can remove ScriptBytecodeAdapter usage within constructors as a minimum.

@PascalSchumacher
Copy link
Contributor

Paul: What do think, is this worth keeping open, or better of closed (to reduce the number of open pull requests)?

@mojo2012
Copy link

mojo2012 commented Jan 8, 2020

Just curious, but how can this be open for over 3 years? Did all tests pass back then? If yes why not merge it? The idea of not having to extend GroovyObject sound interesting.

@paulk-asert
Copy link
Contributor Author

The removal of the GroovyObject interface was relatively easy. But the goal would be that code with @pojo and @CompileStatic wouldn't need the Groovy jar as a dependency. That isn't yet the case. I guess we could look at making this an incubating feature for Groovy 4.

paulk-asert added a commit to paulk-asert/groovy that referenced this pull request Aug 6, 2020
paulk-asert added a commit to paulk-asert/groovy that referenced this pull request Aug 6, 2020
@asfgit asfgit closed this in 61af653 Sep 11, 2020
@asfgit asfgit merged commit 61af653 into apache:master Sep 11, 2020
@paulk-asert
Copy link
Contributor Author

OK.
Also, I am not sure if @POGO is better than @POJO.

Well, the goal is to be not like a normal Groovy object but as close to a plain old Java object as possible even though the source is Groovy. So, in the best possible case, you could use Groovy to be like a Lombok processor and produce Java classes which don't need the Groovy runtime jars to work successfully. As mentioned earlier, that isn't the case for all but the very simplest of cases today but we can expand over time - Records (or record-like classes) could be an early focus.

@sirinath
Copy link

Any progress in removing Groovy Jar dependency?

@paulk-asert
Copy link
Contributor Author

Yes, for simple cases combining @CompileStatic with @pojo (incubating feature in Groovy 4), no jar is needed, e.g.:
https://speakerdeck.com/paulk/groovy-roadmap?slide=34
(This is the "Using Groovy as an alternative to Lombok" scenario which has been an idea for a long time)

But currently only simple cases are supported and there is not a lot of doco around what is possible - it is more a feature for those in the know to start playing with at the moment - hence the incubating status. To give you an idea, if you, for instance, used a GString, you would need the jar since it has the GString class. Other places still fallback to the dynamic runtime in certain scenarios, so you'd need it there too. Feedback welcome of course. We hope to make more scenarios not need the jar over time and add some documentation over time once it becomes more stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants