Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi, more of a design question, but suppose I have data like:
<inventory> <item> <name>item's name</name> <price>item price</price> </item> <item> <name>item's name</name> <price>item price</price> </item> </inventory>
I will be adding, editing, and deleting items through a web-based interface. I need a way to identify items. Using the above fields within an item (such as the name) will not work because there may be duplicates. The best I've come up with so far is adding a unique 'id' attribute to the item tags. The problems with this approach are mostly related to the generation and deletion of the item numbers. All I can think of is running a cron job to reassign item ids as other are deleted, but this seems rather sub-optimal.
Any ideas?
|
|---|