Wednesday, February 23, 2011

Entity on Programming

Entity is an object whose existence can be distinguished against other objects. Entities can be people, objects, places, events, concepts. Example :

  • People: STUDENTS, LECTURERS, SUPPLIER, VENDOR
  • Objects: CAR, ENGINE, ROOM
  • Venue: THE STATE, THE VILLAGE, KAMPONG
  • Genesis: SALES, REGISTER
  • Concept: ACCOUNT, COURSE

An entity has a number of attributes
Example: The student has the name and address
Entity set is aa set of entities that share the same attributes
In programming OOP (Object Oriented Programming) or object-oriented Programming is a new way of thinking and logic in dealing with the problems that will try to overcome with the help of computers. OOP, unlike its predecessor (Structured Programming), trying to see problems through observation of the real world where every object is a single entity that has a combination of data structures and specific functions. This contrasts with structured programming where data structures and functions are defined separately and are not closely related.
it can be explained in the following code fragment:

in Python

in Java




hopefully useful for those who love OOP

No comments:

Post a Comment