3

I'm wondering if my textbook has a non-standard definition. I've red this question and it is not a duplicate. The book defines entities and entity sets as

An entity is an abstract object of some sort, and a collection of similar entities forms an entity set. An entity is some ways resembles an "object" in the sense of object-oriented programing. Likewise, an entity set bears some resemblance to a class of objects.

When they say "class of objects" are they referring to a class as in the thing you instantiate to make new objects (I know this is just a loose comparison). It sounds like an entity set is more general than just an entity, but in this question a reply states "An entity set usually represents a slice of an entities data" which is the opposite.

I thought an entity is like a table in a database, then what's an entity set?

Community
  • 1
  • 1
Celeritas
  • 14,489
  • 36
  • 113
  • 194
  • I think `class of objects` means a group of objects in this context. – SomeWittyUsername Nov 05 '12 at 07:24
  • I tend to think that the Authors definition regarding comparing "entity set" to "class of objects" is misleading, if not wrong. Entity set is a set, as its name implies. Which in OOP translates to some sort of container. Class is a type, a generalization of properties of certain objects. – Nazar Merza Nov 05 '12 at 18:29

3 Answers3

7

An entity is a real world object such as a person, a place or a thing or an abstract object such as a course, a flight reservation, etc. Here we use article 'a' or 'an' to indicate an instance of a specific person, a specific place or a specific thing as an entity. For example, I, by name 'Vidyasagar' is an entity and you are also an entity. All similar entities form entity set. Similar means each entity has the same (for simplicity) properties. All person entities will have same properties such as first name, middle name, last name, date of birth, etc. Entity and entity sets are analogous to relational database terms row/tuple and table/relation repectively. These are also analogous to OOPS terminology of objects and collection of objects respectively.

Obviously we can not store real world entities such as persons, toys, cities, etc., in a database! We can store only data about real world entities. The data consists of values for each property of entities. For example, data for city entities could be 'London' and 'UK' for London city entity, 'Paris' and 'France' for Paris city entity and 'Bangalore' and 'India' for Bangalore city entity. We use values of one or more properties (key) to refer to an entity for convenience. Hence when we say Paris entity, we mean the city Paris which is in France. That is we are referring to the pair of values Paris and France. The pair of values together is an entity. The three entities are ('London', 'UK'), ('Paris', 'France') and ('Bangalore', 'India'). There is no significance to parentheses used as such. These three entities will form an entity set, say, CITIES. Hope this is clear.

mvsagar
  • 1,998
  • 2
  • 17
  • 19
1

The definiton in your textbook in my opinion is not so clear. I find it very confusing. I think you should stop at the first part of the definition:

An entity is an abstract object of some sort, and a collection of similar entities forms an entity set.

A set is simply a collection, a group of these entities. Usually the type of these entities is the same, so I suppose that saying:

an entity set bears some resemblance to a class of objects.

it means that objects in this collection/set are instance of the same class.

davioooh
  • 23,742
  • 39
  • 159
  • 250
0

An entity is an abstract object of some sort, and a collection of similar entities forms an entity set. An entity is some ways resembles an "object" in the sense of object-oriented programing. Likewise, an entity set bears some resemblance to a class of objects

rizwan
  • 1