Skip to content
This repository was archived by the owner on Nov 23, 2021. It is now read-only.

Add static import favorites #85

Open
maybeec opened this issue Jul 28, 2016 · 3 comments
Open

Add static import favorites #85

maybeec opened this issue Jul 28, 2016 · 3 comments

Comments

@maybeec
Copy link
Member

maybeec commented Jul 28, 2016

For OASP4J we would like to see preconfigured static import favorites. These are classes, which methods and fields are provided to be statically imported by auto-completion.

@hohwille
Copy link
Member

Static imports are often considered as an anti-pattern. Why using them? They pollute the namespace and make the code less readable. Just qualify constants and static methods with the defining class.

@maybeec
Copy link
Member Author

maybeec commented Sep 19, 2016

I am not totally convinced. This might be true for productive code and for the fact, that you should not statically import every static method/field you will access.
However, on testing level working with Mockito, AssertJ and similar technologies it is a total mess to also write the defining class e.g. for each asserThat. Basically, this was what I was referring too. My post was a little bit imprecise :)

@hohwille
Copy link
Member

OK. Agreed. Just make a concrete proposal for the list to add as favourites.
I would propose QueryDSL Alias.$ and Alias.alias.
For AssertJ we use inheritance so I see no extra need here.
Add your suggestions for Mockito.

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

No branches or pull requests

2 participants