I needed some suggestion from ya’ll..
I’m creating a video image viewer app for iPhone.
The main view has a set of categories each of which show a set of videos added to them.
Backend is modeled with Coredata.
One more thing, the videos and image entities have is “tags”… and behaves like any normal tag.
My question is, usually “category” entity is separate from “tag” entity, the difference being
Category<–>> VideoEntity
tag <<——>>VideoEntity.
Since tags are also kinda categories, would it be advisable to create just ONE Entity called “Category” and have an attribute of “isCategory, that show up permanently and cannot be deleted, where as others in that category can behave like tags.
Category will have a <<—->> Video entity.
This is making life simpler, but i don’t know if this would be the right way..
There are tons of way you can think your data model.
Maybe one of them as you say is to consider that a Tag is a kind of Category with some special functionality (a different relationship to VideoEntity).
You can then create an Entity called GeneralCategory and two entities called ExclusiveCategory and Tag
These two entities will inherit from the first GeneralCategory Entity (they’ll have their parent Entity set to GeneralCategory). The difference between them being the relationships
You’ll have all the name and description attributes declared in the parent entity (GeneralCategory)
The ExclusiveCategory entity will have a ExclusiveCategory<–>> VideoEntity relationship
The Tag entity will have a tag <<——>>VideoEntity relationship
But again there might be other ways to think of it …