This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 72530 - Inconsistent command naming
Summary: Inconsistent command naming
Status: NEW
Alias: None
Product: javame
Classification: Unclassified
Component: Visual Designer (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Karol Harezlak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-10 15:17 UTC by andersborg
Modified: 2008-05-05 12:13 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andersborg 2006-02-10 15:17:36 UTC
It's actually a bit cumbersome dealing with larger VMD diagrams as commands are
named xxxCommand by default, which is counter to how other elements are named:
textXxx, stringXxx etc. I recommend this to be changed, so that the
auto-generated name instead starts with "cmd" and then the form name without
"form" and last the actual command. This minimizes naming conflicts. Until I
spotted this I often got okCommand3 etc and complete confusion when I later
worked with the code. Now I consistently name commands e.g. cmdSetupOk,
cmdEmoticonsCancel etc. In any case this would be a good coding guideline.
Comment 1 Martin Ryzl 2006-02-10 17:00:52 UTC
just a small comment - a command may be assigned to more than one
component/transition to save some memory. Personaly I agree with you that one
command per trasition makes the code more readable.
Comment 2 Lukas Hasik 2006-02-10 17:34:33 UTC
IMO, it has no sense to name commands by form name. The commands should be reused.
The naming seems consistent to me - the default name is the name of component
e.g. stringItem, textField and a number. Every name is unique. It isn't true in
your naming pattern. There are thousand opinions about the naming pattern
outthere. MAybe we could let user customize the pattern? 
Comment 3 Lukas Hasik 2006-02-10 19:01:33 UTC
copying from email:
The basic issue I had was that commands for some reason are not auto-named
the same way as the other elements: E.g. stringXxxxx and formXxxxx vs
xxxxxCommand. That's not consistent. It would be more logical with
cmd<command><number>, like cmdOk1.

The form pattern is of course my own choice, yet it saves me a lot of
commenting and confusion. Sharing commands makes no sense to me, as they
have a clear start and end, and it's neither intuitive to share them in VMD.
Also command numbering is just confusing. Naming them based on where they
originate makes it much easier to understand the generated code.

It's really only the first point that I think need fixing, or at least
considering. I'll take care of the second one myself  :) .

/Anders
Comment 4 David Kaspar 2006-02-13 14:56:18 UTC
The functionality could be implemented as:
1) When the component name will be resolved only once for its initialization value.
2) After that, the name will not be changed automatically e.g. when a Form where
a Command is used.

The question is: What the patterns should be there by default?
Comment 5 Lukas Hasik 2006-06-23 14:42:58 UTC
moving to mobility component
Comment 6 David Kaspar 2007-07-11 09:07:40 UTC
Designer 1 has been removed. Therefore reassigning to Designer 2 module. Probably this issue will be resolved in the future.
Comment 7 andersborg 2008-02-27 15:30:13 UTC
Regarding "IMO, it has no sense to name commands by form name. The commands should be reused."

Sure, but how do you do that easily in VMD? It's not intuitive, and it's also arguable whether this at all makes sense
from a RAD perspective, which is the reason to use VMD in the first place. Memory saved is development time lost.
Comment 8 Lukas Hasik 2008-02-27 17:23:57 UTC
intuitive? Try right click on a component/screen and use "Add" menu. 

issue 80165 is about the resource pool, feel free to reopen it with appropriate comments