Re: Simple Database Design Problem
Posted by: Filip Nedyalkov
Date: June 15, 2011 06:15AM

Hi gain with my last question.

After a lot of thinking I've figured out that due to my program limitation I must have a unique identifier for each component. It's unavoidable if I want to be able to share the components among the page templates. And each page template has predefined which component it is using. So lets say template NEWS uses components ARTICLES and COMMENTS. This is apart from the database records. There is no problem to identify the template by template_id, but to figure out which components it's using you need to address them with their unique names ARTICLES and COMMENTS to find them in the components table. Otherwise if there are more than 1 component named ARTICLES for example the template won't be able to figure out which of these 2 components is his. Even if I remove the unique name and try to use the components by ids and manually select which component goes to which template, the template itself won't be able to figure out which of the components you selected is which, unless you know in advance which component ids the components will get and write them down in the template. Which is not possible.

So having a predefined unique identifier for a component in my case is a must,like the ISBN for the books.

So my question is: What is the best way to create a unique identifier?

For example if it's only by component_name, chances to have a matching component names is high. But If I have 2 files: component_name and component_package_name. The chances to have both of them match is a lot less.

If I take the author example and the problems you named, to solve the problem there, maybe we could add birthday of the author, which makes it highly unlikely that 2 authors will have matching names and birthdays for example and if we add birth_town for example to that chances get incredibly low. Also have in mind that all of this still allows for the system to pop up a dialog if for example the name of the author matches somewhere and give you the option to use the existing one or add new author with the predefined data.

So once again to repeat the question: What is the best way to create a unique identifier? In your practice if you had such case, what did you find to be best solution for such scenario?

Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.