Leszynski Naming Convention
   HOME

TheInfoList



OR:

The Leszynski naming convention (or LNC) is a variant of
Hungarian notation Hungarian notation is an identifier naming convention in computer programming in which the name of a variable or function indicates its intention or kind, or in some dialects, its type. The original Hungarian notation uses only intention or kin ...
popularized by consultant Stan Leszynski specifically for use with
Microsoft Access Microsoft Access is a database management system (DBMS) from Microsoft that combines the relational database, relational Access Database Engine (ACE) with a graphical user interface and software-development tools. It is a member of the Microsof ...
development. Although the naming convention is nowadays often used within the
Microsoft Access Microsoft Access is a database management system (DBMS) from Microsoft that combines the relational database, relational Access Database Engine (ACE) with a graphical user interface and software-development tools. It is a member of the Microsof ...
community, and is the standard in
Visual Basic Visual Basic is a name for a family of programming languages from Microsoft. It may refer to: * Visual Basic (.NET), the current version of Visual Basic launched in 2002 which runs on .NET * Visual Basic (classic), the original Visual Basic suppo ...
programming, it is not widely used elsewhere. The conventions are derived from an earlier set of conventions, the Leszynski/Reddick naming conventions, originally developed in 1992 by Greg Reddick. Eventually, Leszynski and Reddick had different ideas about how the conventions should be developed, and split into two separate sets of conventions, the other being the RVBA Conventions. As in all Hungarian notations, it uses prefixes (called ''tags'') to indicate the type of objects and database development fields. The general structure of Hungarian notation (named after
Charles Simonyi Charles Simonyi (; , ; born September 10, 1948) is a Hungarian Americans, Hungarian-American software architect. He introduced the graphical user interface to Bill Gates for the first time who later described it as the first of two revolutiona ...
's native country) is to break down object names into the following elements: refix(es)tag]BaseName uffix/QualifierThe tags are
lower case Letter case is the distinction between the letters that are in larger uppercase or capitals (more formally ''majuscule'') and smaller lowercase (more formally '' minuscule'') in the written representation of certain languages. The writing system ...
and the object name is
camel case The writing format camel case (sometimes stylized autological, autologically as camelCase or CamelCase, also known as camel caps or more formally as medial capitals) is the practice of writing phrases without spaces or punctuation and with cap ...
. Spaces and underscores are not used.


Advantages

Since the Leszynski naming convention is a special form of
Hungarian notation Hungarian notation is an identifier naming convention in computer programming in which the name of a variable or function indicates its intention or kind, or in some dialects, its type. The original Hungarian notation uses only intention or kin ...
the same general advantages also apply to the Leszynski convention. The use of distinctive prefixes makes your database self-documenting; when you see ''frmSales'' in VBA code, you will know that it references a form, and when you see ''curSales'' you will know that it is a Currency variable. When selecting a query from a drop-down list, you will know that a query starting with ''qmak'' is a make-table query, while one starting with ''quni'' is a union query. This information will allow you to avoid errors such as using the SetFocus method (a control method) with a field, or trying to open a table.


Disadvantages

*Since the Leszynski naming convention is a special form of
Hungarian notation Hungarian notation is an identifier naming convention in computer programming in which the name of a variable or function indicates its intention or kind, or in some dialects, its type. The original Hungarian notation uses only intention or kin ...
the same general disadvantages also apply to the Leszynski convention. *Changes in database design may require wholesale renaming. For example, replacing a table with a query would involve either retaining the tbl name for the query, or going through the entire database replacing the tbl name with a query name. *When transferring the database to a different DBMS, problems will arise if the target DBMS does not support CamelCase names. *As every object of the same type starts with the same letter, it is not possible to navigate through the objects in a List box by typing the beginning letter.


Elements

The elements of the naming convention are described in the following table.


The Basic LNC Object Prefixes


The Basic LNC Variable Prefixes


The Basic LNC Database Object Tags


The LNC Table Field Tags


The LNC Tags for VBA Variables


The LNC Tags for Form and Report Controls


Some Typical LNC Names for Database Objects, Controls and Variables


References

Part of this article is based on Helen Feddema's book, Expert One-on-One Microsoft Access Application Development, Wiley, . {{reflist


External links


Leszynski Naming Conventions for Microsoft Solution DevelopersLNC Renaming Add-in – A free Access add-in that automatically applies the LNC to an Access 2000, 2002 or 2003 databaseRVBA Conventions
Source code Naming conventions