views:

68

answers:

1

I have a data model with several entities and some of those entities share attributes that naturally have the same name. Is there any reason to add detail to those names to help distinguish them or will I only ever use them in their fully qualified formats?

For example, if my model had library, librarian, book, borrower and author entities all those entities might have an attribute called "name". If that attribute will almost always be referred to in a qualified format (e.g. borrower.name or book.name) there'd be no reason to choose different names but if there's any chance of confusion I would be inclined to make the attribute names unique (e.g. libraryName, librarianName, etc).

I apologise for such a basic question but I'm new to Core Data and not yet familiar with how these attribute names are used.

+1  A: 

Using the same attribute name, i.e. name for both Person and Pet entities is fine.

The case where this is not ok is the case Pet inherits from person — in this case the managed object model compiler will generate an error about conflicting property names when it compiles your model file.

Jim Correia