Get a Jumpstart with our Sample Apps
Results 1 to 28 of 28

Thread: Grid naming convention suggestions

  1. #1
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,486

    Default Grid naming convention suggestions

    We are working on a large application with many grids to be developed. We have come up with the following naming convention:

    Prefix-Table_Name-Descriptor(optional)_Type-Layout-Attributes(optional)

    Prefix:
    ADM = Administrative (clerical)
    USR = User
    SYS = System

    Table_Name is self evident

    Descriptor - we’re not sure yet, but we figure there will be something or other unforeseen that we may need here.

    Type (matches the Alpha Five default grid templates):
    _R = Read only
    _U = Updateable
    _A = Add records only
    _D = Updateable with detail section
    _S = Single record form (view, edit, insert, delete)

    Layout (corresponding to grid layout types):
    T = Tabular
    F = Form (columnar)
    S = Stacked columnar

    Attributes (there may be other attributes that we may define in the future):
    L = grid contains Linked grid content
    R = grid contains a row expander
    S = grid contains a search part

    e.g.
    USR_Accounts_UTLS which means:
    User grid, Accounts_Table, Updateable, Tabular, contains a Linked Content Section, and a SearchPart

    Does anyone have any suggestions or comments or something that we may have forgotten?

  2. #2
    Member
    Real Name
    Marion Taylor
    Join Date
    Jan 2012
    Location
    Hudson Valley, NY
    Posts
    481

    Default Re: Grid naming convention suggestions

    Hello Peter -

    I have been deliberating this for my project as well, so I'm glad to see this post. I do have 2 comments/questions

    1. TYPE - and this is probably just because I'm so new to Alpha 5, and web apps etc -

    I was thinking of incorporating 4 characters for this, based on CRUD
    so that if a component is read only, the component name would have: _xRxx
    if a component can handle ADD and UPDATE, it would have: _CRUx

    I guess though, the R is redundant, since it would always be applicable....

    2. ATTRIBUTES
    Since your attributes seem attuned to linked content, would you have a separate attribute to indicate that you have a field.specialcontrol.linked grid? Or would that have an L attribute? Seems that there are 3 basic ways of including linked content:
    field.special control
    row expander with linked content
    linked content

    I'm inclined to give all of those the attribute of L (to indicate that there is linked content, in some fashion), or to add an attribute for the embedded link content as a field....

  3. #3
    Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,738

    Default Re: Grid naming convention suggestions

    I think maybe you don't need the last two, Layout and Attribute. Its particularly dangerous to get too detailed in the naming convention because things change. You might have a grid with a Row expander and then, after you have included this grid as a linked grid, and inserted on A5W pages, and in a tabbed ui, and now you find it looks better without the Row expander, and now it is too late to rename it without significant work to re-insert it everywhere. I find the number one reason I need to systematically name components is to have a clue which one I need to edit when observing the application live.

    The most organized application I have seen had your Prefix for Admin and System, but also had COM_ for Company Level, then everything else was prefixed by Family or Module. So COM_PRD_* was a component within the Product module, designed for use by a Company level user. ADM_PRD_* was for an Admin level user in Product module. Actually, it was AD_PR_, keeping the prefix shorter.

    The worst thing I have done is to prefix all of my tables and components with some arbitrary indicator like "a_", as in a_userlist, a_property, where "a_" means nothing.

    I also use "zd_" for items I am pretty sure I want to delete or review for deletion before I actually purge them.

    There is an IADN Best Practices Guideline at http://alphadevnet.com/downloads/Alp...Guidelines.pdf.

    If this thread results in a discussion about best practices for naming conventions, I will update that document to reflect the consensus and we can us it to make our projects a little more uniform.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  4. #4
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,486

    Default Re: Grid naming convention suggestions

    Thanks both. Hopefully some others will chime in with comments & suggestions.

  5. #5
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    6,363

    Default Re: Grid naming convention suggestions

    I try to use a Descriptor, along with almost everything else you've compiled. I find the table name itself isn't enough to find something you're looking for, although it gets pretty close.

    The only other item I put in is a distinction between grids and dialogs. Right now I use "grd" or "dlg" but you could incorporate it as a part of the Layout simply as G or D then add the Layout options you already have.

    GT for Grid Tabular, or DR for Dialog Repeating Section

  6. #6
    Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,738

    Default Re: Grid naming convention suggestions

    This reminds me, we need to petition Alpha to add the "Description" field to the detail list of components. The Description field is found under Information for each component.

    BTW, note that there is a filter in the upper right of the component list. I always forget about that, but it is perfect reason to have a naming convention for your components. It filters on any part of the component name. So if you type in 'sys' you get all of your SYS prefixed components, if you enter 'product' you get all of your components that have to do with Products, etc.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  7. #7
    "Certified" Alphaholic
    Real Name
    Frank Bicknell
    Join Date
    Feb 2010
    Location
    39.1915° N, 84.4348° W
    Posts
    2,408

    Default Re: Grid naming convention suggestions

    I wish I would have seen this a couple of years ago. My grid names are well, a bit cryptic to say the least. I have over a hundred grids in my application. I plan to start using this method as I make changes and add new grids. The IADN Best Practices Guideline is a great resource too.

    Thanks for starting this thread.
    Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

  8. #8
    Member
    Real Name
    Marion Taylor
    Join Date
    Jan 2012
    Location
    Hudson Valley, NY
    Posts
    481

    Default Re: Grid naming convention suggestions

    Pete -

    I have 2 questions about your 'Types'

    1. I'm trying to match up your Types with A5's default grid templates for SQL, but I'm having trouble because they seem to be in a different sequence and use different words.

    Did I match things up the way you had in mind?
    CODE | Pete's words | A5 words
    _R | Read only | Read-only Grid
    _U | Updateable | Updateable grid
    _A | Add records only | Enter record Form
    _D | Updateable with detail section | Grid with updateable Detail View
    _S | Single record form (view, edit, insert, delete) | Single-Record Form - view, edit, insert, delete


    2. Is there a way to know which template was used for creating a grid? I have right clicked on a component name from within WebControl Panel, and selected Show Details to see the xbasic code, but it simply says that the ComponentType is "Grid"

    Now that I'm understanding the different templates better, I would like to know which template I used to create the component. Yes, in some instances, I can figure it out by deduction, but.....I'm wondering if there is an easy way to know how I created it.

    Thanks -
    Marion

  9. #9
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,486

    Default Re: Grid naming convention suggestions

    1. Yes, you got it.
    2. Not that I'm aware of. A template is merely a combination of grid settings. The best way is to look at the grid's "component type" settings. Actually, the trickiest one above is the "Enter record Form " which uses a hidden section in the master template.

  10. #10
    Member
    Real Name
    Lee Vasic
    Join Date
    May 2010
    Location
    Salt Lake City
    Posts
    993

    Default Re: Grid naming convention suggestions

    I like to name it based on the module I'm building.

    So StaffGr would be the main Grid and Form for the Staff
    StaffComplianceRef is the Compliance Grid being Called from the Staff Grid the REF is that it is a cross-reference table which means it's looking things in the master list.
    DEX means it is an index table. (Dex and Ref aren't called directly but through the Staff Grid)
    Pro for process
    Rpts for reports
    Lib for library
    See attached.

    NamingConvention.jpg

    With column names I like to name them like this with Camel Case:
    NameFirst
    NameMiddle
    NameLast
    NameNick
    PhoneHome
    PhoneOffice
    PhoneCell
    DateBeg
    DateAdd
    DateMod
    DateDel

  11. #11
    Member
    Real Name
    Marion Taylor
    Join Date
    Jan 2012
    Location
    Hudson Valley, NY
    Posts
    481

    Default Re: Grid naming convention suggestions

    this is not grid naming conventions, which was the title of the thread, but - as other posts have mentioned related conventions, I decided to chime in with a comment.

    As I'm learning and evaluating and inexperienced, I find that I'm creating numerous views in SQL, to use in A5. I've starting including A5 as part of the view title, so that I know these views were created specifically for the UI (as opposed to views I had created for use in Report Builder)
    MSQL since 2010
    A5V11 since Feb 2012

  12. #12
    Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,738

    Default Re: Grid naming convention suggestions

    With column names I like to name them like this with Camel Case:
    NameFirst
    NameMiddle
    When creating a grid Alpha automatically converts table fields like "first_name" to "First Name" for the field label. So it is convenient to name your table field names using underbar and whole words like "first_name", "deliver_time". It speeds up development of the Grid because you don't have to go back and adjust all of the labels.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  13. #13
    Member The Mage's Avatar
    Real Name
    William McGowen
    Join Date
    Jul 2010
    Location
    Nebraska
    Posts
    287

    Default Re: Grid naming convention suggestions

    I should have looked more into this myself, but I came up with a naming convention for my app.

    Pretty much I use Camel Case, mostly to eliminate the use of under-bars. Then the first name is the page it is going to be on, and sub names are based on what the main point of that grid is doing. The main grid on a page is often just a single word.

    So for example I will be building a Location page, and on that page I have a Locations grid. (I pluralize the main grid.)
    Linked I have a LocationDetail grid. (I made the detail separate for convenience.)
    LocationMap
    LocationProducts
    LocationTax

    Now I have a LocationMachineGrid, with the word Grid in it, which I probably didn't need, but it contains a linked grid in a cell, and that grid is LocationMachineCell. I used Grid and Cell to differentiate the two before realizing I should have had the first one as the main, and didn't need the Grid.

    Also I know I should have abbreviated these grids. In other words they should have been LocMap, LocProduct LocTax, LocMach, LocMachCel respectively.

    Okay, not the best naming convention, but it at least keeps everything organized for what I am doing. I think I will put a little more thought into the naming conventions on my next project.

  14. #14
    Member
    Real Name
    Marion Taylor
    Join Date
    Jan 2012
    Location
    Hudson Valley, NY
    Posts
    481

    Default Re: Grid naming convention suggestions

    @PeterG

    Can you please expand/explain how you choose the Prefix (ADM, USR, SYS)

    For example, what do you use for a Tabbed UI, or Navigation System Component?

    If you had a grid component that is used as a look-up, but doesn't really have any data entry screens associated with it- would that be ADM or SYS?
    MSQL since 2010
    A5V11 since Feb 2012

  15. #15
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,486

    Default Re: Grid naming convention suggestions

    Marion,

    Tabbed_ui is SYS_Menu, a lookup is USR---. ADM or admin refers to company administrators, including clerical people. System refers to system managers/db developers. Sure the tabbed_ui is not limited to "SYS", but...

  16. #16
    Member The Mage's Avatar
    Real Name
    William McGowen
    Join Date
    Jul 2010
    Location
    Nebraska
    Posts
    287

    Default Re: Grid naming convention suggestions

    You could have a default for some of these. For example if anything is user, instead of usr, you could simply skip that one, so if there is no prefix, it must be user. Just a thought.

  17. #17
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,486

    Default Re: Grid naming convention suggestions

    Quote Originally Posted by The Mage View Post
    You could have a default for some of these. For example if anything is user, instead of usr, you could simply skip that one, so if there is no prefix, it must be user. Just a thought.
    Sure you could do just about anything, although it's a lot neater w. the 3-prefix - see image (and we're just beginning here).

    Naming Convention.gif

  18. #18
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,542

    Default Re: Grid naming convention suggestions

    This is a great thread for type A personalities! I'm a bit looser, but for me, the important thing is to quickly find the component I want to edit, so I tend to name pages and components with the same name ( the inv_edit component, if in a page, is in the inv_edit page) and with a (mostly) three digit prefix that serves to keep everything associated with, say, inventory all together in one section of the list. Then, a verb to tell me what it does, such as inv_add, inv_edit, inv_list, inv_reprice, inv_purge, and so on. Even with hundreds of components, that works well enough for me.

    Since Alpha advises keeping the component names "as short as possible", I try not to put too much info in the name. Besides, If I want to work on the inv_edit component, does it really matter if the name tells me it is a grid or a dialog or a dialog2? I'll still open it up and get to it.
    Pat Bremkamp
    MindKicks Consulting

  19. #19
    Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,738

    Default Re: Grid naming convention suggestions

    Note - I will be putting a draft naming conventions document up on the Wiki when I get a chance for us to collaborate on something usable.

    Couple ideas I had:
    Put meaning in the first 15 characters - because the fifteen so appear as the component name in the browser, and sometimes you need to know which one you are looking at.
    Readability - make it something you will easily get a year from now. If it is too structured and abbreviated, you won't recognize it.
    Obvious - a grid based on the Student table probably should have the word "student" in it somewhere.
    Searchable - as of a few patches we can search component names so having "SYS" in all system components allow you to filter to see only those.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  20. #20
    Member
    Real Name
    Marion Taylor
    Join Date
    Jan 2012
    Location
    Hudson Valley, NY
    Posts
    481

    Default Re: Grid naming convention suggestions

    as a newcomer, and this is probably different for a more experienced developer

    I find the concept of including the VERB in the component name.... intimidating. I'm not saying it should not be included. I'm just pointing out that it feels complicated.

    If you have a read only grid with an updateable detail view - what is the verb?

    If you have a single detail view, set for read only but you can click and go into edit mode, what is the verb?

    And, since it is soooo easy to change how a grid is used once you are inside the grid (after creation) - ie, toggling options on and off, the verb that is in the name may not be applicable once you are done with the design.

    When I began creating Stored Procedures in SQL I had the same issue... wanting the verb in the title, but not being able to know where or what I was doing. Now it's 2nd nature - I know why I'm creating the SP and what I want it to do. I imagine it will be the same for grid components....
    MSQL since 2010
    A5V11 since Feb 2012

  21. #21
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,542

    Default Re: Grid naming convention suggestions

    Marion,

    Regarding MySQL stored procedures and UDF's in Xbasic, I agree with you. For those, I tend to use much longer names, such as "Get_Lat_Long_From_LSD()" which is a routine that gets the latitude and longitude from the Canadian LSD value, and "Create_Project_Copies" which makes multiple copies of projects. Using long involved names there makes it less likely that I'm going to bump into one of the thousands of Alpha functions, past and future.

    If I have a grid to edit an employee record, though, I'll name it em_edit, or if there is a dialog to edit a single employee and a grid to edil all employees, I might name them em_edit_one and em_edit_all.

    If there is one employee edit component, and I name it em_edit, why does it matter if it is a read only grid with an updateable detail, or a single record grid with linked grids. What would I do different if I knew that from the name? Infomation is only valueable if it causes you to do something different that you would do otherwise.
    Pat Bremkamp
    MindKicks Consulting

  22. #22
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,542

    Default Re: Grid naming convention suggestions

    I can see that if you have a big project with multiple programmers working on the same project, that having agreed on naming conventions would be a help. It would be frustrating if the other programmers weren't picking the "right" prefix or verb!

    Also, I have a project where my client's parent company has a consultant to manage my project. In that case, they are really concerned about naming conventions and documnetation because when my client grows large enough, they plan to have my programs rewritten in a "real" language (meaning not Alpha) by "real" programmers (meaning not me). That doesn't bother me. I'd like to be there when they put together the estimate and the schedule!
    Pat Bremkamp
    MindKicks Consulting

  23. #23
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,486

    Default Re: Grid naming convention suggestions

    Quote Originally Posted by Pat Bremkamp View Post
    ...because when my client grows large enough, they plan to have my programs rewritten in a "real" language (meaning not Alpha) by "real" programmers (meaning not me).
    You're killing me!

    Hey, there's the "real" and then there's the "ideal". The ideal is good, but the real is better. What your client has yet to understand is that you're the "real" and that fantasy they are having is the "ideal". Good luck to them. In the mean time, hopefully your effort is financially rewarding. Ya gotta love it!

  24. #24
    Member
    Real Name
    Bill
    Join Date
    Dec 2010
    Location
    Waterloo, Ontario, Canada
    Posts
    105

    Default Re: Grid naming convention suggestions

    On 12 Feb 2012 Steve said, "This reminds me, we need to petition Alpha to add the "Description" field to the detail list of components. The Description field is found under Information for each component."

    Excellent idea. This would give us immediate insight into the grids purpose and function, without having to rely so much on a naming convention. The description column would be added to the Name, Size, Modified, Type columns on the grid list.

  25. #25
    Member
    Real Name
    Lee Vasic
    Join Date
    May 2010
    Location
    Salt Lake City
    Posts
    993

    Default Re: Grid naming convention suggestions

    This has been added in V12. Works great. Just one of those little things that really improves productivity.

  26. #26
    Member
    Real Name
    Bill
    Join Date
    Dec 2010
    Location
    Waterloo, Ontario, Canada
    Posts
    105

    Default Re: Grid naming convention suggestions

    Would have been nice if they had pity on us poor folk and made it an upgrade to V11...

  27. #27
    Member
    Real Name
    Ben Sacherich
    Join Date
    Mar 2014
    Location
    Pittsburgh, PA
    Posts
    54

    Default Re: Grid naming convention suggestions

    Quote Originally Posted by Steve Wood View Post
    There is an IADN Best Practices Guideline at http://alphadevnet.com/downloads/Alp...Guidelines.pdf.

    If this thread results in a discussion about best practices for naming conventions, I will update that document to reflect the consensus and we can us it to make our projects a little more uniform.
    I was looking for discussion on naming conventions and found this old thread. I just wanted to share the updated link to the IADN Best Practices guide in case anyone else was looking for it. The guide hasn't been updated since 2014.

    http://help.iadn.com/bestpractices/

    If you like to use long object names, remember this tip:
    Although not mandatory, component names (grids, dialogs, etc.) should be named so they are unique within the first 15 characters.

    Reason: When a component is inserted into an A5W page, Alpha Five automatically truncates the component name to 15 characters in code applied inside the <head> and <body> tags. Alpha Five ensures there is no conflict, but it becomes difficult for you as the programmer to identify your component code within the A5W page if they are not unique within the first 15 characters.
    Last edited by Ben S.; 11-23-2017 at 12:31 AM.

  28. #28
    Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,738

    Default Re: Grid naming convention suggestions

    If I ever got the sense that it was being used I would have maintained it. I pushed it for quite a while. I do maintain my own cheat sheet but I have not updated this reference because it seemed nobody used it. Fortunately everything in the guide is still completely valid.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

Similar Threads

  1. naming conventions
    By dlazenby in forum Alpha Five Version 9 - Desktop Applications
    Replies: 4
    Last Post: 07-11-2008, 09:59 AM
  2. UI_MODELESS_DLG_BOX() Special naming convention
    By Fred Zag in forum Alpha Five Version 6
    Replies: 6
    Last Post: 02-20-2007, 12:02 PM
  3. Another Naming Convention / Lookup Question
    By jkletrovets in forum Alpha Five Version 7
    Replies: 0
    Last Post: 04-06-2006, 05:17 AM
  4. Naming conventions
    By Ohlen Cartmell in forum Alpha Five Version 5
    Replies: 9
    Last Post: 03-31-2004, 04:09 AM
  5. naming
    By Bruce Peaslee in forum Alpha Five Version 5
    Replies: 4
    Last Post: 01-28-2003, 07:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •