Search This Blog

Tuesday, October 1, 2013

How to generate a sequential and user-friendly identifier field within a business class

I have just created a new Code Example that demonstrates a very simple solution for the subject:

"Orders, articles or other business entities often require that you have user-friendly Id or Code fields that end-users can memorize and use during phone conversations. They are usually sequential, but some gaps can be allowed as well (e.g., when an order is deleted). Refer to this StackOverFlow thread for more information on this common scenario, and a possible implementation."

Check out http://www.devexpress.com/example=E4904 for a step-by-step instruction on how to implement this. 



It is based on the DistributedIdGeneratorHelper class from the DevExpress.Persistent.BaseImpl library (I know that many of you have already been using it for years).
I hope you will like this simple, but quite powerful solution, which can be considered as an alternative to the How to generate and assign a sequential number for a business object within a database transaction, while being a part of a successful saving process (XAF) example. 

No comments:

Post a Comment