-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide proxy interface as well as Supplier
for let
and junitMixin
#103
Comments
@greghaskins do you even slightly care about this? I'm not sure I do anymore :) |
Let's put this idea on the shelf until we get lots of complaints about the syntax. Some boilerplate is pretty much expected in the Java world these days, so I don't see the extra |
Interestingly one of the comments from that article I fwded was on the clunkiness of this... might be worth keeping open at low priority. |
@greghaskins - is this still closed? |
Again, since @ashleyfrieze invited me to comment, here's my $0.02: I'd like to see this implemented anyway. Don't think that 'if people expect clean code they'd move to Groovy/Scala/Kotlin' is a good reason not to strive for clean code in Java :) Plus, it would make using Spectrum that much easier to explain to people that do not necessarily have a ton of programming experience. |
Alright, I'm on board. Let's continue the discussion over in PR #122. |
Where it's possible, it would be a brilliant bit of syntactic sugar to be able to replace
with something where there's less indirection - say:
where
MyThingInterface
is an interface implemented byMyThing
. This would probably be even more useful in thejunitMixin
where you may be likely to be reading properties of properties and the pattern would encourage an interface facade against all the commonly accessed things in the mixin, which can then easily be used.@greghaskins - what do you think of this? I think it can be done in about 20 lines of neat code and added as an overload to what we have - essentially it's a shim to convert a
Supplier<T>
to anR
whereT extends R
and the object ofR
is just a dynamic proxy to the object behindSupplier.get
.The text was updated successfully, but these errors were encountered: