views:

38

answers:

2

Question abou naming standards, following .NET standards.

How would you name a control that shows a grid of order objects? It is not an editor, but allows selection of one / more orders.

  • OrderGrid

or

  • OrdersGrid ?

Basically: Singular for the object shown, or plural?

We are in some quarrels here.

Note: the name is exposed to the user. The UI allows composition of the UI from controls, so the name shows up in a selectot for UI controls.

A: 

I'd pluralize:

  • For the GridView, I'd use gvOrders
  • For the DataGridView I'd use dgvOrders

Since it's exposed to users why not simply use Orders?

Jay Riggs
"gvOrders." is not a ".Net standard" as it should provide full name
lukas
-1. Does not even follow basic naming standards, plus - i neither use GridView nor DataGridView ;) I do not want to expose Orders because Controls for users follow a schema...
TomTom
There is an OrderEditor, Order(s)Report, Order(s)Grid. Single name gives no indication of the type of visualization, which I find kind of important.
TomTom
I'm not aware of any .NET 'standard' control naming conventions, nothing from Microsoft at least. This is a much discussed topic here on SO and elsewhere, and using a prefix notation to denote control type is very common. Who are your users who will see the control's name? If they're developers I'd stick with whatever convention for naming controls you've adapted elsewhere in your project (which might be your 'OrdersGrid'). Otherwise I like a more user friendly name like my 'Orders', or Luiscencio's 'Order Viewer'.
Jay Riggs
@Jay Riggs: See http://msdn.microsoft.com/en-us/library/ms229045.aspx . Especially the bold text saying "Do not use Hungarian notation."
cHao
Exactly on the hungarian notation - there ARE standards. That said, the users are USERS here. The UI is USER configurable like Sharepoint - users OPEN a WINDOW, then DROP Controls on them and hook them up. The scenario is not "order" like "online shop"
TomTom
but "Order" like "high speed financial trading application". A window may have a dozen controls creating a user customized trading interface. The OrderGrid, for example, grabs the Account(s) from an Account(s)Grid, filters by status (active etc.) and allows selection (for the editor).
TomTom
Users will spend 4-10 hours per day in front of the user interface and depend on speed and their own customizable guts (for example, DEVELOPERS can develop their own controls so users can have a VERY custom UI).
TomTom
@cHao - I've seen those recommendations but I still prefer Hungarian for my control names (despite what Microsoft recommends). Call me a rebel.
Jay Riggs
@Jay Riggs: I'd call you a masochist. :) Hungarian notation lost itself somewhere along the way; it used to be a good idea back when 'type' meant 'meta-type' rather than 'data type', but now -- in the days of intellisense and type inference -- it just makes variable names a pain to read.
cHao
@TomTom - Well, I'm not sure what you're saying in your last three comments. I can only suggest you follow any convention your organization has established for this situation. Failing that maybe you can contact your users ('USERS'?) and ask them what they think would be easiest for them. Otherwise I'll hope for another downvote and then delete my response for a Peer Pressure badge :)
Jay Riggs
@cHao - I agree with you that Hungarian notation is a pain and that's why I only use it for controls. One big reason is so I can look at a variable name in my code and immediately tell if it's referencing a control or not. I also like typing 'txt' in VS and seeing all TextBoxes appear in Intellisense. Obviously this is the stuff of religious wars, and I'm a rebel not a warrior!
Jay Riggs
I sometimes do the same, Jay - but these are VARIABLE names, not CLASS names ;) And VARIABLES I never ever expose outside of the class ;)
TomTom
+1  A: 

If the grid shows or represents multiple orders at once, i'd consider pluralizing. (That's not a hard rule, though -- "orders grid", "orders viewer" and the like sound odd to me.)

I'd opt for the singular by default, though, unless there's a reason to make it clear that there's multiple orders in there.

cHao
I currently tend towards keeping them singular for two reasons: First, Plural SOUNDS odd (as you say). Second, it keeps the Sort Order for all elements of the same worked upon class properly.
TomTom
Goindg with singular. An replacing "Grid" with "List" actually;)
TomTom