Click here to Skip to main content
15,893,814 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 
AnswerRe: Interesting But... Pin
TimFlan15-Mar-18 6:31
TimFlan15-Mar-18 6:31 
I appreciate your response and don't disagree at all with anything you say.

I do have the database organised pretty much in a way that I am happy with and I do filter and display only the data that is required. Indeed my users can also turn on and off the columns they require and the system remembers their settings and the on screen displays self organise according to the case type they are working with. They also have a vertical single transaction viewer so I am pretty much covered on that end.

My users certainly seem happy enough, especially when they come from other firms but I think the main problem that irks me a little, and I don't think I spelt it out clearly enough, is that it is not only a many to many relationship (as in many transactions can be related to many PDFs) but it goes both ways (as in many PDFs can also belong to many transactions). It is this unavoidable 2 way complexity that I feel difficult to adequately and simply represent. I can/do filter and show only the PFS available one way and I can show the transactions that are available the other and so there is no issue per se' regards display. My users are however the ones who have to assign/categorise and check these initially. Because they are the ones assigning the data they also need to be able to see unassigned and incorrectly assigned data to then correct mistakes. So I am left with them having the option to see all the relationships each way at the same time. Because they often need to see transactions in an unfiltered way then this is where the naming comes in to play and it has certainly been well received but I wholly accept this is quite a rare use for a rare problem but I thought it might be fun to detail.

When they are checking and go through the transactions and see the related documents it is simple and fine. When they go through the documents and see the related transactions it is likewise straightforward. It is the idea of representing both at the same time that starts to look a little cumbersome. The transactions themselves can be quite different from one another which is another story OMG | :OMG: .

The system was written for my daughter's professional business which is fairly specialised and I have been strongly resisting the requests from similar firms to commercialise it. I had finished producing vertical market software years ago so I think I will keep it as a (time) expensive hobby.

Glad you enjoyed the idea and thanks for the response - I too scan articles for novel ideas - there were plenty of them in the 1980s (necessity required them) but we have tended to run a little dry of late.

Tim
Tim Flanders

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.