Click here to Skip to main content
15,892,059 members
Articles
Tip/Trick
(untagged)

ID Synonyms or Naming your IDs

Rate me:
Please Sign up or sign in to vote.
4.67/5 (6 votes)
13 Mar 2018CPOL5 min read 6K   1   3
The idea that is the subject of this article is simply to name your transactions with common nouns.

Introduction

When developing software, we regularly add incremental numbers to our data, usually for relational purposes and often for use within a database. If you are like me, then a primary key is often the starting point. Much of the time, these numbers are not exposed to our users because, frankly, they don’t really need to know them. When we do expose them, the users generally know what they represent – it may be a single case (header) number or a transactional type such as an invoice or part number.

So far so good, it doesn’t matter if the number becomes incredibly long. If the user needs to refer to it, they probably just look at the last few digits for matching and they can always cut and paste anyway right? Well, yes absolutely, though it does get harder for them to quote the numbers to each other and over the phone, but generally everyone is happy enough.

However, there are rare occasions when the users themselves are the ones who have to build and relate transaction numbers and sometimes in a multiway format. I have users who are required to relate multiple transactions to single documents and multiple documents to single transactions. In general terms, this is a many-to-many relationship – bread and butter for developers and database administrators I suspect but not so easy for users to understand or operate.

"Filters" I hear you say.

Yes of course, once the relationships are made/attached and the data is all in suitable order, the users can see their results adequately when filtered, right? Well yes to a degree and no whilst they are making those relationships., Filtering does help but only once they have their data all correctly organised. Even then, it is hard to relate multiway relationships simply via a UI so the average user can see which documents are attached to which transactions and vice versa. It quickly becomes visibly confusing.

The idea that is the subject of this article is simply to name your transactions with common nouns.

On the left is an example of ID numbers in a grid and on the right, the same data but using nouns.

Image 1

So, for example, let us say a PDF document is shown for 771936 and with that document, the transaction numbers 771932 and 771925 are also shown as being attached to that document.

So, we would be showing that PDF (on a separate screen in my instance) and the fact that it has transactions 771936,771932 and 771925 attached.

Or, if using this idea, the document could just note that ZELDA, DAWN and KESHA is attached to it. I know which I find easier to say and remember.

This method has proven to reduce errors and speed up the users' understanding. It is worth noting that the ID numbers will just keep getting longer and thus harder.

In addition to this, when a user has a query that they need to escalate to a supervisor they, and the supervisor, find it much easier to relate to than a list of numbers that people commonly make mistakes with (mainly by transposing two digits).

For the curious, the above example has paper clip icons, these represent documents attached, red means more than one and the user can hover or click them to see more ifto. This paperclip principle is also used for the other way within the grid but I am keeping the subject as simple as possible here. Also, the small blue icon in the column header can be clicked to alternate between showing the names and the ID numbers.

So How Is It Done?

Obviously, we cannot have millions of nouns. What I did was to compile a fixed list of 10,000 nouns from publicly available lists. The nouns are selected by using a simple modulus of 10,000 from the ID number.

So, if your ID number was 10,001 and it had the name JERRY, then so too would 20,001.

Therefore, it’s NOT FOOLPROOF.

This basic calculation method may or may not be suitable for your particular instance and so you may have to come up with a different criterion. In my circumstance, the numbers will not be more than 10,000 apart and a duplication of the name would not be fatal. In addition, the nouns are only useful to a point but proper filtering once the data is properly attributed also contributes to understanding.

Is That It?

Not quite.

Simply sticking an alphabetic list in and relating it via ID numbers I found wasn’t quite good enough.

If you can organise your list of names such that they are start with a different letter consecutively, then the user is less likely to confuse them. My names list is organised in sequences of A-Z and although multiple users are committing at the same time regularly two instances of the same initial letter would rarely meet on screen.

Also, I adopted "ragged right" approach. It is my experience that people read vertical lists easier if the words are not of uniform length. Again, I also organised the data in a ragged right order by referring to their lengths. If you want to see the difference, just pop up an editor and create a list of words where they tend to align at the left and right, it will be harder to read and discern individuals from.

At this point, I would ask that if anyone has any neat ideas for representing many to many relationships (especially transactions related to documents) then I for one would find it of interest. 😊

This is an area I would like to improve upon. Although my users seem happy, new ones are often fazed with the problem at the start.

Background

I have written and currently support a legal costing program package where a wide variety of documents need to be analysed and have data recorded against them. It is for this software that I implemented this idea during my efforts to simplify what is basically a complex problem to represent.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Unknown
I am UK based and started teaching myself programming in 1980. Whilst learning I produced some games in machine code (6502/Z80) and then produced software for UK and Irish pharmacies. I had a “retirement” break of over 10 years and picked it up again. I still have to cope with my dislike of curly braces and avoid them where possible.

Comments and Discussions

 
QuestionInteresting But... Pin
C Grant Anderson14-Mar-18 8:37
professionalC Grant Anderson14-Mar-18 8:37 
Hi Tim,

Interesting and innovative but unfortunately I don't see it as very practical.

Why not just determine from the user perspective what the PDFs represent - Companies, contracts, contact people, or what have you. Then in the GUI just display one or more of those data elements that the people are familiar with and looking for. You can enhance the GUI by showing only those PDFs for transactions that are recent or being worked on (i.e. not archived). This is more complex than your ID naming approach but it does not break the internal workings of the data model and also should be easier for your users to use. And I suspect that it will also be intuitive for them - Developers should completely understand how users use a GUI/UX and go out of their way to make it easy, convenient, and intuitive for users. Else how can they design and build a good system? Grant's Law of UX - The First Thing is for it to work. The Second Thing is for it to work well for the majority of users. The Third Thing is for it to work for all users from newbies to power users.

While I see this as innovative...And kudos for that...I also look at it that the data layer and database needs to be organized properly and nicely but can often further abstracted and simplified for the user. So I would leave the data layer and DB the way it is and handle the UI/UX abstraction in that layer. While it may seem to be a nice shortcut I've found that mixing things can cause confusion for maintenance programmers so I always recommend that things be kept simple...And well documented.

While I don't think that this approach should be used I do see it as a good idea to put up for discussion and a very good example of innovative thinking. I don't see a lot of original thinking or innovation in software nowadays. So I would like to acknowledge and praise your innovation thinking here. Please keep it up! Not every creative idea can be used everywhere but we need to foster and nurture real innovation in software instead of endless copy catting of "new" recycled languages and libraries of the week. If you or anyone else would like to discuss innovation in software ideas or in general please feel free to contact me. It would be nice to get a discussion going.

Thanks and please keep up the innovative ideas!

- Grant
AnswerRe: Interesting But... Pin
TimFlan15-Mar-18 6:31
TimFlan15-Mar-18 6:31 
GeneralMy vote of 5 Pin
RickZeeland13-Mar-18 11:06
mveRickZeeland13-Mar-18 11:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.