Property (Lavender 'p' Icon) Determination

Hi,

I'm morally opposed to "get..." and "set..." prefixes on property / attribute accessors and mutators. I eschew them in code I write for my own projects. Instead, I just use the property name and allow overloading handle the distinction betwen accessor and mutator.

Is it possible to get IDEA (6.02) to detect my properties and flag them as such in the Structure view?

I noticed that my boolean accessors, for which I do use the "is..." prefix, are properly detected and the methods grouped with their corresponding fields under a Property icon in the Structure view, so at least it's respecting my field naming conventions, which I did specify in the Settings.


Thanks.

Randall Schulz

38 comments
Comment actions Permalink

Wow.

Um. Wow.

I have to imagine that the problem of getting IDEA to understand your convention for display purposes is going to be massively overshadowed by the problems of integrating your code with any of the jillion frameworks and libraries out there that assume the Java Beans naming conventions.

Wow.

Repeat after me: "Standard" is better than "better".

(To answer your question, no, there isn't any way to do what you are asking currently in IDEA. )

--Dave Griffith

0
Comment actions Permalink

Any such library or framework that doesn't have a way to handle
non-standard naming is seriously broken.

0
Comment actions Permalink

Wow.

>
> Um. Wow.

That's very articulate of you.

]]>


I have to imagine that the problem of getting IDEA to

> understand your convention for display purposes is
> going to be massively overshadowed by the problems of
> integrating your code with any of the jillion
> frameworks and libraries out there that assume the
> Java Beans naming conventions.

It has not been an issue before. My projects have been heavily skewed towards my own code. JavaBeans have been an almost non-existent aspect of the libraries or frameworks I've used and I anticipate that to continue to hold.

However, in order to "Develope with Pleasure," I expect tools, especially those for which I shell out significant cash, to meet my needs, not those of some convention that was defined with a lack of careful thinking.

]]>


Wow.


Oh! Now I get it!! How could I be so blind??


> Repeat after me: "Standard" is better than "better".

I'll do no such thing. Better is better. An inferior convention is simply inferior. And I'm the determiner of what's inferior for my own work.


> (To answer your question, no, there isn't any way to
> do what you are asking currently in IDEA. )

Anyway, the only reason I actually bothered to reply here was to ask whether you know this to be a fact or whether it's just that you don't know of a way do accomplish what I need?


> --Dave Griffith

]]>

RRS

0
Comment actions Permalink

Thank you.

I'm aware of the existence of BeanInfo classes. Ideally, I can just define my naming convention to IDEA. Second to that would be to create BeanInfo classes, but I'd really rather not have to do that.

So:

1) Does IDEA allow me to define my property naming convention?
2) Failing (1), does IDEA respect BeanInfo classes?


Randall Schulz

0
Comment actions Permalink

Anyway, the only reason I actually bothered to reply here was to ask whether you know this to be a fact or whether it's just that you don't know of a way do accomplish what I need?

I know this for a fact.

--Dave Griffith

0
Comment actions Permalink

Because he's Dave "IDEA God" Griffith:)

"Randall Schulz" <rschulz@sonic.net> wrote in message
news:13557806.1165591053930.JavaMail.itn@is.intellij.net...

Because...?



0
Comment actions Permalink

No, it's just because.
Seriously, you are the only one so far who requested such extravagant
feature.
Please, file a request into www.intellij.net/jira.
We'll see how many votes it will get.

--
regards,
--
Alexey Kudravtsev
Software Developer
JetBrains, Inc, http://www.jetbrains.com
"Develop with pleasure!"

"Brad L." <no@no.no> wrote in message news:elc0e7$gcn$1@is.intellij.net...

Because he's Dave "IDEA God" Griffith:)

>

"Randall Schulz" <rschulz@sonic.net> wrote in message
news:13557806.1165591053930.JavaMail.itn@is.intellij.net...

>> Because...?
>



0
Comment actions Permalink

Because I've got the source to IDEA's property detection logic right here in front of me. Alternatively, it was because I really do know every single toggle and option in each and every settings panel. Everybody needs a hobby.

--Dave Griffith

0
Comment actions Permalink

Why is a naming convention for properties considered extravagent?

You have provisions for field (both static and instance), parameter and local variable naming conventions. And the J2EE naming conventions settings panel is extraordinarily elaborate.

If your'e going to go to those lengths, then why not extend that kind of configurability to simple accessors and mutators?


RRS

0
Comment actions Permalink

If only one developer on the planet would ever use it, putting such an option in the product just for him would certain fulfill the requirements of the word "extravagant", I would think. Some fairly serious googling didn't turn up anyone else using anything but the JavaBeans standard for property names. Why would they? The JavaBeans standard is clean enough, the tools like it, and the issue's just not that important anyway! BeanInfo looks to be mostly used for retrofitting legacy classes into beans, rather than creating one's own standard.

The fact that vendors have no incentive to support obscure non-standard conventions is one of the reasons why "standard is better than better" (although it's less important than the "don't confuse your maintenance programmers" reason).

--Dave Griffith

0
Comment actions Permalink

Why are you so vehement in defending the absence of one little capability in such a large field of features?

It's the nature of any program as sophisticated as IDEA that many of its features are used by only a small portion of its users.

It's just one more manifestation of the long tail.

Leaving aside the apparent fact that it's not the way you like to do things, can you give a postive justification for omitting this tiny bit of configurability?

RRS

0
Comment actions Permalink

It's just one more manifestation of the long tail.

Now there's a new excuse for feature bloat. I'll have to try that one on my project manager.

Leaving aside the apparent fact that it's not the way you like to do things

Nor, indeed, the way anyone seems to like to do things but you. I bet your coworkers are thrilled.

can you give a postive justification for omitting this tiny bit of configurability

Prioritization. There are approximately 10,000 open feature requests for IDEA, and over the years I've read most of them. Yours really is the least generally useful.

--Dave Griffith

0
Comment actions Permalink

+It's just one more manifestation of the long
tail.+

Now there's a new excuse for feature bloat. I'll
have to try that one on my project manager.


Meaning what? You don't generally succeed in prevailing upon your manager for features youlike? So now you take it out on a stranger with whom you disagree but regarding a request with respect to which you have nothing at stake?

+Leaving aside the apparent fact that it's not the
way you like to do things+

Nor, indeed, the way anyone seems to like to do
things but you. I bet your coworkers are thrilled.


I made it clear I do this for my own projects. When I work projects with existing conventions, I follow them. When it's up to me, I do what I think is right.

Do you do strictly what others tell you to do?

+can you give a postive justification for omitting
this tiny bit of configurability+

Prioritization. There are approximately 10,000 open
feature requests for IDEA, and over the years I've
read most of them. Yours really is the least
generally useful.


Do you work for JetBrains? Do you speak for them? Do you determine their development priorities?

And how precisely do you evaluate and order the usefulness of a feature request that justifies claiming that this is the least useful?


Why is this an issue you're pursuing? Do you really wish to prevent it from being supported?

--Dave Griffith



Randall Schulz

0
Comment actions Permalink

So now you take it out on a stranger with whom you disagree but regarding a request with respect to which you have nothing at stake?

How, exactly, am I taking anything out on you?

Do you work for JetBrains?

No, I work with JetBrains, but not for them. Substantial chunks of IDEA were originally my work, mostly in the inspection and intention areas.

Do you speak for them?

No.

Do you determine their development priorities?

I've been known to make a lot of suggestions, many of which get followed, but no, I don't determine JetBrains dev prioritization.

+And how precisely do you evaluate and order the usefulness of a feature request that justifies claiming that this is the least useful?
+

Well, when a feature would be of use to only a single user, and then only on his personal projects, it seems fair to say it's in the running for least generally useful. If that feature is suggested specifically for the purpose of making software that is less standard and thus less maintainable, it wins the prize. Congrats.

--Dave Griffith

0
Comment actions Permalink

Well, when a feature would be of use to only a single
user, and then only on his personal projects, it
seems fair to say it's in the running for least
generally useful. If that feature is suggested
specifically for the purpose of making software that
is less standard and thus less maintainable...


You are confusing a convention, whether promulgated by Sun or not, with a standard. There is no standard for property accessor and mutator naming.

The contention that maintainability would be impaired is specious, as well. There is no inherent maintainability issue here, except perhaps the self-fulfilling one of preventing a code analysis feature of IDEA from supporting an alternate naming convention.

You furthermore suggest that small personal projects deserve less support. How do you justify that?

Lastly, you have no valid basis for concluding I am the only person who want this, it's just a presumption on your part.


I think you should just admit that you're overly hidebound by arbitrary conventions and have trouble tolerating free-thinkers. And I think that in your own mind you've elevated yourself and your significance in directing IDEA development far beyond its true status. Perhaps you could start a project for which you can be an actual dictator?

--Dave Griffith



Randall Schulz

0
Comment actions Permalink

Randall,

IntelliJ uses the same definition of property accessors as other tools/frameworks. Let's try to give this definition: it certainly has a structural part: accessor must consist of single assignment/return statement. But that's not all, otherwise a single field could have multiple accessors that seems undesirable. The other part is in the name. Since we have to give a universal definition, we have to choose the naming convention, that is going to be standard and shared among all java frameworks. This is the standard Dave was talking about, that we certainly don't won't break. If you like, you can consider the icon as IDEA's witness to this definition, nothing more. After all, this is just a presentation feature, it is not about compilability of your code.

0
Comment actions Permalink

The question is why you cannot be flexible and allow users to configure the name pattern aspect of triggering display of the property indicator as they can configure the name patterns for many other entities?

Randall Schulz

0
Comment actions Permalink

RS> The question is why you cannot be flexible and allow users to
RS> configure the name pattern aspect of triggering display of the
RS> property indicator as they can configure the name patterns for many
RS> other entities?

They could. Only it will probably involve a LOT of work, and developer time
is in finite supply.

Create a Jira request for it, and put a link here. After all, it's not impossible
that someone other than you will also vote for it.

And if the world is really crazy, a lot of people will vote for it so that
there's a business case for Jetbrains to implement it.

Carlos


0
Comment actions Permalink

Why are you so vehement in defending the absence of one little capability in such a large field of features?

I think it's really a matter of priorities. They are more likely to concentrate on features requested by a large group of developers, over features that are requested by one.

It's the nature of any program as sophisticated as IDEA that many of its features are used by only a small portion of its users.

Yes, but there is a big difference betweeen a 'small proportion of developers' and 'one developer using the feature on his home projects, as no-one else uses his convention'.

I wonder if it would be possible to write the functionality as a plug in ....

Still, file a JIRA, and if it gets enough votes, then I'm sure the JetBrains team will look into it.

0
Comment actions Permalink

You are confusing a convention, whether promulgated
by Sun or not, with a standard. There is no standard
for property accessor and mutator naming.


No, it's a standard, alright. A defacto standard, but since there are dejure JCP standards built around it even that is arguable. When something is known and used by that many developers and tools, and there are literally no competing alternatives, it's silly to call it anything but a standard.

Lastly, you have no valid basis for concluding I am
the only person who want this, it's just a
presumption on your part.


Dude, welcome to 2006. If there were anyone else trying to do what you were doing, it would show up on Google. There would be blog posts, impassioned forum rantings, and endless help requests showing up from searches. Probably there be someone trying to build a "methodology" around your idea, and then offering consulting and support on that methodology at reasonble rates. Someone else would be blaming your idea on Microsoft. A third person would be saying that your idea was great, but only for projects released under his particular favorite open source license, and worthless for all those other heretic open source licenses. Eclipse would already include the idea, buried somewhere in a control panel no one could find, and enabled only in certain arbitrarily chosen perspectives. About fifty people would be saying how much better your idea works in Ruby. Another fifty would write howtos explaining the applicability of your idea to AJAX developement (with really bad JavaScript examples). Eventually, Google itself would be shipping a beta version of a never-to-be-profitable Web2.0 application, based around your idea. (No offense, Keith.)

None of those exist. Googling for non-standard property method naming conventions turns up nothing. Your particular design fetish is so small it doesn't even have a support group. It's easier to find people willing to publicly admit having sex with kangaroos than to find people "morally opposed" to the JavaBeans naming conventions.

That's okay. Sometimes genius is lonely.

I think you should just admit that you're overly
hidebound by arbitrary conventions and have trouble
tolerating free-thinkers.


Again, welcome to 2006. If you're actually a free-thinker with a cool idea, other people will be telling you that, if only so they can cash in on it. If you have to tell other people that you're a free thinker, it most likely means that you're just a crank.

own mind you've elevated yourself and your
significance in directing IDEA development far beyond
its true status. Perhaps you could start a project
for which you can be an actual dictator?


Go to your IDEA plugin directory. Find the directories named "InspectionGadgets" and "IntentionPowerPack". Delete them. This will remove almost all of the online bug-finding and design-rule checking in IDEA, and about half of the smaller refactorings. Those were projects originally designed and developed by me, personally, under a pure "dictatorship" development model. Since then they've been included in the IDEA and are maintained as open source software (thanks again, Bas). For completeness, you'll also want to remove the "JSIntentions" and "Inspection-JS" directories, which are largely JavaScript reimaginings of the IG and IPP codebases, developed by Oliver Descout and Sixth and Red River Software, respectively. Give IDEA a try without all of those, and let me know what you think.

But look, the only "power" I've used in this discussion is the power to say that your feature request is basically ridiculous. I'm sticking with that (although to be honest I actually think your request is considerably more ridiculous than what I've described already). Everything else is in the hands of JetBrains, or would be if you bothered to submit a JIRA request.

--Dave Griffith

0
Comment actions Permalink

Ah thanks for that, really cheered my day up :D

0
Comment actions Permalink

My god, you're full of yourself.

We're talking about naming conventions here, not some matter of deep moral significance. I guess that's why you have to go so far over the top defending an indefensible position. "There's nothing new under the sun."


RRS

0
Comment actions Permalink

Hello Randall,

RS> My god, you're full of yourself.
RS>
RS> We're talking about naming conventions here, not some matter of deep
RS> moral significance. I guess that's why you have to go so far over
RS> the top defending an indefensible position. "There's nothing new
RS> under the sun."

Given that you have chosen to continue this discussion and not to follow
the standard feature request submission process (submitting a JIRA issue),
might I suppose that the feature we're speaking about is not so important
even for you?

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

My god, you're full of yourself.

... but he did sum up the software development industry in one handy paragraph .... :)

0
Comment actions Permalink

Allow User-Configuragle Naming Conventions for Java Property Accessor and Mutator Methods]]>

0
Comment actions Permalink

Here it is in one sentence:

"Java developers are sheep."

Or is it lemmings? I hear the whole running off cliffs thing is a myth, but the myth surely applies here.


RRS

0
Comment actions Permalink

My god, you're full of yourself.

And yet somehow, I'm not the one hurling insults and making wild and incorrect assumptions about you. How does that work out?

So did you delete those plugins, or should I mark you down as a satisfied user? No thanks necessary. I'm a giver.

--Dave Griffith

0
Comment actions Permalink

Oooh, just caught the sheep comment. Declaring your implicit moral and technological superiority to an entire thriving industry. Nice, and hardly full of yourself at all.

--Dave Griffith

0
Comment actions Permalink

You denigrated a legitimate request on my part based solely on your perception of its utility and popularity, insinuating that breaking with convention is somehow a reprehensible thing to do.

As for your being a "giver," I don't know. But you're manifestly snide, condescending and sarcastic. If you think that factual characterization of how you've presented your perspective on this matter is an insult, well, then it's an insult.

Randall Schulz

0

Please sign in to leave a comment.